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

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

Issue 258008: Move initialization of ChromeURLRequestContexts to the IO thread. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync again, just in case Created 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 #if defined(BROWSER_SYNC) 5 #if defined(BROWSER_SYNC)
6 6
7 #ifndef CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ 7 #ifndef CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_
8 #define CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ 8 #define CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_
9 9
10 #include <string> 10 #include <string>
11 11
12 #include "base/file_path.h" 12 #include "base/file_path.h"
13 #include "base/lock.h" 13 #include "base/lock.h"
14 #include "base/message_loop.h" 14 #include "base/message_loop.h"
15 #include "base/ref_counted.h" 15 #include "base/ref_counted.h"
16 #include "base/thread.h" 16 #include "base/thread.h"
17 #include "base/timer.h" 17 #include "base/timer.h"
18 #include "chrome/browser/net/url_request_context_getter.h"
18 #include "chrome/browser/sync/auth_error_state.h" 19 #include "chrome/browser/sync/auth_error_state.h"
19 #include "chrome/browser/sync/engine/syncapi.h" 20 #include "chrome/browser/sync/engine/syncapi.h"
20 #include "chrome/browser/sync/glue/bookmark_model_worker.h" 21 #include "chrome/browser/sync/glue/bookmark_model_worker.h"
21 #include "googleurl/src/gurl.h" 22 #include "googleurl/src/gurl.h"
22 #include "net/url_request/url_request_context.h"
23 23
24 namespace browser_sync { 24 namespace browser_sync {
25 25
26 // SyncFrontend is the interface used by SyncBackendHost to communicate with 26 // SyncFrontend is the interface used by SyncBackendHost to communicate with
27 // the entity that created it and, presumably, is interested in sync-related 27 // the entity that created it and, presumably, is interested in sync-related
28 // activity. 28 // activity.
29 // NOTE: All methods will be invoked by a SyncBackendHost on the same thread 29 // NOTE: All methods will be invoked by a SyncBackendHost on the same thread
30 // used to create that SyncBackendHost. 30 // used to create that SyncBackendHost.
31 class SyncFrontend { 31 class SyncFrontend {
32 public: 32 public:
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 78
79 // Create a SyncBackendHost with a reference to the |frontend| that it serves 79 // Create a SyncBackendHost with a reference to the |frontend| that it serves
80 // and communicates to via the SyncFrontend interface (on the same thread 80 // and communicates to via the SyncFrontend interface (on the same thread
81 // it used to call the constructor), and push changes from sync_api through 81 // it used to call the constructor), and push changes from sync_api through
82 // |processor|. 82 // |processor|.
83 SyncBackendHost(SyncFrontend* frontend, const FilePath& profile_path, 83 SyncBackendHost(SyncFrontend* frontend, const FilePath& profile_path,
84 ChangeProcessingInterface* processor); 84 ChangeProcessingInterface* processor);
85 ~SyncBackendHost(); 85 ~SyncBackendHost();
86 86
87 // Called on |frontend_loop_| to kick off asynchronous initialization. 87 // Called on |frontend_loop_| to kick off asynchronous initialization.
88 void Initialize(const GURL& service_url, URLRequestContext* baseline_context); 88 void Initialize(const GURL& service_url,
89 URLRequestContextGetter* baseline_context_getter);
89 90
90 // Called on |frontend_loop_| to kick off asynchronous authentication. 91 // Called on |frontend_loop_| to kick off asynchronous authentication.
91 void Authenticate(const std::string& username, const std::string& password); 92 void Authenticate(const std::string& username, const std::string& password);
92 93
93 // Called on |frontend_loop_| to kick off shutdown. 94 // Called on |frontend_loop_| to kick off shutdown.
94 // |sync_disabled| indicates if syncing is being disabled or not. 95 // |sync_disabled| indicates if syncing is being disabled or not.
95 // See the implementation and Core::DoShutdown for details. 96 // See the implementation and Core::DoShutdown for details.
96 void Shutdown(bool sync_disabled); 97 void Shutdown(bool sync_disabled);
97 98
98 // Called on |frontend_loop_| to obtain a handle to the UserShare needed 99 // Called on |frontend_loop_| to obtain a handle to the UserShare needed
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 // UI-thread cache of the last AuthErrorState received from syncapi. 282 // UI-thread cache of the last AuthErrorState received from syncapi.
282 AuthErrorState last_auth_error_; 283 AuthErrorState last_auth_error_;
283 284
284 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost); 285 DISALLOW_COPY_AND_ASSIGN(SyncBackendHost);
285 }; 286 };
286 287
287 } // namespace browser_sync 288 } // namespace browser_sync
288 289
289 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_ 290 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_H_
290 #endif // defined(BROWSER_SYNC) 291 #endif // defined(BROWSER_SYNC)
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/http_bridge_unittest.cc ('k') | chrome/browser/sync/glue/sync_backend_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698