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..70d3e63efc34ee550fd845ad696ef22a29fafdbc |
--- /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 = |
erikwright (departed)
2014/11/17 20:18:57
I'm not used to seeing 'enum' somewhere like this.
mukesh agrawal
2014/11/18 17:17:43
Done.
|
+ syncer::WIFI_CREDENTIALS; |
+ |
+WifiCredentialSyncableService::WifiCredentialSyncableService( |
+ content::BrowserContext *context) : |
+ browser_context_(context), |
+ thread_checker_() { |
erikwright (departed)
2014/11/17 20:18:57
not required
mukesh agrawal
2014/11/18 17:17:43
Without the explicit initialization of thread_chec
|
+} |
+ |
+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); |
erikwright (departed)
2014/11/17 20:18:57
IWYU
mukesh agrawal
2014/11/18 17:17:43
Done.
|
+} |
+ |
+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(); |
erikwright (departed)
2014/11/17 20:18:57
IWYU
mukesh agrawal
2014/11/18 17:17:43
Done.
|
+} |
+ |
+syncer::SyncError WifiCredentialSyncableService::ProcessSyncChanges( |
+ const tracked_objects::Location& from_here, |
+ const syncer::SyncChangeList& change_list) { |
+ DCHECK(thread_checker_.CalledOnValidThread()); |
+ NOTIMPLEMENTED(); |
erikwright (departed)
2014/11/17 20:18:57
base/logging.h
mukesh agrawal
2014/11/18 17:17:43
Done.
|
+ return syncer::SyncError(); |
erikwright (departed)
2014/11/17 20:18:57
this, on the other hand, will require a full type
mukesh agrawal
2014/11/18 17:17:43
Done.
|
+} |
+ |
+// Test support. |
+WifiCredentialSyncableService::WifiSsidSecuritySet |
+WifiCredentialSyncableService::GetWifiNetworksForTest() const { |
+ return WifiSsidSecuritySet(); |
+} |
+ |
+} // namespace wifi_sync |