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

Unified Diff: components/wifi_sync/wifi_credential_syncable_service.cc

Issue 709683004: components: add wifi_sync component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@submit-1-security-class
Patch Set: update commit message Created 6 years, 1 month 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/wifi_sync/wifi_credential_syncable_service.cc
diff --git a/components/wifi_sync/wifi_credential_syncable_service.cc b/components/wifi_sync/wifi_credential_syncable_service.cc
new file mode 100644
index 0000000000000000000000000000000000000000..6d63b33f6603b5e808c49d9aa81218debbebd89f
--- /dev/null
+++ b/components/wifi_sync/wifi_credential_syncable_service.cc
@@ -0,0 +1,70 @@
+// Copyright 2014 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/wifi_sync/wifi_credential_syncable_service.h"
+
+namespace wifi_sync {
+
+// static
+const enum syncer::ModelType WifiCredentialSyncableService::kModelType =
+ syncer::WIFI_CREDENTIALS;
+
+WifiCredentialSyncableService::WifiCredentialSyncableService(
+ content::BrowserContext *context) :
+ browser_context_(context),
+ thread_checker_() {
+}
+
+WifiCredentialSyncableService::~WifiCredentialSyncableService() {
+ DCHECK(thread_checker_.CalledOnValidThread());
+}
+
+// Implementation of syncer::SyncableService API.
+syncer::SyncMergeResult WifiCredentialSyncableService::MergeDataAndStartSyncing(
+ syncer::ModelType type,
+ const syncer::SyncDataList& initial_sync_data,
+ scoped_ptr<syncer::SyncChangeProcessor> sync_processor,
+ scoped_ptr<syncer::SyncErrorFactory> error_handler) {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK(!sync_processor_.get());
+ DCHECK(sync_processor.get());
+ DCHECK(error_handler.get());
+ DCHECK_EQ(kModelType, type);
+
+ sync_processor_ = sync_processor.Pass();
+ sync_error_handler_ = error_handler.Pass();
+
+ return syncer::SyncMergeResult(type);
+}
+
+void WifiCredentialSyncableService::StopSyncing(syncer::ModelType type) {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK_EQ(kModelType, type);
+ sync_processor_.reset();
+ sync_error_handler_.reset();
+}
+
+syncer::SyncDataList WifiCredentialSyncableService::GetAllSyncData(
+ syncer::ModelType type) const {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ DCHECK_EQ(kModelType, type);
+ NOTIMPLEMENTED();
+ return syncer::SyncDataList();
+}
+
+syncer::SyncError WifiCredentialSyncableService::ProcessSyncChanges(
+ const tracked_objects::Location& from_here,
+ const syncer::SyncChangeList& change_list) {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ NOTIMPLEMENTED();
+ return syncer::SyncError();
+}
+
+// Test support.
+std::set<std::pair<std::vector<char>, WifiSecurityClass>>
+WifiCredentialSyncableService::GetWifiNetworksForTest() const {
+ return std::set<std::pair<std::vector<char>, WifiSecurityClass>>();
+}
+
+} // namespace wifi_sync

Powered by Google App Engine
This is Rietveld 408576698