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

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

Issue 2563423005: [Sync] Move ConfigureDataTypes logic into DataTypeManagerImpl. (Closed)
Patch Set: Address comments. Created 3 years, 11 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/single_thread_task_runner.h" 17 #include "base/single_thread_task_runner.h"
18 #include "base/threading/thread_checker.h" 18 #include "base/threading/thread_checker.h"
19 #include "base/timer/timer.h" 19 #include "base/timer/timer.h"
20 #include "base/trace_event/memory_dump_provider.h" 20 #include "base/trace_event/memory_dump_provider.h"
21 #include "components/invalidation/public/invalidation.h" 21 #include "components/invalidation/public/invalidation.h"
22 #include "components/sync/base/cancelation_signal.h" 22 #include "components/sync/base/cancelation_signal.h"
23 #include "components/sync/base/system_encryptor.h" 23 #include "components/sync/base/system_encryptor.h"
24 #include "components/sync/driver/glue/sync_backend_host_impl.h" 24 #include "components/sync/driver/glue/sync_backend_host_impl.h"
25 #include "components/sync/engine/cycle/type_debug_info_observer.h" 25 #include "components/sync/engine/cycle/type_debug_info_observer.h"
26 #include "components/sync/engine/model_type_configurer.h"
26 #include "components/sync/engine/shutdown_reason.h" 27 #include "components/sync/engine/shutdown_reason.h"
27 #include "components/sync/engine/sync_encryption_handler.h" 28 #include "components/sync/engine/sync_encryption_handler.h"
28 #include "url/gurl.h" 29 #include "url/gurl.h"
29 30
30 namespace syncer { 31 namespace syncer {
31 32
32 class SyncBackendHostImpl; 33 class SyncBackendHostImpl;
33 34
34 class SyncBackendHostCore 35 class SyncBackendHostCore
35 : public base::RefCountedThreadSafe<SyncBackendHostCore>, 36 : public base::RefCountedThreadSafe<SyncBackendHostCore>,
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 // 2) Post DoShutdown() to sync loop to clean up backend state, save 139 // 2) Post DoShutdown() to sync loop to clean up backend state, save
139 // directory and destroy sync manager. 140 // directory and destroy sync manager.
140 void ShutdownOnUIThread(); 141 void ShutdownOnUIThread();
141 void DoShutdown(ShutdownReason reason); 142 void DoShutdown(ShutdownReason reason);
142 void DoDestroySyncManager(ShutdownReason reason); 143 void DoDestroySyncManager(ShutdownReason reason);
143 144
144 // Configuration methods that must execute on sync loop. 145 // Configuration methods that must execute on sync loop.
145 void DoPurgeDisabledTypes(const ModelTypeSet& to_purge, 146 void DoPurgeDisabledTypes(const ModelTypeSet& to_purge,
146 const ModelTypeSet& to_journal, 147 const ModelTypeSet& to_journal,
147 const ModelTypeSet& to_unapply); 148 const ModelTypeSet& to_unapply);
148 void DoConfigureSyncer( 149 void DoConfigureSyncer(ModelTypeConfigurer::ConfigureParams params);
149 ConfigureReason reason,
150 const ModelTypeSet& to_download,
151 const ModelSafeRoutingInfo routing_info,
152 const base::Callback<void(ModelTypeSet, ModelTypeSet)>& ready_task,
153 const base::Closure& retry_callback);
154 void DoFinishConfigureDataTypes( 150 void DoFinishConfigureDataTypes(
155 ModelTypeSet types_to_config, 151 ModelTypeSet types_to_config,
156 const base::Callback<void(ModelTypeSet, ModelTypeSet)>& ready_task); 152 const base::Callback<void(ModelTypeSet, ModelTypeSet)>& ready_task);
157 void DoRetryConfiguration(const base::Closure& retry_callback); 153 void DoRetryConfiguration(const base::Closure& retry_callback);
158 154
159 // Set the base request context to use when making HTTP calls. 155 // Set the base request context to use when making HTTP calls.
160 // This method will add a reference to the context to persist it 156 // This method will add a reference to the context to persist it
161 // on the IO thread. Must be removed from IO thread. 157 // on the IO thread. Must be removed from IO thread.
162 158
163 SyncManager* sync_manager() { return sync_manager_.get(); } 159 SyncManager* sync_manager() { return sync_manager_.get(); }
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 base::ThreadChecker thread_checker_; 244 base::ThreadChecker thread_checker_;
249 245
250 base::WeakPtrFactory<SyncBackendHostCore> weak_ptr_factory_; 246 base::WeakPtrFactory<SyncBackendHostCore> weak_ptr_factory_;
251 247
252 DISALLOW_COPY_AND_ASSIGN(SyncBackendHostCore); 248 DISALLOW_COPY_AND_ASSIGN(SyncBackendHostCore);
253 }; 249 };
254 250
255 } // namespace syncer 251 } // namespace syncer
256 252
257 #endif // COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_CORE_H_ 253 #endif // COMPONENTS_SYNC_DRIVER_GLUE_SYNC_BACKEND_HOST_CORE_H_
OLDNEW
« no previous file with comments | « components/sync/driver/fake_data_type_controller.cc ('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