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

Unified Diff: chrome/renderer/media/chrome_key_systems.cc

Issue 23452025: Move EME key system knowledge from content/ to chrome/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test on Android Created 7 years, 3 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 | « chrome/renderer/media/chrome_key_systems.h ('k') | content/browser/media/encrypted_media_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/media/chrome_key_systems.cc
diff --git a/content/renderer/media/crypto/key_systems_info.cc b/chrome/renderer/media/chrome_key_systems.cc
similarity index 83%
copy from content/renderer/media/crypto/key_systems_info.cc
copy to chrome/renderer/media/chrome_key_systems.cc
index 0f0dccbf728c79b54e038b52ab33550eed4dfc6d..197969ca21d4de18804cc8c71658e990d4a188af 100644
--- a/content/renderer/media/crypto/key_systems_info.cc
+++ b/chrome/renderer/media/chrome_key_systems.cc
@@ -2,10 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/renderer/media/crypto/key_systems_info.h"
+#include "chrome/renderer/media/chrome_key_systems.h"
#include "base/logging.h"
-#include "third_party/WebKit/public/platform/WebString.h"
#include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
@@ -16,12 +15,7 @@
#include "base/version.h"
#endif
-#if defined(DISABLE_WIDEVINE_CDM_CANPLAYTYPE)
-#include "base/command_line.h"
-#include "media/base/media_switches.h"
-#endif
-
-namespace content {
+using content::KeySystemInfo;
static const char kClearKeyKeySystem[] = "webkit-org.w3.clearkey";
@@ -37,6 +31,8 @@ static const char kAvc1[] = "avc1";
static const char kMp4aAvc1[] = "mp4a,avc1";
#if defined(WIDEVINE_CDM_AVAILABLE)
+// Defines bitmask values used to specify supported codecs.
+// Each value represents a codec within a specific container.
enum SupportedCodecs {
WEBM_VP8_AND_VORBIS = 1 << 0,
#if defined(USE_PROPRIETARY_CODECS)
@@ -45,7 +41,7 @@ enum SupportedCodecs {
#endif // defined(USE_PROPRIETARY_CODECS)
};
-static void AddWidevineForTypes(
+static void AddWidevineWithCodecs(
SupportedCodecs supported_codecs,
std::vector<KeySystemInfo>* concrete_key_systems) {
static const char kWidevineParentKeySystem[] = "com.widevine";
@@ -105,7 +101,7 @@ static void AddPepperBasedWidevine(
#endif
#endif // defined(USE_PROPRIETARY_CODECS)
- AddWidevineForTypes(supported_codecs, concrete_key_systems);
+ AddWidevineWithCodecs(supported_codecs, concrete_key_systems);
}
#elif defined(OS_ANDROID)
static void AddAndroidWidevine(
@@ -158,7 +154,7 @@ static void AddExternalClearKey(
}
#endif // defined(ENABLE_PEPPER_CDMS)
-void AddKeySystems(std::vector<KeySystemInfo>* key_systems_info) {
+void AddChromeKeySystems(std::vector<KeySystemInfo>* key_systems_info) {
AddClearKey(key_systems_info);
#if defined(ENABLE_PEPPER_CDMS)
@@ -173,26 +169,3 @@ void AddKeySystems(std::vector<KeySystemInfo>* key_systems_info) {
#endif
#endif
}
-
-bool IsCanPlayTypeSuppressed(const std::string& key_system) {
-#if defined(DISABLE_WIDEVINE_CDM_CANPLAYTYPE)
- // See http://crbug.com/237627.
- if (key_system == kWidevineKeySystem &&
- !CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kOverrideEncryptedMediaCanPlayType))
- return true;
-#endif
- return false;
-}
-
-std::string KeySystemNameForUMAInternal(const WebKit::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";
-}
-
-} // namespace content
« no previous file with comments | « chrome/renderer/media/chrome_key_systems.h ('k') | content/browser/media/encrypted_media_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698