Chromium Code Reviews| Index: components/wifi_sync/wifi_credential_syncable_service.h |
| diff --git a/components/wifi_sync/wifi_credential_syncable_service.h b/components/wifi_sync/wifi_credential_syncable_service.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..3975077b16d93c20b52a420cdfcc04e1175921f7 |
| --- /dev/null |
| +++ b/components/wifi_sync/wifi_credential_syncable_service.h |
| @@ -0,0 +1,65 @@ |
| +// 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. |
| + |
| +#ifndef COMPONENTS_WIFI_SYNC_WIFI_CREDENTIAL_SYNCABLE_SERVICE_H_ |
| +#define COMPONENTS_WIFI_SYNC_WIFI_CREDENTIAL_SYNCABLE_SERVICE_H_ |
| + |
| +#include <stdint.h> |
| + |
| +#include <set> |
| +#include <utility> |
|
erikwright (departed)
2014/12/08 21:21:36
double-check all the includes here.
mukesh agrawal
2014/12/09 01:41:11
Done.
|
| +#include <vector> |
| + |
| +#include "base/macros.h" |
| +#include "base/memory/scoped_ptr.h" |
| +#include "base/threading/thread_checker.h" |
| +#include "components/keyed_service/core/keyed_service.h" |
| +#include "sync/api/sync_change_processor.h" |
| +#include "sync/api/sync_error_factory.h" |
| +#include "sync/api/syncable_service.h" |
| + |
| +namespace wifi_sync { |
| + |
| +// KeyedService that synchronizes WiFi credentials between local settings, |
| +// and Chrome Sync. |
| +// |
| +// This service does not necessarily own the storage for WiFi |
| +// credentials. In particular, on ChromeOS, WiFi credential storage is |
| +// managed by the ChromeOS connection manager ("Shill"). |
| +class WifiCredentialSyncableService |
| + : public syncer::SyncableService, public KeyedService { |
| + public: |
| + WifiCredentialSyncableService(); |
| + ~WifiCredentialSyncableService() override; |
| + |
| + // syncer::SyncableService implementation. |
| + syncer::SyncMergeResult MergeDataAndStartSyncing( |
| + syncer::ModelType type, |
| + const syncer::SyncDataList& initial_sync_data, |
| + scoped_ptr<syncer::SyncChangeProcessor> sync_processor, |
| + scoped_ptr<syncer::SyncErrorFactory> error_handler) override; |
| + void StopSyncing(syncer::ModelType type) override; |
| + syncer::SyncDataList GetAllSyncData(syncer::ModelType type) const override; |
| + syncer::SyncError ProcessSyncChanges( |
| + const tracked_objects::Location& caller_location, |
| + const syncer::SyncChangeList& change_list) override; |
| + |
| + private: |
| + // The syncer::ModelType that this SyncableService processes and |
| + // generates updates for. |
| + static const syncer::ModelType kModelType; |
| + |
| + // Our ThreadChecker instance. Used to ensure that all calls to an |
| + // instance of this class are made from the same thread. |
| + const base::ThreadChecker thread_checker_; |
|
erikwright (departed)
2014/12/08 21:21:36
Is this a common convention for "SyncableService"
mukesh agrawal
2014/12/09 01:41:11
After checking the existing code, I see that, of t
|
| + // Our SyncChangeProcessor instance. Used to push changes into |
| + // Chrome Sync. |
| + scoped_ptr<syncer::SyncChangeProcessor> sync_processor_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(WifiCredentialSyncableService); |
| +}; |
| + |
| +} // namespace wifi_sync |
| + |
| +#endif // COMPONENTS_WIFI_SYNC_WIFI_CREDENTIAL_SYNCABLE_SERVICE_H_ |