| 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/component_updater/widevine_cdm_component_installer.h" | 5 #include "chrome/browser/component_updater/widevine_cdm_component_installer.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/base_paths.h" | 12 #include "base/base_paths.h" |
| 13 #include "base/bind.h" | 13 #include "base/bind.h" |
| 14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 15 #include "base/file_util.h" | 15 #include "base/file_util.h" |
| 16 #include "base/files/file_path.h" | 16 #include "base/files/file_path.h" |
| 17 #include "base/logging.h" | 17 #include "base/logging.h" |
| 18 #include "base/path_service.h" | 18 #include "base/path_service.h" |
| 19 #include "base/strings/string16.h" | 19 #include "base/strings/string16.h" |
| 20 #include "base/strings/string_number_conversions.h" | 20 #include "base/strings/string_number_conversions.h" |
| 21 #include "base/strings/string_split.h" | 21 #include "base/strings/string_split.h" |
| 22 #include "base/strings/utf_string_conversions.h" | 22 #include "base/strings/utf_string_conversions.h" |
| 23 #include "base/threading/sequenced_worker_pool.h" |
| 23 #include "base/values.h" | 24 #include "base/values.h" |
| 24 #include "build/build_config.h" | 25 #include "build/build_config.h" |
| 25 #include "chrome/browser/component_updater/component_updater_service.h" | 26 #include "chrome/browser/component_updater/component_updater_service.h" |
| 26 #include "chrome/browser/component_updater/default_component_installer.h" | 27 #include "chrome/browser/component_updater/default_component_installer.h" |
| 27 #include "chrome/common/chrome_paths.h" | 28 #include "chrome/common/chrome_paths.h" |
| 28 #include "chrome/common/chrome_version_info.h" | 29 #include "chrome/common/chrome_version_info.h" |
| 29 #include "chrome/common/widevine_cdm_constants.h" | 30 #include "chrome/common/widevine_cdm_constants.h" |
| 30 #include "content/public/browser/browser_thread.h" | 31 #include "content/public/browser/browser_thread.h" |
| 31 #include "content/public/browser/plugin_service.h" | 32 #include "content/public/browser/plugin_service.h" |
| 32 #include "content/public/common/pepper_plugin_info.h" | 33 #include "content/public/common/pepper_plugin_info.h" |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 | 357 |
| 357 void RegisterWidevineCdmComponent(ComponentUpdateService* cus) { | 358 void RegisterWidevineCdmComponent(ComponentUpdateService* cus) { |
| 358 #if defined(WIDEVINE_CDM_AVAILABLE) && defined(WIDEVINE_CDM_IS_COMPONENT) | 359 #if defined(WIDEVINE_CDM_AVAILABLE) && defined(WIDEVINE_CDM_IS_COMPONENT) |
| 359 base::FilePath adapter_source_path; | 360 base::FilePath adapter_source_path; |
| 360 PathService::Get(chrome::FILE_WIDEVINE_CDM_ADAPTER, &adapter_source_path); | 361 PathService::Get(chrome::FILE_WIDEVINE_CDM_ADAPTER, &adapter_source_path); |
| 361 if (!base::PathExists(adapter_source_path)) | 362 if (!base::PathExists(adapter_source_path)) |
| 362 return; | 363 return; |
| 363 scoped_ptr<ComponentInstallerTraits> traits( | 364 scoped_ptr<ComponentInstallerTraits> traits( |
| 364 new WidevineCdmComponentInstallerTraits); | 365 new WidevineCdmComponentInstallerTraits); |
| 365 // |cus| will take ownership of |installer| during installer->Register(cus). | 366 // |cus| will take ownership of |installer| during installer->Register(cus). |
| 366 DefaultComponentInstaller* installer = | 367 DefaultComponentInstaller* installer = new DefaultComponentInstaller( |
| 367 new DefaultComponentInstaller(traits.Pass()); | 368 traits.Pass(), |
| 369 content::BrowserThread::GetBlockingPool() |
| 370 ->GetSequencedTaskRunnerWithShutdownBehavior( |
| 371 content::BrowserThread::GetBlockingPool()->GetSequenceToken(), |
| 372 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)); |
| 368 installer->Register(cus); | 373 installer->Register(cus); |
| 369 #else | 374 #else |
| 370 return; | 375 return; |
| 371 #endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(WIDEVINE_CDM_IS_COMPONENT) | 376 #endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(WIDEVINE_CDM_IS_COMPONENT) |
| 372 } | 377 } |
| 373 | 378 |
| 374 } // namespace component_updater | 379 } // namespace component_updater |
| OLD | NEW |