Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Unified Diff: content/renderer/media/crypto/key_systems.cc

Issue 170783010: Encrypted Media: Handle blink::WebString in WebMediaPlayer*. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase only Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/media/crypto/key_systems.h ('k') | content/renderer/media/crypto/key_systems_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/crypto/key_systems.cc
diff --git a/content/renderer/media/crypto/key_systems.cc b/content/renderer/media/crypto/key_systems.cc
index ac3f4aaca4161626ff25db8489062450350c4f03..fae01aaaf31b7ab8467344248e28104d6585072b 100644
--- a/content/renderer/media/crypto/key_systems.cc
+++ b/content/renderer/media/crypto/key_systems.cc
@@ -15,8 +15,6 @@
#include "content/public/renderer/key_system_info.h"
#include "content/renderer/media/crypto/key_systems_support_uma.h"
#include "net/base/mime_util.h"
-#include "third_party/WebKit/public/platform/WebCString.h"
-#include "third_party/WebKit/public/platform/WebString.h"
#include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
@@ -36,23 +34,6 @@ const char kMp4a[] = "mp4a";
const char kMp4aAvc1Avc3[] = "mp4a,avc1,avc3";
#endif // defined(USE_PROPRIETARY_CODECS)
-inline std::string KeySystemNameForUMAInternal(
- const blink::WebString& key_system) {
- if (key_system == kClearKeyKeySystem)
- return "ClearKey";
-#if defined(WIDEVINE_CDM_AVAILABLE)
- if (key_system == kWidevineKeySystem)
- return "Widevine";
-#endif // WIDEVINE_CDM_AVAILABLE
- return "Unknown";
-}
-
-// Convert a WebString to ASCII, falling back on an empty string in the case
-// of a non-ASCII string.
-static std::string ToASCIIOrEmpty(const blink::WebString& string) {
- return IsStringASCII(string) ? UTF16ToASCII(string) : std::string();
-}
-
static void AddClearKey(std::vector<KeySystemInfo>* concrete_key_systems) {
KeySystemInfo info(kClearKeyKeySystem);
@@ -352,9 +333,8 @@ std::vector<uint8> KeySystems::GetUUID(const std::string& concrete_key_system) {
//------------------------------------------------------------------------------
-bool IsConcreteSupportedKeySystem(const blink::WebString& key_system) {
- return KeySystems::GetInstance().IsConcreteSupportedKeySystem(
- ToASCIIOrEmpty(key_system));
+bool IsConcreteSupportedKeySystem(const std::string& key_system) {
+ return KeySystems::GetInstance().IsConcreteSupportedKeySystem(key_system);
}
bool IsSupportedKeySystemWithMediaMimeType(
@@ -365,12 +345,14 @@ bool IsSupportedKeySystemWithMediaMimeType(
mime_type, codecs, key_system);
}
-std::string KeySystemNameForUMA(const blink::WebString& key_system) {
- return KeySystemNameForUMAInternal(key_system);
-}
-
std::string KeySystemNameForUMA(const std::string& key_system) {
- return KeySystemNameForUMAInternal(blink::WebString::fromUTF8(key_system));
+ if (key_system == kClearKeyKeySystem)
+ return "ClearKey";
+#if defined(WIDEVINE_CDM_AVAILABLE)
+ if (key_system == kWidevineKeySystem)
+ return "Widevine";
+#endif // WIDEVINE_CDM_AVAILABLE
+ return "Unknown";
}
bool CanUseAesDecryptor(const std::string& concrete_key_system) {
« no previous file with comments | « content/renderer/media/crypto/key_systems.h ('k') | content/renderer/media/crypto/key_systems_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698