Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "components/wifi_sync/wifi_credential_syncable_service.h" | |
| 6 | |
| 7 namespace wifi_sync { | |
| 8 | |
| 9 // static | |
| 10 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.
| |
| 11 syncer::WIFI_CREDENTIALS; | |
| 12 | |
| 13 WifiCredentialSyncableService::WifiCredentialSyncableService( | |
| 14 content::BrowserContext *context) : | |
| 15 browser_context_(context), | |
| 16 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
| |
| 17 } | |
| 18 | |
| 19 WifiCredentialSyncableService::~WifiCredentialSyncableService() { | |
| 20 DCHECK(thread_checker_.CalledOnValidThread()); | |
| 21 } | |
| 22 | |
| 23 // Implementation of syncer::SyncableService API. | |
| 24 syncer::SyncMergeResult WifiCredentialSyncableService::MergeDataAndStartSyncing( | |
| 25 syncer::ModelType type, | |
| 26 const syncer::SyncDataList& initial_sync_data, | |
| 27 scoped_ptr<syncer::SyncChangeProcessor> sync_processor, | |
| 28 scoped_ptr<syncer::SyncErrorFactory> error_handler) { | |
| 29 DCHECK(thread_checker_.CalledOnValidThread()); | |
| 30 DCHECK(!sync_processor_.get()); | |
| 31 DCHECK(sync_processor.get()); | |
| 32 DCHECK(error_handler.get()); | |
| 33 DCHECK_EQ(kModelType, type); | |
| 34 | |
| 35 sync_processor_ = sync_processor.Pass(); | |
| 36 sync_error_handler_ = error_handler.Pass(); | |
| 37 | |
| 38 return syncer::SyncMergeResult(type); | |
|
erikwright (departed)
2014/11/17 20:18:57
IWYU
mukesh agrawal
2014/11/18 17:17:43
Done.
| |
| 39 } | |
| 40 | |
| 41 void WifiCredentialSyncableService::StopSyncing(syncer::ModelType type) { | |
| 42 DCHECK(thread_checker_.CalledOnValidThread()); | |
| 43 DCHECK_EQ(kModelType, type); | |
| 44 sync_processor_.reset(); | |
| 45 sync_error_handler_.reset(); | |
| 46 } | |
| 47 | |
| 48 syncer::SyncDataList WifiCredentialSyncableService::GetAllSyncData( | |
| 49 syncer::ModelType type) const { | |
| 50 DCHECK(thread_checker_.CalledOnValidThread()); | |
| 51 DCHECK_EQ(kModelType, type); | |
| 52 NOTIMPLEMENTED(); | |
| 53 return syncer::SyncDataList(); | |
|
erikwright (departed)
2014/11/17 20:18:57
IWYU
mukesh agrawal
2014/11/18 17:17:43
Done.
| |
| 54 } | |
| 55 | |
| 56 syncer::SyncError WifiCredentialSyncableService::ProcessSyncChanges( | |
| 57 const tracked_objects::Location& from_here, | |
| 58 const syncer::SyncChangeList& change_list) { | |
| 59 DCHECK(thread_checker_.CalledOnValidThread()); | |
| 60 NOTIMPLEMENTED(); | |
|
erikwright (departed)
2014/11/17 20:18:57
base/logging.h
mukesh agrawal
2014/11/18 17:17:43
Done.
| |
| 61 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.
| |
| 62 } | |
| 63 | |
| 64 // Test support. | |
| 65 WifiCredentialSyncableService::WifiSsidSecuritySet | |
| 66 WifiCredentialSyncableService::GetWifiNetworksForTest() const { | |
| 67 return WifiSsidSecuritySet(); | |
| 68 } | |
| 69 | |
| 70 } // namespace wifi_sync | |
| OLD | NEW |