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

Side by Side Diff: components/sync/driver/glue/sync_backend_host_core.h

Issue 2413313004: [Sync] Move the last things out of core/. (Closed)
Patch Set: Address comments. Created 4 years, 2 months 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
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_CORE_H_ 5 #ifndef COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_CORE_H_
6 #define COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_CORE_H_ 6 #define COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_CORE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
11 #include <memory> 11 #include <memory>
12 #include <string> 12 #include <string>
13 #include <vector> 13 #include <vector>
14 14
15 #include "base/macros.h" 15 #include "base/macros.h"
16 #include "base/memory/ref_counted.h" 16 #include "base/memory/ref_counted.h"
17 #include "base/timer/timer.h" 17 #include "base/timer/timer.h"
18 #include "components/invalidation/public/invalidation.h" 18 #include "components/invalidation/public/invalidation.h"
19 #include "components/sync/base/cancelation_signal.h" 19 #include "components/sync/base/cancelation_signal.h"
20 #include "components/sync/base/system_encryptor.h" 20 #include "components/sync/base/system_encryptor.h"
21 #include "components/sync/core/shutdown_reason.h"
22 #include "components/sync/core/sync_encryption_handler.h"
23 #include "components/sync/driver/glue/sync_backend_host_impl.h" 21 #include "components/sync/driver/glue/sync_backend_host_impl.h"
24 #include "components/sync/engine/cycle/type_debug_info_observer.h" 22 #include "components/sync/engine/cycle/type_debug_info_observer.h"
23 #include "components/sync/engine/shutdown_reason.h"
24 #include "components/sync/engine/sync_encryption_handler.h"
25 #include "url/gurl.h" 25 #include "url/gurl.h"
26 26
27 namespace syncer { 27 namespace syncer {
28 28
29 class SyncBackendHostImpl; 29 class SyncBackendHostImpl;
30 30
31 // Utility struct for holding initialization options. 31 // Utility struct for holding initialization options.
32 struct DoInitializeOptions { 32 struct DoInitializeOptions {
33 DoInitializeOptions( 33 DoInitializeOptions(
34 base::MessageLoop* sync_loop, 34 base::MessageLoop* sync_loop,
35 SyncBackendRegistrar* registrar, 35 SyncBackendRegistrar* registrar,
36 const std::vector<scoped_refptr<ModelSafeWorker>>& workers, 36 const std::vector<scoped_refptr<ModelSafeWorker>>& workers,
37 const scoped_refptr<ExtensionsActivity>& extensions_activity, 37 const scoped_refptr<ExtensionsActivity>& extensions_activity,
38 const WeakHandle<JsEventHandler>& event_handler, 38 const WeakHandle<JsEventHandler>& event_handler,
39 const GURL& service_url, 39 const GURL& service_url,
40 const std::string& sync_user_agent, 40 const std::string& sync_user_agent,
41 std::unique_ptr<HttpPostProviderFactory> http_bridge_factory, 41 std::unique_ptr<HttpPostProviderFactory> http_bridge_factory,
42 const SyncCredentials& credentials, 42 const SyncCredentials& credentials,
43 const std::string& invalidator_client_id, 43 const std::string& invalidator_client_id,
44 std::unique_ptr<SyncManagerFactory> sync_manager_factory, 44 std::unique_ptr<SyncManagerFactory> sync_manager_factory,
45 bool delete_sync_data_folder, 45 bool delete_sync_data_folder,
46 const std::string& restored_key_for_bootstrapping, 46 const std::string& restored_key_for_bootstrapping,
47 const std::string& restored_keystore_key_for_bootstrapping, 47 const std::string& restored_keystore_key_for_bootstrapping,
48 std::unique_ptr<InternalComponentsFactory> internal_components_factory, 48 std::unique_ptr<EngineComponentsFactory> engine_components_factory,
49 const WeakHandle<UnrecoverableErrorHandler>& unrecoverable_error_handler, 49 const WeakHandle<UnrecoverableErrorHandler>& unrecoverable_error_handler,
50 const base::Closure& report_unrecoverable_error_function, 50 const base::Closure& report_unrecoverable_error_function,
51 std::unique_ptr<SyncEncryptionHandler::NigoriState> saved_nigori_state, 51 std::unique_ptr<SyncEncryptionHandler::NigoriState> saved_nigori_state,
52 const std::map<ModelType, int64_t>& invalidation_versions); 52 const std::map<ModelType, int64_t>& invalidation_versions);
53 ~DoInitializeOptions(); 53 ~DoInitializeOptions();
54 54
55 base::MessageLoop* sync_loop; 55 base::MessageLoop* sync_loop;
56 SyncBackendRegistrar* registrar; 56 SyncBackendRegistrar* registrar;
57 std::vector<scoped_refptr<ModelSafeWorker>> workers; 57 std::vector<scoped_refptr<ModelSafeWorker>> workers;
58 scoped_refptr<ExtensionsActivity> extensions_activity; 58 scoped_refptr<ExtensionsActivity> extensions_activity;
59 WeakHandle<JsEventHandler> event_handler; 59 WeakHandle<JsEventHandler> event_handler;
60 GURL service_url; 60 GURL service_url;
61 std::string sync_user_agent; 61 std::string sync_user_agent;
62 // Overridden by tests. 62 // Overridden by tests.
63 std::unique_ptr<HttpPostProviderFactory> http_bridge_factory; 63 std::unique_ptr<HttpPostProviderFactory> http_bridge_factory;
64 SyncCredentials credentials; 64 SyncCredentials credentials;
65 const std::string invalidator_client_id; 65 const std::string invalidator_client_id;
66 std::unique_ptr<SyncManagerFactory> sync_manager_factory; 66 std::unique_ptr<SyncManagerFactory> sync_manager_factory;
67 std::string lsid; 67 std::string lsid;
68 bool delete_sync_data_folder; 68 bool delete_sync_data_folder;
69 std::string restored_key_for_bootstrapping; 69 std::string restored_key_for_bootstrapping;
70 std::string restored_keystore_key_for_bootstrapping; 70 std::string restored_keystore_key_for_bootstrapping;
71 std::unique_ptr<InternalComponentsFactory> internal_components_factory; 71 std::unique_ptr<EngineComponentsFactory> engine_components_factory;
72 const WeakHandle<UnrecoverableErrorHandler> unrecoverable_error_handler; 72 const WeakHandle<UnrecoverableErrorHandler> unrecoverable_error_handler;
73 base::Closure report_unrecoverable_error_function; 73 base::Closure report_unrecoverable_error_function;
74 std::unique_ptr<SyncEncryptionHandler::NigoriState> saved_nigori_state; 74 std::unique_ptr<SyncEncryptionHandler::NigoriState> saved_nigori_state;
75 const std::map<ModelType, int64_t> invalidation_versions; 75 const std::map<ModelType, int64_t> invalidation_versions;
76 }; 76 };
77 77
78 // Helper struct to handle currying params to 78 // Helper struct to handle currying params to
79 // SyncBackendHost::Core::DoConfigureSyncer. 79 // SyncBackendHost::Core::DoConfigureSyncer.
80 struct DoConfigureSyncerTypes { 80 struct DoConfigureSyncerTypes {
81 DoConfigureSyncerTypes(); 81 DoConfigureSyncerTypes();
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 std::map<ModelType, int64_t> last_invalidation_versions_; 315 std::map<ModelType, int64_t> last_invalidation_versions_;
316 316
317 base::WeakPtrFactory<SyncBackendHostCore> weak_ptr_factory_; 317 base::WeakPtrFactory<SyncBackendHostCore> weak_ptr_factory_;
318 318
319 DISALLOW_COPY_AND_ASSIGN(SyncBackendHostCore); 319 DISALLOW_COPY_AND_ASSIGN(SyncBackendHostCore);
320 }; 320 };
321 321
322 } // namespace syncer 322 } // namespace syncer
323 323
324 #endif // COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_CORE_H_ 324 #endif // COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_CORE_H_
OLDNEW
« no previous file with comments | « components/sync/driver/glue/sync_backend_host.h ('k') | components/sync/driver/glue/sync_backend_host_core.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698