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

Side by Side 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 unified diff | Download patch
OLDNEW
(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 =
11 syncer::WIFI_CREDENTIALS;
12
13 WifiCredentialSyncableService::WifiCredentialSyncableService(
14 content::BrowserContext *context) :
15 browser_context_(context),
16 thread_checker_() {
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);
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();
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();
61 return syncer::SyncError();
62 }
63
64 // Test support.
65 std::set<std::pair<std::vector<char>, WifiSecurityClass>>
66 WifiCredentialSyncableService::GetWifiNetworksForTest() const {
67 return std::set<std::pair<std::vector<char>, WifiSecurityClass>>();
68 }
69
70 } // namespace wifi_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698