| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/browser_policy_connector_chromeos.h" | 5 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 13 #include "base/location.h" | 13 #include "base/location.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/memory/ptr_util.h" | 15 #include "base/memory/ptr_util.h" |
| 16 #include "base/path_service.h" | 16 #include "base/path_service.h" |
| 17 #include "base/sequenced_task_runner.h" | 17 #include "base/sequenced_task_runner.h" |
| 18 #include "base/single_thread_task_runner.h" | 18 #include "base/single_thread_task_runner.h" |
| 19 #include "base/strings/utf_string_conversions.h" | 19 #include "base/strings/utf_string_conversions.h" |
| 20 #include "base/threading/sequenced_worker_pool.h" | 20 #include "base/task_scheduler/post_task.h" |
| 21 #include "base/threading/thread_task_runner_handle.h" | 21 #include "base/threading/thread_task_runner_handle.h" |
| 22 #include "chrome/browser/chromeos/attestation/attestation_ca_client.h" | 22 #include "chrome/browser/chromeos/attestation/attestation_ca_client.h" |
| 23 #include "chrome/browser/chromeos/policy/active_directory_policy_manager.h" | 23 #include "chrome/browser/chromeos/policy/active_directory_policy_manager.h" |
| 24 #include "chrome/browser/chromeos/policy/affiliated_cloud_policy_invalidator.h" | 24 #include "chrome/browser/chromeos/policy/affiliated_cloud_policy_invalidator.h" |
| 25 #include "chrome/browser/chromeos/policy/affiliated_invalidation_service_provide
r.h" | 25 #include "chrome/browser/chromeos/policy/affiliated_invalidation_service_provide
r.h" |
| 26 #include "chrome/browser/chromeos/policy/affiliated_invalidation_service_provide
r_impl.h" | 26 #include "chrome/browser/chromeos/policy/affiliated_invalidation_service_provide
r_impl.h" |
| 27 #include "chrome/browser/chromeos/policy/bluetooth_policy_handler.h" | 27 #include "chrome/browser/chromeos/policy/bluetooth_policy_handler.h" |
| 28 #include "chrome/browser/chromeos/policy/device_cloud_policy_initializer.h" | 28 #include "chrome/browser/chromeos/policy/device_cloud_policy_initializer.h" |
| 29 #include "chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h" | 29 #include "chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h" |
| 30 #include "chrome/browser/chromeos/policy/device_local_account.h" | 30 #include "chrome/browser/chromeos/policy/device_local_account.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 63 |
| 64 using content::BrowserThread; | 64 using content::BrowserThread; |
| 65 | 65 |
| 66 namespace policy { | 66 namespace policy { |
| 67 | 67 |
| 68 namespace { | 68 namespace { |
| 69 | 69 |
| 70 // Install attributes for tests. | 70 // Install attributes for tests. |
| 71 chromeos::InstallAttributes* g_testing_install_attributes = nullptr; | 71 chromeos::InstallAttributes* g_testing_install_attributes = nullptr; |
| 72 | 72 |
| 73 // Helper that returns a new SequencedTaskRunner backed by the blocking pool. | 73 // Helper that returns a new BACKGROUND SequencedTaskRunner. Each |
| 74 // Each SequencedTaskRunner returned is independent from the others. | 74 // SequencedTaskRunner returned is independent from the others. |
| 75 scoped_refptr<base::SequencedTaskRunner> GetBackgroundTaskRunner() { | 75 scoped_refptr<base::SequencedTaskRunner> GetBackgroundTaskRunner() { |
| 76 base::SequencedWorkerPool* pool = BrowserThread::GetBlockingPool(); | 76 return base::CreateSequencedTaskRunnerWithTraits( |
| 77 CHECK(pool); | 77 {base::MayBlock(), base::TaskPriority::BACKGROUND, |
| 78 return pool->GetSequencedTaskRunnerWithShutdownBehavior( | 78 base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}); |
| 79 pool->GetSequenceToken(), base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); | |
| 80 } | 79 } |
| 81 | 80 |
| 82 } // namespace | 81 } // namespace |
| 83 | 82 |
| 84 BrowserPolicyConnectorChromeOS::BrowserPolicyConnectorChromeOS() | 83 BrowserPolicyConnectorChromeOS::BrowserPolicyConnectorChromeOS() |
| 85 : weak_ptr_factory_(this) { | 84 : weak_ptr_factory_(this) { |
| 86 if (g_testing_install_attributes) { | 85 if (g_testing_install_attributes) { |
| 87 install_attributes_.reset(g_testing_install_attributes); | 86 install_attributes_.reset(g_testing_install_attributes); |
| 88 g_testing_install_attributes = nullptr; | 87 g_testing_install_attributes = nullptr; |
| 89 } | 88 } |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 device_cloud_policy_manager_->device_store()->policy(); | 376 device_cloud_policy_manager_->device_store()->policy(); |
| 378 if (policy_data) { | 377 if (policy_data) { |
| 379 affiliation_ids.insert(policy_data->device_affiliation_ids().begin(), | 378 affiliation_ids.insert(policy_data->device_affiliation_ids().begin(), |
| 380 policy_data->device_affiliation_ids().end()); | 379 policy_data->device_affiliation_ids().end()); |
| 381 } | 380 } |
| 382 } | 381 } |
| 383 return affiliation_ids; | 382 return affiliation_ids; |
| 384 } | 383 } |
| 385 | 384 |
| 386 } // namespace policy | 385 } // namespace policy |
| OLD | NEW |