Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(964)

Unified Diff: components/history/core/browser/typed_url_sync_bridge.cc

Issue 2723953002: [sync] skeleton implementation of TypedURLSyncBridge (Closed)
Patch Set: rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/history/core/browser/typed_url_sync_bridge.cc
diff --git a/components/history/core/browser/typed_url_sync_bridge.cc b/components/history/core/browser/typed_url_sync_bridge.cc
new file mode 100644
index 0000000000000000000000000000000000000000..55712c82cb727b042063a46f805db802777aa636
--- /dev/null
+++ b/components/history/core/browser/typed_url_sync_bridge.cc
@@ -0,0 +1,103 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/history/core/browser/typed_url_sync_bridge.h"
+
+namespace history {
+
+TypedURLSyncBridge::TypedURLSyncBridge(
+ HistoryBackend* history_backend,
+ const ChangeProcessorFactory& change_processor_factory)
+ : ModelTypeSyncBridge(change_processor_factory, syncer::TYPED_URLS),
+ history_backend_(history_backend) {
+ DCHECK(history_backend_);
+ DCHECK(sequence_checker_.CalledOnValidSequence());
+ NOTIMPLEMENTED();
+}
+
+TypedURLSyncBridge::~TypedURLSyncBridge() {
+ // TODO(gangwu): unregister as HistoryBackendObserver, can use ScopedObserver
+ // to do it.
+}
+
+std::unique_ptr<syncer::MetadataChangeList>
+TypedURLSyncBridge::CreateMetadataChangeList() {
+ DCHECK(sequence_checker_.CalledOnValidSequence());
+ NOTIMPLEMENTED();
+ return {};
+}
+
+base::Optional<syncer::ModelError> TypedURLSyncBridge::MergeSyncData(
+ std::unique_ptr<syncer::MetadataChangeList> metadata_change_list,
+ syncer::EntityDataMap entity_data_map) {
+ DCHECK(sequence_checker_.CalledOnValidSequence());
+ NOTIMPLEMENTED();
+ return {};
+}
+
+base::Optional<syncer::ModelError> TypedURLSyncBridge::ApplySyncChanges(
+ std::unique_ptr<syncer::MetadataChangeList> metadata_change_list,
+ syncer::EntityChangeList entity_changes) {
+ DCHECK(sequence_checker_.CalledOnValidSequence());
+ NOTIMPLEMENTED();
+ return {};
+}
+
+void TypedURLSyncBridge::GetData(StorageKeyList storage_keys,
+ DataCallback callback) {
+ DCHECK(sequence_checker_.CalledOnValidSequence());
+ NOTIMPLEMENTED();
+}
+
+void TypedURLSyncBridge::GetAllData(DataCallback callback) {
+ DCHECK(sequence_checker_.CalledOnValidSequence());
+ NOTIMPLEMENTED();
+}
+
+// Must be exactly the value of GURL::spec() for backwards comparability with
+// the previous (Directory + SyncableService) iteration of sync integration.
+// This can be large but it is assumed that this is not held in memory at steady
+// state.
+std::string TypedURLSyncBridge::GetClientTag(
+ const syncer::EntityData& entity_data) {
+ DCHECK(sequence_checker_.CalledOnValidSequence());
+ NOTIMPLEMENTED();
+ return std::string();
+}
+
+// Prefer to use URLRow::id() to uniquely identify entities when coordinating
+// with sync because it has a significantly low memory cost than a URL.
+std::string TypedURLSyncBridge::GetStorageKey(
+ const syncer::EntityData& entity_data) {
+ DCHECK(sequence_checker_.CalledOnValidSequence());
+ NOTIMPLEMENTED();
+ return std::string();
+}
+
+void TypedURLSyncBridge::OnURLVisited(history::HistoryBackend* history_backend,
+ ui::PageTransition transition,
+ const history::URLRow& row,
+ const history::RedirectList& redirects,
+ base::Time visit_time) {
+ DCHECK(sequence_checker_.CalledOnValidSequence());
+ NOTIMPLEMENTED();
+}
+
+void TypedURLSyncBridge::OnURLsModified(
+ history::HistoryBackend* history_backend,
+ const history::URLRows& changed_urls) {
+ DCHECK(sequence_checker_.CalledOnValidSequence());
+ NOTIMPLEMENTED();
+}
+
+void TypedURLSyncBridge::OnURLsDeleted(history::HistoryBackend* history_backend,
+ bool all_history,
+ bool expired,
+ const history::URLRows& deleted_rows,
+ const std::set<GURL>& favicon_urls) {
+ DCHECK(sequence_checker_.CalledOnValidSequence());
+ NOTIMPLEMENTED();
+}
+
+} // namespace history
« no previous file with comments | « components/history/core/browser/typed_url_sync_bridge.h ('k') | components/sync/driver/sync_driver_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698