| 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 "ios/chrome/browser/application_context_impl.h" | 5 #include "ios/chrome/browser/application_context_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 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/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/ptr_util.h" | 14 #include "base/memory/ptr_util.h" |
| 15 #include "base/path_service.h" | 15 #include "base/path_service.h" |
| 16 #include "base/sequenced_task_runner.h" | 16 #include "base/task_scheduler/post_task.h" |
| 17 #include "base/threading/sequenced_worker_pool.h" | |
| 18 #include "base/time/default_clock.h" | 17 #include "base/time/default_clock.h" |
| 19 #include "base/time/default_tick_clock.h" | 18 #include "base/time/default_tick_clock.h" |
| 20 #include "base/tracked_objects.h" | 19 #include "base/tracked_objects.h" |
| 21 #include "components/component_updater/component_updater_service.h" | 20 #include "components/component_updater/component_updater_service.h" |
| 22 #include "components/gcm_driver/gcm_client_factory.h" | 21 #include "components/gcm_driver/gcm_client_factory.h" |
| 23 #include "components/gcm_driver/gcm_desktop_utils.h" | 22 #include "components/gcm_driver/gcm_desktop_utils.h" |
| 24 #include "components/gcm_driver/gcm_driver.h" | 23 #include "components/gcm_driver/gcm_driver.h" |
| 25 #include "components/history/core/browser/history_service.h" | 24 #include "components/history/core/browser/history_service.h" |
| 26 #include "components/keyed_service/core/service_access_type.h" | 25 #include "components/keyed_service/core/service_access_type.h" |
| 27 #include "components/metrics/metrics_service.h" | 26 #include "components/metrics/metrics_service.h" |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 } | 344 } |
| 346 } | 345 } |
| 347 | 346 |
| 348 void ApplicationContextImpl::CreateGCMDriver() { | 347 void ApplicationContextImpl::CreateGCMDriver() { |
| 349 DCHECK(thread_checker_.CalledOnValidThread()); | 348 DCHECK(thread_checker_.CalledOnValidThread()); |
| 350 DCHECK(!gcm_driver_); | 349 DCHECK(!gcm_driver_); |
| 351 | 350 |
| 352 base::FilePath store_path; | 351 base::FilePath store_path; |
| 353 CHECK(PathService::Get(ios::DIR_GLOBAL_GCM_STORE, &store_path)); | 352 CHECK(PathService::Get(ios::DIR_GLOBAL_GCM_STORE, &store_path)); |
| 354 | 353 |
| 355 base::SequencedWorkerPool* worker_pool = web::WebThread::GetBlockingPool(); | |
| 356 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner( | 354 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner( |
| 357 worker_pool->GetSequencedTaskRunnerWithShutdownBehavior( | 355 base::CreateSequencedTaskRunnerWithTraits( |
| 358 worker_pool->GetSequenceToken(), | 356 {base::MayBlock(), base::TaskPriority::BACKGROUND, |
| 359 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)); | 357 base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN})); |
| 360 | 358 |
| 361 gcm_driver_ = gcm::CreateGCMDriverDesktop( | 359 gcm_driver_ = gcm::CreateGCMDriverDesktop( |
| 362 base::WrapUnique(new gcm::GCMClientFactory), GetLocalState(), store_path, | 360 base::WrapUnique(new gcm::GCMClientFactory), GetLocalState(), store_path, |
| 363 GetSystemURLRequestContext(), ::GetChannel(), | 361 GetSystemURLRequestContext(), ::GetChannel(), |
| 364 IOSChromeGCMProfileServiceFactory::GetProductCategoryForSubtypes(), | 362 IOSChromeGCMProfileServiceFactory::GetProductCategoryForSubtypes(), |
| 365 web::WebThread::GetTaskRunnerForThread(web::WebThread::UI), | 363 web::WebThread::GetTaskRunnerForThread(web::WebThread::UI), |
| 366 web::WebThread::GetTaskRunnerForThread(web::WebThread::IO), | 364 web::WebThread::GetTaskRunnerForThread(web::WebThread::IO), |
| 367 blocking_task_runner); | 365 blocking_task_runner); |
| 368 } | 366 } |
| OLD | NEW |