Chromium Code Reviews| Index: Source/modules/encryptedmedia/MediaKeySystemAccess.cpp |
| diff --git a/Source/modules/encryptedmedia/MediaKeySystemAccess.cpp b/Source/modules/encryptedmedia/MediaKeySystemAccess.cpp |
| index 2d85bfa2f313c578906a02904df0d26abf350a80..fb2c4d3a915a457325c4f2705bd881ed128ec8a5 100644 |
| --- a/Source/modules/encryptedmedia/MediaKeySystemAccess.cpp |
| +++ b/Source/modules/encryptedmedia/MediaKeySystemAccess.cpp |
| @@ -32,9 +32,10 @@ class NewCdmResultPromise : public ContentDecryptionModuleResultPromise { |
| WTF_MAKE_NONCOPYABLE(NewCdmResultPromise); |
| public: |
| - NewCdmResultPromise(ScriptState* scriptState, const String& keySystem) |
| + NewCdmResultPromise(ScriptState* scriptState, const String& keySystem, const blink::WebVector<blink::WebString>& supportedSessionTypes) |
| : ContentDecryptionModuleResultPromise(scriptState) |
| , m_keySystem(keySystem) |
| + , m_supportedSessionTypes(supportedSessionTypes) |
| { |
| } |
| @@ -45,16 +46,17 @@ public: |
| // ContentDecryptionModuleResult implementation. |
| virtual void completeWithContentDecryptionModule(WebContentDecryptionModule* cdm) override |
| { |
| - // NOTE: Continued from step 2. of createMediaKeys(). |
| - // 2.4 Let media keys be a new MediaKeys object. |
| - MediaKeys* mediaKeys = new MediaKeys(executionContext(), m_keySystem, adoptPtr(cdm)); |
| + // NOTE: Continued from step 2.8 of createMediaKeys(). |
| + // 2.9. Let media keys be a new MediaKeys object. |
| + MediaKeys* mediaKeys = new MediaKeys(executionContext(), m_keySystem, m_supportedSessionTypes, adoptPtr(cdm)); |
| - // 2.5 Resolve promise with media keys. |
| + // 2.10. Resolve promise with media keys. |
| resolve(mediaKeys); |
| } |
| private: |
| const String m_keySystem; |
| + const blink::WebVector<blink::WebString> m_supportedSessionTypes; |
| }; |
| // These methods are the inverses of those with the same names in |
| @@ -120,10 +122,17 @@ void MediaKeySystemAccess::getConfiguration(MediaKeySystemConfiguration& result) |
| ScriptPromise MediaKeySystemAccess::createMediaKeys(ScriptState* scriptState) |
| { |
| - // From https://dvcs.w3.org/hg/html-media/raw-file/default/encrypted-media/encrypted-media.html#widl-MediaKeySystemAccess-createMediaKeys-Promise-MediaKeys |
| - // When this method is invoked, the user agent must run the following steps: |
| + // From http://w3c.github.io/encrypted-media/#createMediaKeys |
| + // (Reordered to be able to pass values into the promise constructor.) |
| + // 2.4 Let configuration be the value of this object's configuration value. |
| + // 2.5, 2.6 Set use distinctive identifer from configuration's |
|
ddorwin
2015/02/20 04:01:50
identifier
sandersd (OOO until July 31)
2015/02/20 04:04:25
Done.
|
| + // distinctiveIdentifier. |
|
ddorwin
2015/02/20 04:01:50
This seems to be paraphrasing.
sandersd (OOO until July 31)
2015/02/20 04:04:25
Added square brackets.
|
| + // (skipped, distinctiveIdentifier is not passed to CDM.) |
| + // 2.7, 2.8 Set use persistent state from configuration's persistentState. |
|
ddorwin
2015/02/20 04:01:50
(Represented by sessionTypes.)
ddorwin
2015/02/20 04:01:50
ditto
sandersd (OOO until July 31)
2015/02/20 04:04:24
Acknowledged.
sandersd (OOO until July 31)
2015/02/20 04:04:24
Acknowledged.
|
| + WebMediaKeySystemConfiguration configuration = m_access->getConfiguration(); |
| + |
| // 1. Let promise be a new promise. |
| - NewCdmResultPromise* helper = new NewCdmResultPromise(scriptState, m_keySystem); |
| + NewCdmResultPromise* helper = new NewCdmResultPromise(scriptState, m_keySystem, configuration.sessionTypes); |
| ScriptPromise promise = helper->promise(); |
| // 2. Asynchronously create and initialize the MediaKeys object. |