Commit 900770bf authored by Mikel Astiz's avatar Mikel Astiz Committed by Commit Bot

Move sync-related history files to new subdirectory

As suggested in recent reviews, it's desirable to keep the sync-related
source code in a dedicated directory, with separate OWNERS file. The
files still belong to the same build targets, because there would be
cyclic build dependencies otherwise.

While moving the files, various trivial changes are introduced to avoid
presubmit and linter errors.

Bug: None
Cq-Include-Trybots: luci.chromium.try:ios-simulator-cronet;luci.chromium.try:ios-simulator-full-configs
Change-Id: I8ce0070e2449f4285c3ccaa85e9d550d61433744
Reviewed-on: https://chromium-review.googlesource.com/1256809Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Mikel Astiz <mastiz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595892}
parent 0e4fc355
...@@ -56,8 +56,8 @@ ...@@ -56,8 +56,8 @@
#include "components/browser_sync/profile_sync_service.h" #include "components/browser_sync/profile_sync_service.h"
#include "components/consent_auditor/consent_auditor.h" #include "components/consent_auditor/consent_auditor.h"
#include "components/dom_distiller/core/dom_distiller_service.h" #include "components/dom_distiller/core/dom_distiller_service.h"
#include "components/history/core/browser/history_model_worker.h"
#include "components/history/core/browser/history_service.h" #include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/sync/history_model_worker.h"
#include "components/invalidation/impl/invalidation_switches.h" #include "components/invalidation/impl/invalidation_switches.h"
#include "components/invalidation/impl/profile_invalidation_provider.h" #include "components/invalidation/impl/profile_invalidation_provider.h"
#include "components/password_manager/core/browser/password_model_worker.h" #include "components/password_manager/core/browser/password_model_worker.h"
......
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
#include "components/browser_sync/browser_sync_switches.h" #include "components/browser_sync/browser_sync_switches.h"
#include "components/browser_sync/profile_sync_service.h" #include "components/browser_sync/profile_sync_service.h"
#include "components/dom_distiller/core/dom_distiller_features.h" #include "components/dom_distiller/core/dom_distiller_features.h"
#include "components/history/core/browser/history_delete_directives_data_type_controller.h" #include "components/history/core/browser/sync/history_delete_directives_data_type_controller.h"
#include "components/history/core/browser/history_delete_directives_model_type_controller.h" #include "components/history/core/browser/sync/history_delete_directives_model_type_controller.h"
#include "components/history/core/browser/typed_url_model_type_controller.h" #include "components/history/core/browser/sync/typed_url_model_type_controller.h"
#include "components/password_manager/core/browser/password_data_type_controller.h" #include "components/password_manager/core/browser/password_data_type_controller.h"
#include "components/password_manager/core/browser/password_store.h" #include "components/password_manager/core/browser/password_store.h"
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
......
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
#include "base/threading/sequenced_task_runner_handle.h" #include "base/threading/sequenced_task_runner_handle.h"
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
#include "components/bookmarks/browser/bookmark_model.h" #include "components/bookmarks/browser/bookmark_model.h"
#include "components/history/core/browser/history_model_worker.h"
#include "components/history/core/browser/history_service.h" #include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/sync/history_model_worker.h"
#include "components/pref_registry/pref_registry_syncable.h" #include "components/pref_registry/pref_registry_syncable.h"
#include "components/signin/core/browser/signin_manager_base.h" #include "components/signin/core/browser/signin_manager_base.h"
#include "components/sync/base/sync_prefs.h" #include "components/sync/base/sync_prefs.h"
......
...@@ -9,8 +9,6 @@ static_library("browser") { ...@@ -9,8 +9,6 @@ static_library("browser") {
"browsing_history_service.h", "browsing_history_service.h",
"default_top_sites_provider.cc", "default_top_sites_provider.cc",
"default_top_sites_provider.h", "default_top_sites_provider.h",
"delete_directive_handler.cc",
"delete_directive_handler.h",
"domain_mixing_metrics.cc", "domain_mixing_metrics.cc",
"domain_mixing_metrics.h", "domain_mixing_metrics.h",
"download_constants.h", "download_constants.h",
...@@ -38,12 +36,6 @@ static_library("browser") { ...@@ -38,12 +36,6 @@ static_library("browser") {
"history_database_params.cc", "history_database_params.cc",
"history_database_params.h", "history_database_params.h",
"history_db_task.h", "history_db_task.h",
"history_delete_directives_data_type_controller.cc",
"history_delete_directives_data_type_controller.h",
"history_delete_directives_model_type_controller.cc",
"history_delete_directives_model_type_controller.h",
"history_model_worker.cc",
"history_model_worker.h",
"history_service.cc", "history_service.cc",
"history_service.h", "history_service.h",
"history_service_observer.h", "history_service_observer.h",
...@@ -58,6 +50,20 @@ static_library("browser") { ...@@ -58,6 +50,20 @@ static_library("browser") {
"keyword_search_term.h", "keyword_search_term.h",
"page_usage_data.cc", "page_usage_data.cc",
"page_usage_data.h", "page_usage_data.h",
"sync/delete_directive_handler.cc",
"sync/delete_directive_handler.h",
"sync/history_delete_directives_data_type_controller.cc",
"sync/history_delete_directives_data_type_controller.h",
"sync/history_delete_directives_model_type_controller.cc",
"sync/history_delete_directives_model_type_controller.h",
"sync/history_model_worker.cc",
"sync/history_model_worker.h",
"sync/typed_url_model_type_controller.cc",
"sync/typed_url_model_type_controller.h",
"sync/typed_url_sync_bridge.cc",
"sync/typed_url_sync_bridge.h",
"sync/typed_url_sync_metadata_database.cc",
"sync/typed_url_sync_metadata_database.h",
"thumbnail_database.cc", "thumbnail_database.cc",
"thumbnail_database.h", "thumbnail_database.h",
"top_sites.cc", "top_sites.cc",
...@@ -72,12 +78,6 @@ static_library("browser") { ...@@ -72,12 +78,6 @@ static_library("browser") {
"top_sites_impl.h", "top_sites_impl.h",
"top_sites_observer.h", "top_sites_observer.h",
"top_sites_provider.h", "top_sites_provider.h",
"typed_url_model_type_controller.cc",
"typed_url_model_type_controller.h",
"typed_url_sync_bridge.cc",
"typed_url_sync_bridge.h",
"typed_url_sync_metadata_database.cc",
"typed_url_sync_metadata_database.h",
"url_database.cc", "url_database.cc",
"url_database.h", "url_database.h",
"url_row.cc", "url_row.cc",
...@@ -205,16 +205,16 @@ source_set("unit_tests") { ...@@ -205,16 +205,16 @@ source_set("unit_tests") {
"history_backend_db_unittest.cc", "history_backend_db_unittest.cc",
"history_backend_unittest.cc", "history_backend_unittest.cc",
"history_database_unittest.cc", "history_database_unittest.cc",
"history_model_worker_unittest.cc",
"history_querying_unittest.cc", "history_querying_unittest.cc",
"history_service_unittest.cc", "history_service_unittest.cc",
"history_types_unittest.cc", "history_types_unittest.cc",
"sync/history_model_worker_unittest.cc",
"sync/typed_url_sync_bridge_unittest.cc",
"sync/typed_url_sync_metadata_database_unittest.cc",
"thumbnail_database_unittest.cc", "thumbnail_database_unittest.cc",
"top_sites_cache_unittest.cc", "top_sites_cache_unittest.cc",
"top_sites_database_unittest.cc", "top_sites_database_unittest.cc",
"top_sites_impl_unittest.cc", "top_sites_impl_unittest.cc",
"typed_url_sync_bridge_unittest.cc",
"typed_url_sync_metadata_database_unittest.cc",
"url_database_unittest.cc", "url_database_unittest.cc",
"url_utils_unittest.cc", "url_utils_unittest.cc",
"visit_database_unittest.cc", "visit_database_unittest.cc",
......
per-file history_delete_directives_data_type_controller*=file://components/sync/OWNERS
per-file history_delete_directives_model_type_controller*=file://components/sync/OWNERS
per-file typed_url_model_type_controller*=file://components/sync/OWNERS
per-file typed_url_sync_bridge*=file://components/sync/OWNERS
...@@ -33,8 +33,8 @@ ...@@ -33,8 +33,8 @@
#include "components/history/core/browser/history_backend_notifier.h" #include "components/history/core/browser/history_backend_notifier.h"
#include "components/history/core/browser/history_types.h" #include "components/history/core/browser/history_types.h"
#include "components/history/core/browser/keyword_id.h" #include "components/history/core/browser/keyword_id.h"
#include "components/history/core/browser/sync/typed_url_sync_bridge.h"
#include "components/history/core/browser/thumbnail_database.h" #include "components/history/core/browser/thumbnail_database.h"
#include "components/history/core/browser/typed_url_sync_bridge.h"
#include "components/history/core/browser/visit_tracker.h" #include "components/history/core/browser/visit_tracker.h"
#include "sql/init_status.h" #include "sql/init_status.h"
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include "build/build_config.h" #include "build/build_config.h"
#include "components/history/core/browser/download_database.h" #include "components/history/core/browser/download_database.h"
#include "components/history/core/browser/history_types.h" #include "components/history/core/browser/history_types.h"
#include "components/history/core/browser/typed_url_sync_metadata_database.h" #include "components/history/core/browser/sync/typed_url_sync_metadata_database.h"
#include "components/history/core/browser/url_database.h" #include "components/history/core/browser/url_database.h"
#include "components/history/core/browser/visit_database.h" #include "components/history/core/browser/visit_database.h"
#include "components/history/core/browser/visitsegment_database.h" #include "components/history/core/browser/visitsegment_database.h"
......
...@@ -32,9 +32,9 @@ ...@@ -32,9 +32,9 @@
#include "build/build_config.h" #include "build/build_config.h"
#include "components/favicon_base/favicon_callback.h" #include "components/favicon_base/favicon_callback.h"
#include "components/favicon_base/favicon_usage_data.h" #include "components/favicon_base/favicon_usage_data.h"
#include "components/history/core/browser/delete_directive_handler.h"
#include "components/history/core/browser/history_types.h" #include "components/history/core/browser/history_types.h"
#include "components/history/core/browser/keyword_id.h" #include "components/history/core/browser/keyword_id.h"
#include "components/history/core/browser/sync/delete_directive_handler.h"
#include "components/keyed_service/core/keyed_service.h" #include "components/keyed_service/core/keyed_service.h"
#include "components/sync/model/syncable_service.h" #include "components/sync/model/syncable_service.h"
#include "sql/init_status.h" #include "sql/init_status.h"
......
...@@ -2,10 +2,13 @@ ...@@ -2,10 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "components/history/core/browser/delete_directive_handler.h" #include "components/history/core/browser/sync/delete_directive_handler.h"
#include <stddef.h> #include <stddef.h>
#include <algorithm>
#include <map>
#include <string>
#include <utility> #include <utility>
#include "base/json/json_writer.h" #include "base/json/json_writer.h"
...@@ -127,13 +130,13 @@ class DeleteDirectiveHandler::DeleteDirectiveTask : public HistoryDBTask { ...@@ -127,13 +130,13 @@ class DeleteDirectiveHandler::DeleteDirectiveTask : public HistoryDBTask {
delete_directives_(delete_directive), delete_directives_(delete_directive),
post_processing_action_(post_processing_action) {} post_processing_action_(post_processing_action) {}
~DeleteDirectiveTask() override {}
// Implements HistoryDBTask. // Implements HistoryDBTask.
bool RunOnDBThread(HistoryBackend* backend, HistoryDatabase* db) override; bool RunOnDBThread(HistoryBackend* backend, HistoryDatabase* db) override;
void DoneRunOnMainThread() override; void DoneRunOnMainThread() override;
private: private:
~DeleteDirectiveTask() override {}
// Process a list of global Id directives. Delete all visits to a URL in // Process a list of global Id directives. Delete all visits to a URL in
// time ranges of directives if the timestamp of one visit matches with one // time ranges of directives if the timestamp of one visit matches with one
// global id. // global id.
...@@ -286,8 +289,7 @@ void DeleteDirectiveHandler::DeleteDirectiveTask:: ...@@ -286,8 +289,7 @@ void DeleteDirectiveHandler::DeleteDirectiveTask::
} }
} }
DeleteDirectiveHandler::DeleteDirectiveHandler() : weak_ptr_factory_(this) { DeleteDirectiveHandler::DeleteDirectiveHandler() : weak_ptr_factory_(this) {}
}
DeleteDirectiveHandler::~DeleteDirectiveHandler() { DeleteDirectiveHandler::~DeleteDirectiveHandler() {
weak_ptr_factory_.InvalidateWeakPtrs(); weak_ptr_factory_.InvalidateWeakPtrs();
...@@ -303,9 +305,9 @@ void DeleteDirectiveHandler::Start( ...@@ -303,9 +305,9 @@ void DeleteDirectiveHandler::Start(
// Drop processed delete directives during startup. // Drop processed delete directives during startup.
history_service->ScheduleDBTask( history_service->ScheduleDBTask(
FROM_HERE, FROM_HERE,
std::unique_ptr<HistoryDBTask>( std::make_unique<DeleteDirectiveTask>(weak_ptr_factory_.GetWeakPtr(),
new DeleteDirectiveTask(weak_ptr_factory_.GetWeakPtr(), initial_sync_data,
initial_sync_data, DROP_AFTER_PROCESSING)), DROP_AFTER_PROCESSING),
&internal_tracker_); &internal_tracker_);
} }
} }
...@@ -409,9 +411,9 @@ syncer::SyncError DeleteDirectiveHandler::ProcessSyncChanges( ...@@ -409,9 +411,9 @@ syncer::SyncError DeleteDirectiveHandler::ProcessSyncChanges(
// in one chrome session. // in one chrome session.
history_service->ScheduleDBTask( history_service->ScheduleDBTask(
FROM_HERE, FROM_HERE,
std::unique_ptr<HistoryDBTask>( std::make_unique<DeleteDirectiveTask>(weak_ptr_factory_.GetWeakPtr(),
new DeleteDirectiveTask(weak_ptr_factory_.GetWeakPtr(), delete_directives,
delete_directives, KEEP_AFTER_PROCESSING)), KEEP_AFTER_PROCESSING),
&internal_tracker_); &internal_tracker_);
} }
return syncer::SyncError(); return syncer::SyncError();
......
...@@ -2,12 +2,13 @@ ...@@ -2,12 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef COMPONENTS_HISTORY_CORE_BROWSER_DELETE_DIRECTIVE_HANDLER_H_ #ifndef COMPONENTS_HISTORY_CORE_BROWSER_SYNC_DELETE_DIRECTIVE_HANDLER_H_
#define COMPONENTS_HISTORY_CORE_BROWSER_DELETE_DIRECTIVE_HANDLER_H_ #define COMPONENTS_HISTORY_CORE_BROWSER_SYNC_DELETE_DIRECTIVE_HANDLER_H_
#include <stdint.h> #include <stdint.h>
#include <memory> #include <memory>
#include <set>
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
...@@ -81,4 +82,4 @@ class DeleteDirectiveHandler { ...@@ -81,4 +82,4 @@ class DeleteDirectiveHandler {
} // namespace history } // namespace history
#endif // COMPONENTS_HISTORY_CORE_BROWSER_DELETE_DIRECTIVE_HANDLER_H_ #endif // COMPONENTS_HISTORY_CORE_BROWSER_SYNC_DELETE_DIRECTIVE_HANDLER_H_
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "components/history/core/browser/history_delete_directives_data_type_controller.h" #include "components/history/core/browser/sync/history_delete_directives_data_type_controller.h"
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
#include "components/sync/driver/sync_client.h" #include "components/sync/driver/sync_client.h"
...@@ -21,8 +21,7 @@ HistoryDeleteDirectivesDataTypeController:: ...@@ -21,8 +21,7 @@ HistoryDeleteDirectivesDataTypeController::
sync_client_(sync_client) {} sync_client_(sync_client) {}
HistoryDeleteDirectivesDataTypeController:: HistoryDeleteDirectivesDataTypeController::
~HistoryDeleteDirectivesDataTypeController() { ~HistoryDeleteDirectivesDataTypeController() {}
}
bool HistoryDeleteDirectivesDataTypeController::ReadyForStart() const { bool HistoryDeleteDirectivesDataTypeController::ReadyForStart() const {
DCHECK(CalledOnValidThread()); DCHECK(CalledOnValidThread());
...@@ -58,11 +57,9 @@ bool HistoryDeleteDirectivesDataTypeController::DisableTypeIfNecessary() { ...@@ -58,11 +57,9 @@ bool HistoryDeleteDirectivesDataTypeController::DisableTypeIfNecessary() {
if (sync_client_->GetSyncService()->HasObserver(this)) if (sync_client_->GetSyncService()->HasObserver(this))
sync_client_->GetSyncService()->RemoveObserver(this); sync_client_->GetSyncService()->RemoveObserver(this);
syncer::SyncError error( syncer::SyncError error(FROM_HERE, syncer::SyncError::DATATYPE_POLICY_ERROR,
FROM_HERE, "Delete directives not supported with encryption.",
syncer::SyncError::DATATYPE_POLICY_ERROR, type());
"Delete directives not supported with encryption.",
type());
CreateErrorHandler()->OnUnrecoverableError(error); CreateErrorHandler()->OnUnrecoverableError(error);
return true; return true;
} }
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_DELETE_DIRECTIVES_DATA_TYPE_CONTROLLER_H_ #ifndef COMPONENTS_HISTORY_CORE_BROWSER_SYNC_HISTORY_DELETE_DIRECTIVES_DATA_TYPE_CONTROLLER_H_
#define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_DELETE_DIRECTIVES_DATA_TYPE_CONTROLLER_H_ #define COMPONENTS_HISTORY_CORE_BROWSER_SYNC_HISTORY_DELETE_DIRECTIVES_DATA_TYPE_CONTROLLER_H_
#include "base/macros.h" #include "base/macros.h"
#include "components/sync/driver/async_directory_type_controller.h" #include "components/sync/driver/async_directory_type_controller.h"
...@@ -42,4 +42,4 @@ class HistoryDeleteDirectivesDataTypeController ...@@ -42,4 +42,4 @@ class HistoryDeleteDirectivesDataTypeController
} // namespace browser_sync } // namespace browser_sync
#endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_DELETE_DIRECTIVES_DATA_TYPE_CONTROLLER_H_ #endif // COMPONENTS_HISTORY_CORE_BROWSER_SYNC_HISTORY_DELETE_DIRECTIVES_DATA_TYPE_CONTROLLER_H_
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "components/history/core/browser/history_delete_directives_model_type_controller.h" #include "components/history/core/browser/sync/history_delete_directives_model_type_controller.h"
#include <utility> #include <utility>
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_DELETE_DIRECTIVES_MODEL_TYPE_CONTROLLER_H_ #ifndef COMPONENTS_HISTORY_CORE_BROWSER_SYNC_HISTORY_DELETE_DIRECTIVES_MODEL_TYPE_CONTROLLER_H_
#define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_DELETE_DIRECTIVES_MODEL_TYPE_CONTROLLER_H_ #define COMPONENTS_HISTORY_CORE_BROWSER_SYNC_HISTORY_DELETE_DIRECTIVES_MODEL_TYPE_CONTROLLER_H_
#include "base/macros.h" #include "base/macros.h"
#include "components/sync/driver/sync_service_observer.h" #include "components/sync/driver/sync_service_observer.h"
...@@ -48,4 +48,4 @@ class HistoryDeleteDirectivesModelTypeController ...@@ -48,4 +48,4 @@ class HistoryDeleteDirectivesModelTypeController
} // namespace browser_sync } // namespace browser_sync
#endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_DELETE_DIRECTIVES_MODEL_TYPE_CONTROLLER_H_ #endif // COMPONENTS_HISTORY_CORE_BROWSER_SYNC_HISTORY_DELETE_DIRECTIVES_MODEL_TYPE_CONTROLLER_H_
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "components/history/core/browser/history_model_worker.h" #include "components/history/core/browser/sync/history_model_worker.h"
#include <memory> #include <memory>
#include <utility> #include <utility>
...@@ -14,7 +14,7 @@ namespace browser_sync { ...@@ -14,7 +14,7 @@ namespace browser_sync {
class WorkerTask : public history::HistoryDBTask { class WorkerTask : public history::HistoryDBTask {
public: public:
WorkerTask(base::OnceClosure work) : work_(std::move(work)) {} explicit WorkerTask(base::OnceClosure work) : work_(std::move(work)) {}
bool RunOnDBThread(history::HistoryBackend* backend, bool RunOnDBThread(history::HistoryBackend* backend,
history::HistoryDatabase* db) override { history::HistoryDatabase* db) override {
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_MODEL_WORKER_H_ #ifndef COMPONENTS_HISTORY_CORE_BROWSER_SYNC_HISTORY_MODEL_WORKER_H_
#define COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_MODEL_WORKER_H_ #define COMPONENTS_HISTORY_CORE_BROWSER_SYNC_HISTORY_MODEL_WORKER_H_
#include <memory> #include <memory>
...@@ -52,4 +52,4 @@ class HistoryModelWorker : public syncer::ModelSafeWorker { ...@@ -52,4 +52,4 @@ class HistoryModelWorker : public syncer::ModelSafeWorker {
} // namespace browser_sync } // namespace browser_sync
#endif // COMPONENTS_HISTORY_CORE_BROWSER_HISTORY_MODEL_WORKER_H_ #endif // COMPONENTS_HISTORY_CORE_BROWSER_SYNC_HISTORY_MODEL_WORKER_H_
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "components/history/core/browser/history_model_worker.h" #include "components/history/core/browser/sync/history_model_worker.h"
#include <memory> #include <memory>
#include <utility> #include <utility>
...@@ -24,7 +24,8 @@ namespace { ...@@ -24,7 +24,8 @@ namespace {
class HistoryServiceMock : public history::HistoryService { class HistoryServiceMock : public history::HistoryService {
public: public:
HistoryServiceMock(scoped_refptr<base::SingleThreadTaskRunner> history_thread) explicit HistoryServiceMock(
scoped_refptr<base::SingleThreadTaskRunner> history_thread)
: history_thread_(std::move(history_thread)) {} : history_thread_(std::move(history_thread)) {}
base::CancelableTaskTracker::TaskId ScheduleDBTask( base::CancelableTaskTracker::TaskId ScheduleDBTask(
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "components/history/core/browser/typed_url_model_type_controller.h" #include "components/history/core/browser/sync/typed_url_model_type_controller.h"
#include <memory> #include <memory>
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef COMPONENTS_HISTORY_CORE_BROWSER_TYPED_URL_MODEL_TYPE_CONTROLLER_H__ #ifndef COMPONENTS_HISTORY_CORE_BROWSER_SYNC_TYPED_URL_MODEL_TYPE_CONTROLLER_H_
#define COMPONENTS_HISTORY_CORE_BROWSER_TYPED_URL_MODEL_TYPE_CONTROLLER_H__ #define COMPONENTS_HISTORY_CORE_BROWSER_SYNC_TYPED_URL_MODEL_TYPE_CONTROLLER_H_
#include "components/prefs/pref_change_registrar.h" #include "components/prefs/pref_change_registrar.h"
#include "components/sync/driver/model_type_controller.h" #include "components/sync/driver/model_type_controller.h"
...@@ -40,4 +40,4 @@ class TypedURLModelTypeController : public syncer::ModelTypeController { ...@@ -40,4 +40,4 @@ class TypedURLModelTypeController : public syncer::ModelTypeController {
} // namespace history } // namespace history
#endif // COMPONENTS_HISTORY_CORE_BROWSER_TYPED_URL_MODEL_TYPE_CONTROLLER_H__ #endif // COMPONENTS_HISTORY_CORE_BROWSER_SYNC_TYPED_URL_MODEL_TYPE_CONTROLLER_H_
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "components/history/core/browser/typed_url_sync_bridge.h" #include "components/history/core/browser/sync/typed_url_sync_bridge.h"
#include <memory> #include <memory>
...@@ -94,8 +94,7 @@ TypedURLSyncBridge::TypedURLSyncBridge( ...@@ -94,8 +94,7 @@ TypedURLSyncBridge::TypedURLSyncBridge(
DCHECK(sequence_checker_.CalledOnValidSequence()); DCHECK(sequence_checker_.CalledOnValidSequence());
} }
TypedURLSyncBridge::~TypedURLSyncBridge() { TypedURLSyncBridge::~TypedURLSyncBridge() {}
}
std::unique_ptr<MetadataChangeList> std::unique_ptr<MetadataChangeList>
TypedURLSyncBridge::CreateMetadataChangeList() { TypedURLSyncBridge::CreateMetadataChangeList() {
...@@ -515,7 +514,7 @@ bool TypedURLSyncBridge::WriteToTypedUrlSpecifics( ...@@ -515,7 +514,7 @@ bool TypedURLSyncBridge::WriteToTypedUrlSpecifics(
// the history DB has an inaccurate count for some reason (there's been // the history DB has an inaccurate count for some reason (there's been
// bugs in the history code in the past which has left users in the wild // bugs in the history code in the past which has left users in the wild
// with incorrect counts - http://crbug.com/84258). // with incorrect counts - http://crbug.com/84258).
DCHECK(typed_count > 0); DCHECK_GT(typed_count, 0);
if (typed_count > kMaxTypedUrlVisits) { if (typed_count > kMaxTypedUrlVisits) {
only_typed = true; only_typed = true;
...@@ -772,7 +771,7 @@ void TypedURLSyncBridge::MergeURLWithSync( ...@@ -772,7 +771,7 @@ void TypedURLSyncBridge::MergeURLWithSync(
URLRows* new_synced_urls, URLRows* new_synced_urls,
TypedURLVisitVector* new_synced_visits, TypedURLVisitVector* new_synced_visits,
URLRows* updated_synced_urls) { URLRows* updated_synced_urls) {
DCHECK(server_typed_url.visits_size() != 0); DCHECK_NE(0, server_typed_url.visits_size());
DCHECK_EQ(server_typed_url.visits_size(), DCHECK_EQ(server_typed_url.visits_size(),
server_typed_url.visit_transitions_size()); server_typed_url.visit_transitions_size());
...@@ -878,7 +877,7 @@ void TypedURLSyncBridge::MergeURLWithSync( ...@@ -878,7 +877,7 @@ void TypedURLSyncBridge::MergeURLWithSync(
// Should never be possible to delete all the items, since the // Should never be possible to delete all the items, since the
// visit vector contains newer local visits it will keep and/or the // visit vector contains newer local visits it will keep and/or the
// visits in typed_url.visits newer than older local visits. // visits in typed_url.visits newer than older local visits.
DCHECK(visits.size() > 0); DCHECK_GT(visits.size(), 0U);
} }
DCHECK_EQ(new_url.last_visit().ToInternalValue(), DCHECK_EQ(new_url.last_visit().ToInternalValue(),
visits.back().visit_time.ToInternalValue()); visits.back().visit_time.ToInternalValue());
......
...@@ -2,12 +2,19 @@ ...@@ -2,12 +2,19 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef COMPONENTS_HISTORY_CORE_BROWSER_TYPED_URL_SYNC_BRIDGE_H_ #ifndef COMPONENTS_HISTORY_CORE_BROWSER_SYNC_TYPED_URL_SYNC_BRIDGE_H_
#define COMPONENTS_HISTORY_CORE_BROWSER_TYPED_URL_SYNC_BRIDGE_H_ #define COMPONENTS_HISTORY_CORE_BROWSER_SYNC_TYPED_URL_SYNC_BRIDGE_H_
#include <map>
#include <memory>
#include <set>
#include <string>
#include <utility>
#include <vector>
#include "base/scoped_observer.h" #include "base/scoped_observer.h"
#include "components/history/core/browser/history_backend_observer.h" #include "components/history/core/browser/history_backend_observer.h"
#include "components/history/core/browser/typed_url_sync_metadata_database.h" #include "components/history/core/browser/sync/typed_url_sync_metadata_database.h"
#include "components/sync/model/metadata_change_list.h" #include "components/sync/model/metadata_change_list.h"
#include "components/sync/model/model_type_change_processor.h" #include "components/sync/model/model_type_change_processor.h"
#include "components/sync/model/model_type_sync_bridge.h" #include "components/sync/model/model_type_sync_bridge.h"
...@@ -250,4 +257,4 @@ class TypedURLSyncBridge : public syncer::ModelTypeSyncBridge, ...@@ -250,4 +257,4 @@ class TypedURLSyncBridge : public syncer::ModelTypeSyncBridge,
} // namespace history } // namespace history
#endif // COMPONENTS_HISTORY_CORE_BROWSER_TYPED_URL_SYNC_BRIDGE_H_ #endif // COMPONENTS_HISTORY_CORE_BROWSER_SYNC_TYPED_URL_SYNC_BRIDGE_H_
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "components/history/core/browser/typed_url_sync_bridge.h" #include "components/history/core/browser/sync/typed_url_sync_bridge.h"
#include <memory> #include <memory>
...@@ -51,13 +51,13 @@ const char kTitle2[] = "cookie"; ...@@ -51,13 +51,13 @@ const char kTitle2[] = "cookie";
const char kURL[] = "http://pie.com/"; const char kURL[] = "http://pie.com/";
const char kURL2[] = "http://cookie.com/"; const char kURL2[] = "http://cookie.com/";
bool URLsEqual(URLRow& row, sync_pb::TypedUrlSpecifics& specifics) { bool URLsEqual(URLRow& row, const sync_pb::TypedUrlSpecifics& specifics) {
return ((row.url().spec().compare(specifics.url()) == 0) && return ((row.url().spec().compare(specifics.url()) == 0) &&
(base::UTF16ToUTF8(row.title()).compare(specifics.title()) == 0) && (base::UTF16ToUTF8(row.title()).compare(specifics.title()) == 0) &&
(row.hidden() == specifics.hidden())); (row.hidden() == specifics.hidden()));
} }
bool URLsEqual(URLRow& lhs, URLRow& rhs) { bool URLsEqual(const URLRow& lhs, const URLRow& rhs) {
// Only compare synced fields (ignore typed_count and visit_count as those // Only compare synced fields (ignore typed_count and visit_count as those
// are maintained by the history subsystem). // are maintained by the history subsystem).
return (lhs.url().spec().compare(rhs.url().spec()) == 0) && return (lhs.url().spec().compare(rhs.url().spec()) == 0) &&
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "components/history/core/browser/typed_url_sync_metadata_database.h" #include "components/history/core/browser/sync/typed_url_sync_metadata_database.h"
#include "base/big_endian.h" #include "base/big_endian.h"
#include "base/logging.h" #include "base/logging.h"
......
...@@ -2,9 +2,10 @@ ...@@ -2,9 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef COMPONENTS_HISTORY_CORE_BROWSER_TYPED_URL_SYNC_METADATA_DATABASE_H_ #ifndef COMPONENTS_HISTORY_CORE_BROWSER_SYNC_TYPED_URL_SYNC_METADATA_DATABASE_H_
#define COMPONENTS_HISTORY_CORE_BROWSER_TYPED_URL_SYNC_METADATA_DATABASE_H_ #define COMPONENTS_HISTORY_CORE_BROWSER_SYNC_TYPED_URL_SYNC_METADATA_DATABASE_H_
#include <string>
#include <vector> #include <vector>
#include "base/macros.h" #include "base/macros.h"
...@@ -16,7 +17,7 @@ ...@@ -16,7 +17,7 @@
namespace sql { namespace sql {
class Database; class Database;
class MetaTable; class MetaTable;
} } // namespace sql
namespace history { namespace history {
...@@ -81,4 +82,4 @@ class TypedURLSyncMetadataDatabase : public syncer::SyncMetadataStore { ...@@ -81,4 +82,4 @@ class TypedURLSyncMetadataDatabase : public syncer::SyncMetadataStore {
} // namespace history } // namespace history
#endif // COMPONENTS_HISTORY_CORE_BROWSER_TYPED_URL_SYNC_METADATA_DATABASE_H_ #endif // COMPONENTS_HISTORY_CORE_BROWSER_SYNC_TYPED_URL_SYNC_METADATA_DATABASE_H_
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "components/history/core/browser/typed_url_sync_metadata_database.h" #include "components/history/core/browser/sync/typed_url_sync_metadata_database.h"
#include "base/big_endian.h" #include "base/big_endian.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
......
...@@ -26,9 +26,9 @@ ...@@ -26,9 +26,9 @@
#include "components/browser_sync/profile_sync_service.h" #include "components/browser_sync/profile_sync_service.h"
#include "components/consent_auditor/consent_auditor.h" #include "components/consent_auditor/consent_auditor.h"
#include "components/dom_distiller/core/dom_distiller_service.h" #include "components/dom_distiller/core/dom_distiller_service.h"
#include "components/history/core/browser/history_model_worker.h"
#include "components/history/core/browser/history_service.h" #include "components/history/core/browser/history_service.h"
#include "components/history/core/browser/typed_url_sync_bridge.h" #include "components/history/core/browser/sync/history_model_worker.h"
#include "components/history/core/browser/sync/typed_url_sync_bridge.h"
#include "components/invalidation/impl/profile_invalidation_provider.h" #include "components/invalidation/impl/profile_invalidation_provider.h"
#include "components/keyed_service/core/service_access_type.h" #include "components/keyed_service/core/service_access_type.h"
#include "components/password_manager/core/browser/password_model_worker.h" #include "components/password_manager/core/browser/password_model_worker.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment