| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/common/chrome_content_client.h" | 5 #include "chrome/common/chrome_content_client.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <tuple> | 10 #include <tuple> |
| 11 | 11 |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/debug/crash_logging.h" | 13 #include "base/debug/crash_logging.h" |
| 14 #include "base/files/file_util.h" | 14 #include "base/files/file_util.h" |
| 15 #include "base/json/json_reader.h" | 15 #include "base/json/json_reader.h" |
| 16 #include "base/memory/scoped_vector.h" | 16 #include "base/memory/scoped_vector.h" |
| 17 #include "base/native_library.h" |
| 17 #include "base/path_service.h" | 18 #include "base/path_service.h" |
| 18 #include "base/strings/string16.h" | 19 #include "base/strings/string16.h" |
| 19 #include "base/strings/string_number_conversions.h" | 20 #include "base/strings/string_number_conversions.h" |
| 20 #include "base/strings/string_split.h" | 21 #include "base/strings/string_split.h" |
| 21 #include "base/strings/string_util.h" | 22 #include "base/strings/string_util.h" |
| 22 #include "base/strings/stringprintf.h" | 23 #include "base/strings/stringprintf.h" |
| 23 #include "base/strings/utf_string_conversions.h" | 24 #include "base/strings/utf_string_conversions.h" |
| 24 #include "build/build_config.h" | 25 #include "build/build_config.h" |
| 25 #include "chrome/common/child_process_logging.h" | 26 #include "chrome/common/child_process_logging.h" |
| 26 #include "chrome/common/chrome_constants.h" | 27 #include "chrome/common/chrome_constants.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 base::FilePath* cdm_path, | 111 base::FilePath* cdm_path, |
| 111 std::vector<std::string>* codecs_supported) { | 112 std::vector<std::string>* codecs_supported) { |
| 112 static enum { | 113 static enum { |
| 113 NOT_CHECKED, | 114 NOT_CHECKED, |
| 114 FOUND, | 115 FOUND, |
| 115 NOT_FOUND, | 116 NOT_FOUND, |
| 116 } widevine_cdm_file_check = NOT_CHECKED; | 117 } widevine_cdm_file_check = NOT_CHECKED; |
| 117 // TODO(jrummell): We should add a new path for DIR_WIDEVINE_CDM and use that | 118 // TODO(jrummell): We should add a new path for DIR_WIDEVINE_CDM and use that |
| 118 // to locate the CDM and the CDM adapter. | 119 // to locate the CDM and the CDM adapter. |
| 119 if (PathService::Get(chrome::FILE_WIDEVINE_CDM_ADAPTER, adapter_path)) { | 120 if (PathService::Get(chrome::FILE_WIDEVINE_CDM_ADAPTER, adapter_path)) { |
| 120 *cdm_path = adapter_path->DirName().AppendASCII(kWidevineCdmFileName); | 121 *cdm_path = adapter_path->DirName().AppendASCII( |
| 122 base::GetNativeLibraryName(kWidevineCdmLibraryName)); |
| 121 if (widevine_cdm_file_check == NOT_CHECKED) { | 123 if (widevine_cdm_file_check == NOT_CHECKED) { |
| 122 widevine_cdm_file_check = | 124 widevine_cdm_file_check = |
| 123 (base::PathExists(*adapter_path) && base::PathExists(*cdm_path)) | 125 (base::PathExists(*adapter_path) && base::PathExists(*cdm_path)) |
| 124 ? FOUND | 126 ? FOUND |
| 125 : NOT_FOUND; | 127 : NOT_FOUND; |
| 126 } | 128 } |
| 127 if (widevine_cdm_file_check == FOUND) { | 129 if (widevine_cdm_file_check == FOUND) { |
| 128 // Add the supported codecs as if they came from the component manifest. | 130 // Add the supported codecs as if they came from the component manifest. |
| 129 // This list must match the CDM that is being bundled with Chrome. | 131 // This list must match the CDM that is being bundled with Chrome. |
| 130 codecs_supported->push_back(kCdmSupportedCodecVp8); | 132 codecs_supported->push_back(kCdmSupportedCodecVp8); |
| (...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 | 702 |
| 701 base::StringPiece ChromeContentClient::GetOriginTrialPublicKey() { | 703 base::StringPiece ChromeContentClient::GetOriginTrialPublicKey() { |
| 702 return origin_trial_key_manager_.GetPublicKey(); | 704 return origin_trial_key_manager_.GetPublicKey(); |
| 703 } | 705 } |
| 704 | 706 |
| 705 #if defined(OS_ANDROID) | 707 #if defined(OS_ANDROID) |
| 706 media::MediaClientAndroid* ChromeContentClient::GetMediaClientAndroid() { | 708 media::MediaClientAndroid* ChromeContentClient::GetMediaClientAndroid() { |
| 707 return new ChromeMediaClientAndroid(); | 709 return new ChromeMediaClientAndroid(); |
| 708 } | 710 } |
| 709 #endif // OS_ANDROID | 711 #endif // OS_ANDROID |
| OLD | NEW |