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/component_updater/widevine_cdm_component_installer.h" | 5 #include "chrome/browser/component_updater/widevine_cdm_component_installer.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 25 #include "build/build_config.h" | 25 #include "build/build_config.h" |
| 26 #include "chrome/common/chrome_paths.h" | 26 #include "chrome/common/chrome_paths.h" |
| 27 #include "chrome/common/chrome_version_info.h" | 27 #include "chrome/common/chrome_version_info.h" |
| 28 #include "chrome/common/widevine_cdm_constants.h" | 28 #include "chrome/common/widevine_cdm_constants.h" |
| 29 #include "components/component_updater/component_updater_service.h" | 29 #include "components/component_updater/component_updater_service.h" |
| 30 #include "components/component_updater/default_component_installer.h" | 30 #include "components/component_updater/default_component_installer.h" |
| 31 #include "content/public/browser/browser_thread.h" | 31 #include "content/public/browser/browser_thread.h" |
| 32 #include "content/public/browser/plugin_service.h" | 32 #include "content/public/browser/plugin_service.h" |
| 33 #include "content/public/common/pepper_plugin_info.h" | 33 #include "content/public/common/pepper_plugin_info.h" |
| 34 #include "media/cdm/ppapi/supported_cdm_versions.h" | 34 #include "media/cdm/ppapi/supported_cdm_versions.h" |
| 35 #include "third_party/widevine/cdm/widevine_cdm_common.h" | 35 #include "third_party/widevine/cdm/widevine_cdm_common.h" |
|
ddorwin
2014/12/02 23:31:56
We shouldn't need this in most places - it's inclu
| |
| 36 | 36 |
| 37 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. NOLINT | 37 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. NOLINT |
|
ddorwin
2014/12/02 23:31:56
We should be able to eliminate many, if not most,
| |
| 38 | 38 |
| 39 using content::BrowserThread; | 39 using content::BrowserThread; |
| 40 using content::PluginService; | 40 using content::PluginService; |
| 41 | 41 |
| 42 namespace component_updater { | 42 namespace component_updater { |
| 43 | 43 |
| 44 #if defined(WIDEVINE_CDM_AVAILABLE) && defined(WIDEVINE_CDM_IS_COMPONENT) | 44 #if defined(ENABLE_WIDEVINE) && defined(WIDEVINE_CDM_IS_COMPONENT) |
| 45 | 45 |
| 46 namespace { | 46 namespace { |
| 47 | 47 |
| 48 // CRX hash. The extension id is: oimompecagnajdejgnnjijobebaeigek. | 48 // CRX hash. The extension id is: oimompecagnajdejgnnjijobebaeigek. |
| 49 const uint8_t kSha2Hash[] = {0xe8, 0xce, 0xcf, 0x42, 0x06, 0xd0, 0x93, 0x49, | 49 const uint8_t kSha2Hash[] = {0xe8, 0xce, 0xcf, 0x42, 0x06, 0xd0, 0x93, 0x49, |
| 50 0x6d, 0xd9, 0x89, 0xe1, 0x41, 0x04, 0x86, 0x4a, | 50 0x6d, 0xd9, 0x89, 0xe1, 0x41, 0x04, 0x86, 0x4a, |
| 51 0x8f, 0xbd, 0x86, 0x12, 0xb9, 0x58, 0x9b, 0xfb, | 51 0x8f, 0xbd, 0x86, 0x12, 0xb9, 0x58, 0x9b, 0xfb, |
| 52 0x4f, 0xbb, 0x1b, 0xa9, 0xd3, 0x85, 0x37, 0xef}; | 52 0x4f, 0xbb, 0x1b, 0xa9, 0xd3, 0x85, 0x37, 0xef}; |
| 53 | 53 |
| 54 // File name of the Widevine CDM component manifest on different platforms. | 54 // File name of the Widevine CDM component manifest on different platforms. |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 354 } | 354 } |
| 355 | 355 |
| 356 BrowserThread::PostTask(content::BrowserThread::UI, | 356 BrowserThread::PostTask(content::BrowserThread::UI, |
| 357 FROM_HERE, | 357 FROM_HERE, |
| 358 base::Bind(&RegisterWidevineCdmWithChrome, | 358 base::Bind(&RegisterWidevineCdmWithChrome, |
| 359 cdm_version, | 359 cdm_version, |
| 360 adapter_install_path, | 360 adapter_install_path, |
| 361 base::Passed(&manifest))); | 361 base::Passed(&manifest))); |
| 362 } | 362 } |
| 363 | 363 |
| 364 #endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(WIDEVINE_CDM_IS_COMPONENT) | 364 #endif // defined(ENABLE_WIDEVINE) && defined(WIDEVINE_CDM_IS_COMPONENT) |
| 365 | 365 |
| 366 void RegisterWidevineCdmComponent(ComponentUpdateService* cus) { | 366 void RegisterWidevineCdmComponent(ComponentUpdateService* cus) { |
| 367 #if defined(WIDEVINE_CDM_AVAILABLE) && defined(WIDEVINE_CDM_IS_COMPONENT) | 367 #if defined(ENABLE_WIDEVINE) && defined(WIDEVINE_CDM_IS_COMPONENT) |
| 368 base::FilePath adapter_source_path; | 368 base::FilePath adapter_source_path; |
| 369 PathService::Get(chrome::FILE_WIDEVINE_CDM_ADAPTER, &adapter_source_path); | 369 PathService::Get(chrome::FILE_WIDEVINE_CDM_ADAPTER, &adapter_source_path); |
| 370 if (!base::PathExists(adapter_source_path)) | 370 if (!base::PathExists(adapter_source_path)) |
| 371 return; | 371 return; |
| 372 scoped_ptr<ComponentInstallerTraits> traits( | 372 scoped_ptr<ComponentInstallerTraits> traits( |
| 373 new WidevineCdmComponentInstallerTraits); | 373 new WidevineCdmComponentInstallerTraits); |
| 374 // |cus| will take ownership of |installer| during installer->Register(cus). | 374 // |cus| will take ownership of |installer| during installer->Register(cus). |
| 375 DefaultComponentInstaller* installer = | 375 DefaultComponentInstaller* installer = |
| 376 new DefaultComponentInstaller(traits.Pass()); | 376 new DefaultComponentInstaller(traits.Pass()); |
| 377 installer->Register(cus); | 377 installer->Register(cus); |
| 378 #else | 378 #else |
| 379 return; | 379 return; |
| 380 #endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(WIDEVINE_CDM_IS_COMPONENT) | 380 #endif // defined(ENABLE_WIDEVINE) && defined(WIDEVINE_CDM_IS_COMPONENT) |
| 381 } | 381 } |
| 382 | 382 |
| 383 } // namespace component_updater | 383 } // namespace component_updater |
| OLD | NEW |