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

Side by Side Diff: chrome/browser/sync/profile_sync_service_factory.cc

Issue 2489433002: [Sync] Move thread checking into the ModelSafeWorker interface. (Closed)
Patch Set: Improve/add comments. Created 4 years, 1 month 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "chrome/browser/sync/profile_sync_service_factory.h" 5 #include "chrome/browser/sync/profile_sync_service_factory.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 base::MakeUnique<browser_sync::ChromeSyncClient>(profile); 176 base::MakeUnique<browser_sync::ChromeSyncClient>(profile);
177 } else { 177 } else {
178 init_params.sync_client = client_factory_->Run(profile); 178 init_params.sync_client = client_factory_->Run(profile);
179 } 179 }
180 180
181 init_params.network_time_update_callback = base::Bind(&UpdateNetworkTime); 181 init_params.network_time_update_callback = base::Bind(&UpdateNetworkTime);
182 init_params.base_directory = profile->GetPath(); 182 init_params.base_directory = profile->GetPath();
183 init_params.url_request_context = profile->GetRequestContext(); 183 init_params.url_request_context = profile->GetRequestContext();
184 init_params.debug_identifier = profile->GetDebugName(); 184 init_params.debug_identifier = profile->GetDebugName();
185 init_params.channel = chrome::GetChannel(); 185 init_params.channel = chrome::GetChannel();
186
187 init_params.db_thread = content::BrowserThread::GetTaskRunnerForThread(
188 content::BrowserThread::DB);
189 init_params.file_thread = content::BrowserThread::GetTaskRunnerForThread(
190 content::BrowserThread::FILE);
191 init_params.blocking_pool = content::BrowserThread::GetBlockingPool(); 186 init_params.blocking_pool = content::BrowserThread::GetBlockingPool();
192 187
193 auto pss = base::MakeUnique<ProfileSyncService>(std::move(init_params)); 188 auto pss = base::MakeUnique<ProfileSyncService>(std::move(init_params));
194 189
195 // Will also initialize the sync client. 190 // Will also initialize the sync client.
196 pss->Initialize(); 191 pss->Initialize();
197 return pss.release(); 192 return pss.release();
198 } 193 }
199 194
200 // static 195 // static
201 bool ProfileSyncServiceFactory::HasProfileSyncService(Profile* profile) { 196 bool ProfileSyncServiceFactory::HasProfileSyncService(Profile* profile) {
202 return GetInstance()->GetServiceForBrowserContext(profile, false) != nullptr; 197 return GetInstance()->GetServiceForBrowserContext(profile, false) != nullptr;
203 } 198 }
204 199
205 // static 200 // static
206 void ProfileSyncServiceFactory::SetSyncClientFactoryForTest( 201 void ProfileSyncServiceFactory::SetSyncClientFactoryForTest(
207 SyncClientFactory* client_factory) { 202 SyncClientFactory* client_factory) {
208 client_factory_ = client_factory; 203 client_factory_ = client_factory;
209 } 204 }
210 205
211 // static 206 // static
212 ProfileSyncServiceFactory::SyncClientFactory* 207 ProfileSyncServiceFactory::SyncClientFactory*
213 ProfileSyncServiceFactory::client_factory_ = nullptr; 208 ProfileSyncServiceFactory::client_factory_ = nullptr;
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/profile_sync_test_util.cc » ('j') | components/history/core/browser/history_model_worker.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698