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

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

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
« no previous file with comments | « chrome/browser/sync/glue/sync_backend_host.h ('k') | chrome/chrome.gyp » ('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 (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 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "base/file_version_info.h" 8 #include "base/file_version_info.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 22 matching lines...) Expand all
33 processor_(processor), 33 processor_(processor),
34 sync_data_folder_path_(profile_path.Append(kSyncDataFolderName)), 34 sync_data_folder_path_(profile_path.Append(kSyncDataFolderName)),
35 last_auth_error_(AUTH_ERROR_NONE) { 35 last_auth_error_(AUTH_ERROR_NONE) {
36 core_ = new Core(this); 36 core_ = new Core(this);
37 } 37 }
38 38
39 SyncBackendHost::~SyncBackendHost() { 39 SyncBackendHost::~SyncBackendHost() {
40 DCHECK(!core_ && !frontend_) << "Must call Shutdown before destructor."; 40 DCHECK(!core_ && !frontend_) << "Must call Shutdown before destructor.";
41 } 41 }
42 42
43 void SyncBackendHost::Initialize(const GURL& sync_service_url, 43 void SyncBackendHost::Initialize(
44 URLRequestContext* baseline_context) { 44 const GURL& sync_service_url,
45 URLRequestContextGetter* baseline_context_getter) {
45 if (!core_thread_.Start()) 46 if (!core_thread_.Start())
46 return; 47 return;
47 bookmark_model_worker_ = new BookmarkModelWorker(frontend_loop_); 48 bookmark_model_worker_ = new BookmarkModelWorker(frontend_loop_);
48 49
49 core_thread_.message_loop()->PostTask(FROM_HERE, 50 core_thread_.message_loop()->PostTask(FROM_HERE,
50 NewRunnableMethod(core_.get(), &SyncBackendHost::Core::DoInitialize, 51 NewRunnableMethod(core_.get(), &SyncBackendHost::Core::DoInitialize,
51 sync_service_url, bookmark_model_worker_, true, 52 sync_service_url, bookmark_model_worker_, true,
52 new HttpBridgeFactory(baseline_context), 53 new HttpBridgeFactory(baseline_context_getter),
53 new HttpBridgeFactory(baseline_context))); 54 new HttpBridgeFactory(baseline_context_getter)));
54 } 55 }
55 56
56 void SyncBackendHost::Authenticate(const std::string& username, 57 void SyncBackendHost::Authenticate(const std::string& username,
57 const std::string& password) { 58 const std::string& password) {
58 core_thread_.message_loop()->PostTask(FROM_HERE, 59 core_thread_.message_loop()->PostTask(FROM_HERE,
59 NewRunnableMethod(core_.get(), &SyncBackendHost::Core::DoAuthenticate, 60 NewRunnableMethod(core_.get(), &SyncBackendHost::Core::DoAuthenticate,
60 username, password)); 61 username, password));
61 } 62 }
62 63
63 void SyncBackendHost::Shutdown(bool sync_disabled) { 64 void SyncBackendHost::Shutdown(bool sync_disabled) {
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 this, &Core::SaveChanges); 308 this, &Core::SaveChanges);
308 } 309 }
309 310
310 void SyncBackendHost::Core::SaveChanges() { 311 void SyncBackendHost::Core::SaveChanges() {
311 syncapi_->SaveChanges(); 312 syncapi_->SaveChanges();
312 } 313 }
313 314
314 } // namespace browser_sync 315 } // namespace browser_sync
315 316
316 #endif // defined(BROWSER_SYNC) 317 #endif // defined(BROWSER_SYNC)
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/sync_backend_host.h ('k') | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698