Chromium Code Reviews| 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 "components/cdm/renderer/widevine_key_systems.h" | 5 #include "components/cdm/renderer/widevine_key_systems.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "components/cdm/common/cdm_messages_android.h" | 11 #include "components/cdm/common/cdm_messages_android.h" |
| 12 #include "content/public/renderer/key_system_info.h" | 12 #include "content/public/renderer/key_system_info.h" |
| 13 #include "content/public/renderer/render_thread.h" | 13 #include "content/public/renderer/render_thread.h" |
| 14 | 14 |
| 15 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. | 15 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. |
| 16 | 16 |
| 17 #if defined(WIDEVINE_CDM_AVAILABLE) | 17 #if defined(WIDEVINE_CDM_AVAILABLE) |
| 18 | 18 |
| 19 using content::KeySystemInfo; | 19 using content::KeySystemInfo; |
| 20 using content::SupportedCodecs; | 20 using content::SupportedCodecs; |
| 21 | 21 |
| 22 namespace cdm { | 22 namespace cdm { |
| 23 | 23 |
| 24 // Return |name|'s parent key system. | 24 // Return |name|'s parent key system. |
| 25 static std::string GetDirectParentName(std::string name) { | 25 static std::string GetDirectParentName(std::string name) { |
| 26 int last_period = name.find_last_of('.'); | 26 size_t last_period = name.find_last_of('.'); |
| 27 DCHECK_GT(last_period, 0); | 27 DCHECK_GT(last_period, 0); |
|
xhwang
2014/05/09 23:59:22
s/0/0u?
ycheo (away)
2014/05/10 00:03:45
Hmm. actually, size_t is unsigned.
Isn't it better
| |
| 28 return name.substr(0, last_period); | 28 return name.substr(0, last_period); |
| 29 } | 29 } |
| 30 | 30 |
| 31 void AddWidevineWithCodecs(WidevineCdmType widevine_cdm_type, | 31 void AddWidevineWithCodecs(WidevineCdmType widevine_cdm_type, |
| 32 SupportedCodecs supported_codecs, | 32 SupportedCodecs supported_codecs, |
| 33 std::vector<KeySystemInfo>* concrete_key_systems) { | 33 std::vector<KeySystemInfo>* concrete_key_systems) { |
| 34 KeySystemInfo info(kWidevineKeySystem); | 34 KeySystemInfo info(kWidevineKeySystem); |
| 35 | 35 |
| 36 switch (widevine_cdm_type) { | 36 switch (widevine_cdm_type) { |
| 37 case WIDEVINE: | 37 case WIDEVINE: |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 84 WIDEVINE_HR_NON_COMPOSITING, | 84 WIDEVINE_HR_NON_COMPOSITING, |
| 85 static_cast<SupportedCodecs>(response.non_compositing_codecs), | 85 static_cast<SupportedCodecs>(response.non_compositing_codecs), |
| 86 concrete_key_systems); | 86 concrete_key_systems); |
| 87 } | 87 } |
| 88 } | 88 } |
| 89 #endif // OS_ANDROID | 89 #endif // OS_ANDROID |
| 90 | 90 |
| 91 } // namespace cdm | 91 } // namespace cdm |
| 92 | 92 |
| 93 #endif // defined(WIDEVINE_CDM_AVAILABLE) | 93 #endif // defined(WIDEVINE_CDM_AVAILABLE) |
| OLD | NEW |