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

Side by Side Diff: chrome/browser/policy/cloud/user_cloud_policy_manager_factory.cc

Issue 1118483002: [chrome/browser/policy] Replace MessageLoopProxy usage with ThreadTaskRunnerHandle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Review Comments Created 5 years, 7 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 (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/policy/cloud/user_cloud_policy_manager_factory.h" 5 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop_proxy.h"
10 #include "base/sequenced_task_runner.h" 9 #include "base/sequenced_task_runner.h"
10 #include "base/thread_task_runner_handle.h"
11 #include "chrome/browser/policy/schema_registry_service.h" 11 #include "chrome/browser/policy/schema_registry_service.h"
12 #include "chrome/browser/policy/schema_registry_service_factory.h" 12 #include "chrome/browser/policy/schema_registry_service_factory.h"
13 #include "components/keyed_service/content/browser_context_dependency_manager.h" 13 #include "components/keyed_service/content/browser_context_dependency_manager.h"
14 #include "components/keyed_service/core/keyed_service.h" 14 #include "components/keyed_service/core/keyed_service.h"
15 #include "components/policy/core/common/cloud/cloud_external_data_manager.h" 15 #include "components/policy/core/common/cloud/cloud_external_data_manager.h"
16 #include "components/policy/core/common/cloud/cloud_policy_constants.h" 16 #include "components/policy/core/common/cloud/cloud_policy_constants.h"
17 #include "components/policy/core/common/cloud/user_cloud_policy_manager.h" 17 #include "components/policy/core/common/cloud/user_cloud_policy_manager.h"
18 #include "components/policy/core/common/cloud/user_cloud_policy_store.h" 18 #include "components/policy/core/common/cloud/user_cloud_policy_store.h"
19 #include "content/public/browser/browser_context.h" 19 #include "content/public/browser/browser_context.h"
20 20
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 store->LoadImmediately(); 148 store->LoadImmediately();
149 149
150 const base::FilePath component_policy_cache_dir = 150 const base::FilePath component_policy_cache_dir =
151 context->GetPath().Append(kPolicy).Append(kComponentsDir); 151 context->GetPath().Append(kPolicy).Append(kComponentsDir);
152 152
153 scoped_ptr<UserCloudPolicyManager> manager; 153 scoped_ptr<UserCloudPolicyManager> manager;
154 manager.reset(new UserCloudPolicyManager( 154 manager.reset(new UserCloudPolicyManager(
155 store.Pass(), 155 store.Pass(),
156 component_policy_cache_dir, 156 component_policy_cache_dir,
157 scoped_ptr<CloudExternalDataManager>(), 157 scoped_ptr<CloudExternalDataManager>(),
158 base::MessageLoopProxy::current(), 158 base::ThreadTaskRunnerHandle::Get(),
159 file_task_runner, 159 file_task_runner,
160 io_task_runner)); 160 io_task_runner));
161 manager->Init( 161 manager->Init(
162 SchemaRegistryServiceFactory::GetForContext(context)->registry()); 162 SchemaRegistryServiceFactory::GetForContext(context)->registry());
163 manager_wrappers_[context] = new ManagerWrapper(manager.get()); 163 manager_wrappers_[context] = new ManagerWrapper(manager.get());
164 return manager.Pass(); 164 return manager.Pass();
165 } 165 }
166 166
167 UserCloudPolicyManager* 167 UserCloudPolicyManager*
168 UserCloudPolicyManagerFactory::RegisterManagerForOffTheRecordBrowserContext( 168 UserCloudPolicyManagerFactory::RegisterManagerForOffTheRecordBrowserContext(
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 return testing_factory_ != NULL; 210 return testing_factory_ != NULL;
211 } 211 }
212 212
213 void UserCloudPolicyManagerFactory::CreateServiceNow( 213 void UserCloudPolicyManagerFactory::CreateServiceNow(
214 content::BrowserContext* context) { 214 content::BrowserContext* context) {
215 DCHECK(testing_factory_); 215 DCHECK(testing_factory_);
216 manager_wrappers_[context] = new ManagerWrapper(testing_factory_(context)); 216 manager_wrappers_[context] = new ManagerWrapper(testing_factory_(context));
217 } 217 }
218 218
219 } // namespace policy 219 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698