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

Unified Diff: Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp

Issue 759443005: Replace MediaKeySystemOptions with MediaKeySystemConfiguration. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update Created 6 years, 1 month 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
Index: Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp
diff --git a/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp b/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp
index bf70b65ea3c0524302ae8e3784ea3e6a1044f0c6..6fc6e6e84f0697ce5d7016093f9f3b4181b9e41b 100644
--- a/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp
+++ b/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp
@@ -32,19 +32,19 @@ class MediaKeySystemAccessInitializer final : public blink::ScriptPromiseResolve
WTF_MAKE_NONCOPYABLE(MediaKeySystemAccessInitializer);
public:
- static blink::ScriptPromise create(blink::ScriptState*, const String& keySystem, const Vector<blink::MediaKeySystemOptions>& supportedConfigurations);
+ static blink::ScriptPromise create(blink::ScriptState*, const String& keySystem, const Vector<blink::MediaKeySystemConfiguration>& supportedConfigurations);
virtual ~MediaKeySystemAccessInitializer();
private:
- MediaKeySystemAccessInitializer(blink::ScriptState*, const String& keySystem, const Vector<blink::MediaKeySystemOptions>& supportedConfigurations);
+ MediaKeySystemAccessInitializer(blink::ScriptState*, const String& keySystem, const Vector<blink::MediaKeySystemConfiguration>& supportedConfigurations);
void timerFired(blink::Timer<MediaKeySystemAccessInitializer>*);
const String m_keySystem;
- const Vector<blink::MediaKeySystemOptions> m_supportedConfigurations;
+ const Vector<blink::MediaKeySystemConfiguration> m_supportedConfigurations;
blink::Timer<MediaKeySystemAccessInitializer> m_timer;
};
-blink::ScriptPromise MediaKeySystemAccessInitializer::create(blink::ScriptState* scriptState, const String& keySystem, const Vector<blink::MediaKeySystemOptions>& supportedConfigurations)
+blink::ScriptPromise MediaKeySystemAccessInitializer::create(blink::ScriptState* scriptState, const String& keySystem, const Vector<blink::MediaKeySystemConfiguration>& supportedConfigurations)
{
RefPtr<MediaKeySystemAccessInitializer> initializer = adoptRef(new MediaKeySystemAccessInitializer(scriptState, keySystem, supportedConfigurations));
initializer->suspendIfNeeded();
@@ -52,7 +52,7 @@ blink::ScriptPromise MediaKeySystemAccessInitializer::create(blink::ScriptState*
return initializer->promise();
}
-MediaKeySystemAccessInitializer::MediaKeySystemAccessInitializer(blink::ScriptState* scriptState, const String& keySystem, const Vector<blink::MediaKeySystemOptions>& supportedConfigurations)
+MediaKeySystemAccessInitializer::MediaKeySystemAccessInitializer(blink::ScriptState* scriptState, const String& keySystem, const Vector<blink::MediaKeySystemConfiguration>& supportedConfigurations)
: blink::ScriptPromiseResolver(scriptState)
, m_keySystem(keySystem)
, m_supportedConfigurations(supportedConfigurations)
@@ -104,15 +104,17 @@ void MediaKeySystemAccessInitializer::timerFired(blink::Timer<MediaKeySystemAcce
// following steps:
// FIXME: This test needs to be enhanced to use more values from
// combination.
- if (isKeySystemSupportedWithContentType(m_keySystem, combination.initDataType())) {
- // 5.3.3.1 Let access be a new MediaKeySystemAccess object, and
- // initialize it as follows:
- // 5.3.3.1.1 Set the keySystem attribute to keySystem.
- blink::MediaKeySystemAccess* access = new blink::MediaKeySystemAccess(m_keySystem);
-
- // 5.3.3.2 Resolve promise with access and abort these steps.
- resolve(access);
- return;
+ for (const auto& initDataType : combination.initDataTypes()) {
+ if (isKeySystemSupportedWithContentType(m_keySystem, initDataType)) {
+ // 5.3.3.1 Let access be a new MediaKeySystemAccess object, and
+ // initialize it as follows:
+ // 5.3.3.1.1 Set the keySystem attribute to keySystem.
+ blink::MediaKeySystemAccess* access = new blink::MediaKeySystemAccess(m_keySystem);
+
+ // 5.3.3.2 Resolve promise with access and abort these steps.
+ resolve(access);
+ return;
+ }
}
}
@@ -163,14 +165,14 @@ ScriptPromise NavigatorRequestMediaKeySystemAccess::requestMediaKeySystemAccess(
// (no supportedConfigurations provided.)
// Remainder of steps handled in common routine below.
- return NavigatorRequestMediaKeySystemAccess::from(navigator).requestMediaKeySystemAccess(scriptState, keySystem, Vector<MediaKeySystemOptions>());
+ return NavigatorRequestMediaKeySystemAccess::from(navigator).requestMediaKeySystemAccess(scriptState, keySystem, Vector<MediaKeySystemConfiguration>());
}
ScriptPromise NavigatorRequestMediaKeySystemAccess::requestMediaKeySystemAccess(
ScriptState* scriptState,
Navigator& navigator,
const String& keySystem,
- const Vector<MediaKeySystemOptions>& supportedConfigurations)
+ const Vector<MediaKeySystemConfiguration>& supportedConfigurations)
{
// From https://dvcs.w3.org/hg/html-media/raw-file/default/encrypted-media/encrypted-media.html#requestmediakeysystemaccess
// When this method is invoked, the user agent must run the following steps:
@@ -197,7 +199,7 @@ ScriptPromise NavigatorRequestMediaKeySystemAccess::requestMediaKeySystemAccess(
ScriptPromise NavigatorRequestMediaKeySystemAccess::requestMediaKeySystemAccess(
ScriptState* scriptState,
const String& keySystem,
- const Vector<MediaKeySystemOptions>& supportedConfigurations)
+ const Vector<MediaKeySystemConfiguration>& supportedConfigurations)
{
// Continued from above.
// 3. If keySystem is not one of the Key Systems supported by the user

Powered by Google App Engine
This is Rietveld 408576698