Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "chrome/browser/chromeos/policy/user_policy_manager_factory_chromeos.h" | 5 #include "chrome/browser/chromeos/policy/user_policy_manager_factory_chromeos.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/memory/ptr_util.h" | 13 #include "base/memory/ptr_util.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/path_service.h" | 15 #include "base/path_service.h" |
| 16 #include "base/sequenced_task_runner.h" | 16 #include "base/sequenced_task_runner.h" |
| 17 #include "base/threading/sequenced_worker_pool.h" | 17 #include "base/task_scheduler/post_task.h" |
| 18 #include "base/threading/thread_task_runner_handle.h" | 18 #include "base/threading/thread_task_runner_handle.h" |
| 19 #include "base/time/time.h" | 19 #include "base/time/time.h" |
| 20 #include "chrome/browser/browser_process.h" | 20 #include "chrome/browser/browser_process.h" |
| 21 #include "chrome/browser/chromeos/policy/active_directory_policy_manager.h" | 21 #include "chrome/browser/chromeos/policy/active_directory_policy_manager.h" |
| 22 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 22 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 23 #include "chrome/browser/chromeos/policy/user_cloud_external_data_manager.h" | 23 #include "chrome/browser/chromeos/policy/user_cloud_external_data_manager.h" |
| 24 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" | 24 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" |
| 25 #include "chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos.h" | 25 #include "chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos.h" |
| 26 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 26 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 27 #include "chrome/browser/chromeos/settings/cros_settings.h" | 27 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 233 CHECK(PathService::Get(chromeos::DIR_USER_POLICY_KEYS, &policy_key_dir)); | 233 CHECK(PathService::Get(chromeos::DIR_USER_POLICY_KEYS, &policy_key_dir)); |
| 234 | 234 |
| 235 std::unique_ptr<UserCloudPolicyStoreChromeOS> store = | 235 std::unique_ptr<UserCloudPolicyStoreChromeOS> store = |
| 236 base::MakeUnique<UserCloudPolicyStoreChromeOS>( | 236 base::MakeUnique<UserCloudPolicyStoreChromeOS>( |
| 237 chromeos::DBusThreadManager::Get()->GetCryptohomeClient(), | 237 chromeos::DBusThreadManager::Get()->GetCryptohomeClient(), |
| 238 chromeos::DBusThreadManager::Get()->GetSessionManagerClient(), | 238 chromeos::DBusThreadManager::Get()->GetSessionManagerClient(), |
| 239 background_task_runner, account_id, policy_key_dir, | 239 background_task_runner, account_id, policy_key_dir, |
| 240 is_active_directory); | 240 is_active_directory); |
| 241 | 241 |
| 242 scoped_refptr<base::SequencedTaskRunner> backend_task_runner = | 242 scoped_refptr<base::SequencedTaskRunner> backend_task_runner = |
| 243 content::BrowserThread::GetBlockingPool()->GetSequencedTaskRunner( | 243 base::CreateSequencedTaskRunnerWithTraits( |
| 244 content::BrowserThread::GetBlockingPool()->GetSequenceToken()); | 244 base::TaskTraits().MayBlock().WithPriority( |
| 245 base::TaskPriority::BACKGROUND)); | |
|
Thiemo Nagel
2017/04/27 09:44:52
I think we should SKIP_ON_SHUTDOWN. From what I c
fdoray
2017/04/27 13:27:21
Done.
| |
| 245 scoped_refptr<base::SequencedTaskRunner> io_task_runner = | 246 scoped_refptr<base::SequencedTaskRunner> io_task_runner = |
| 246 content::BrowserThread::GetTaskRunnerForThread( | 247 content::BrowserThread::GetTaskRunnerForThread( |
| 247 content::BrowserThread::IO); | 248 content::BrowserThread::IO); |
| 248 std::unique_ptr<CloudExternalDataManager> external_data_manager( | 249 std::unique_ptr<CloudExternalDataManager> external_data_manager( |
| 249 new UserCloudExternalDataManager(base::Bind(&GetChromePolicyDetails), | 250 new UserCloudExternalDataManager(base::Bind(&GetChromePolicyDetails), |
| 250 backend_task_runner, io_task_runner, | 251 backend_task_runner, io_task_runner, |
| 251 external_data_dir, store.get())); | 252 external_data_dir, store.get())); |
| 252 if (force_immediate_load) | 253 if (force_immediate_load) |
| 253 store->LoadImmediately(); | 254 store->LoadImmediately(); |
| 254 | 255 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 322 | 323 |
| 323 bool UserPolicyManagerFactoryChromeOS::HasTestingFactory( | 324 bool UserPolicyManagerFactoryChromeOS::HasTestingFactory( |
| 324 content::BrowserContext* context) { | 325 content::BrowserContext* context) { |
| 325 return false; | 326 return false; |
| 326 } | 327 } |
| 327 | 328 |
| 328 void UserPolicyManagerFactoryChromeOS::CreateServiceNow( | 329 void UserPolicyManagerFactoryChromeOS::CreateServiceNow( |
| 329 content::BrowserContext* context) {} | 330 content::BrowserContext* context) {} |
| 330 | 331 |
| 331 } // namespace policy | 332 } // namespace policy |
| OLD | NEW |