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

Side by Side Diff: chrome/browser/sync/glue/sync_backend_host_core.h

Issue 130193002: sync: Consistently refcount ModelSafeWorkers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix standalone sync client Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/sync/glue/sync_backend_host_core.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_CORE_H_ 5 #ifndef CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_CORE_H_
6 #define CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_CORE_H_ 6 #define CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_CORE_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 9
10 #include "base/timer/timer.h" 10 #include "base/timer/timer.h"
11 #include "chrome/browser/sync/glue/chrome_encryptor.h" 11 #include "chrome/browser/sync/glue/chrome_encryptor.h"
12 #include "chrome/browser/sync/glue/sync_backend_host_impl.h" 12 #include "chrome/browser/sync/glue/sync_backend_host_impl.h"
13 #include "sync/internal_api/public/base/cancelation_signal.h" 13 #include "sync/internal_api/public/base/cancelation_signal.h"
14 #include "sync/internal_api/public/sync_encryption_handler.h" 14 #include "sync/internal_api/public/sync_encryption_handler.h"
15 #include "url/gurl.h" 15 #include "url/gurl.h"
16 16
17 namespace browser_sync { 17 namespace browser_sync {
18 18
19 class SyncBackendHostImpl; 19 class SyncBackendHostImpl;
20 20
21 // Utility struct for holding initialization options. 21 // Utility struct for holding initialization options.
22 struct DoInitializeOptions { 22 struct DoInitializeOptions {
23 DoInitializeOptions( 23 DoInitializeOptions(
24 base::MessageLoop* sync_loop, 24 base::MessageLoop* sync_loop,
25 SyncBackendRegistrar* registrar, 25 SyncBackendRegistrar* registrar,
26 const syncer::ModelSafeRoutingInfo& routing_info, 26 const syncer::ModelSafeRoutingInfo& routing_info,
27 const std::vector<syncer::ModelSafeWorker*>& workers, 27 const std::vector<scoped_refptr<syncer::ModelSafeWorker> >& workers,
28 const scoped_refptr<syncer::ExtensionsActivity>& extensions_activity, 28 const scoped_refptr<syncer::ExtensionsActivity>& extensions_activity,
29 const syncer::WeakHandle<syncer::JsEventHandler>& event_handler, 29 const syncer::WeakHandle<syncer::JsEventHandler>& event_handler,
30 const GURL& service_url, 30 const GURL& service_url,
31 scoped_ptr<syncer::HttpPostProviderFactory> http_bridge_factory, 31 scoped_ptr<syncer::HttpPostProviderFactory> http_bridge_factory,
32 const syncer::SyncCredentials& credentials, 32 const syncer::SyncCredentials& credentials,
33 const std::string& invalidator_client_id, 33 const std::string& invalidator_client_id,
34 scoped_ptr<syncer::SyncManagerFactory> sync_manager_factory, 34 scoped_ptr<syncer::SyncManagerFactory> sync_manager_factory,
35 bool delete_sync_data_folder, 35 bool delete_sync_data_folder,
36 const std::string& restored_key_for_bootstrapping, 36 const std::string& restored_key_for_bootstrapping,
37 const std::string& restored_keystore_key_for_bootstrapping, 37 const std::string& restored_keystore_key_for_bootstrapping,
38 scoped_ptr<syncer::InternalComponentsFactory> 38 scoped_ptr<syncer::InternalComponentsFactory>
39 internal_components_factory, 39 internal_components_factory,
40 scoped_ptr<syncer::UnrecoverableErrorHandler> 40 scoped_ptr<syncer::UnrecoverableErrorHandler>
41 unrecoverable_error_handler, 41 unrecoverable_error_handler,
42 syncer::ReportUnrecoverableErrorFunction 42 syncer::ReportUnrecoverableErrorFunction
43 report_unrecoverable_error_function); 43 report_unrecoverable_error_function);
44 ~DoInitializeOptions(); 44 ~DoInitializeOptions();
45 45
46 base::MessageLoop* sync_loop; 46 base::MessageLoop* sync_loop;
47 SyncBackendRegistrar* registrar; 47 SyncBackendRegistrar* registrar;
48 syncer::ModelSafeRoutingInfo routing_info; 48 syncer::ModelSafeRoutingInfo routing_info;
49 std::vector<syncer::ModelSafeWorker*> workers; 49 std::vector<scoped_refptr<syncer::ModelSafeWorker> > workers;
50 scoped_refptr<syncer::ExtensionsActivity> extensions_activity; 50 scoped_refptr<syncer::ExtensionsActivity> extensions_activity;
51 syncer::WeakHandle<syncer::JsEventHandler> event_handler; 51 syncer::WeakHandle<syncer::JsEventHandler> event_handler;
52 GURL service_url; 52 GURL service_url;
53 // Overridden by tests. 53 // Overridden by tests.
54 scoped_ptr<syncer::HttpPostProviderFactory> http_bridge_factory; 54 scoped_ptr<syncer::HttpPostProviderFactory> http_bridge_factory;
55 syncer::SyncCredentials credentials; 55 syncer::SyncCredentials credentials;
56 const std::string invalidator_client_id; 56 const std::string invalidator_client_id;
57 scoped_ptr<syncer::SyncManagerFactory> sync_manager_factory; 57 scoped_ptr<syncer::SyncManagerFactory> sync_manager_factory;
58 std::string lsid; 58 std::string lsid;
59 bool delete_sync_data_folder; 59 bool delete_sync_data_folder;
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 const bool has_sync_setup_completed_; 286 const bool has_sync_setup_completed_;
287 287
288 base::WeakPtrFactory<SyncBackendHostCore> weak_ptr_factory_; 288 base::WeakPtrFactory<SyncBackendHostCore> weak_ptr_factory_;
289 289
290 DISALLOW_COPY_AND_ASSIGN(SyncBackendHostCore); 290 DISALLOW_COPY_AND_ASSIGN(SyncBackendHostCore);
291 }; 291 };
292 292
293 } // namespace browser_sync 293 } // namespace browser_sync
294 294
295 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_CORE_H_ 295 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_CORE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/glue/sync_backend_host_core.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698