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..e0d261170cb4a6e8feece7826247a9ce559b872d 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 WebMediaKeySystemConfiguration& configuration) |
|
ddorwin
2015/02/20 03:42:00
We should just pass the supportedSessionTypes vect
|
| : ContentDecryptionModuleResultPromise(scriptState) |
| , m_keySystem(keySystem) |
| + , m_configuration(configuration) |
| { |
| } |
| @@ -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_configuration, adoptPtr(cdm)); |
| - // 2.5 Resolve promise with media keys. |
| + // 2.10. Resolve promise with media keys. |
| resolve(mediaKeys); |
| } |
| private: |
| const String m_keySystem; |
| + const WebMediaKeySystemConfiguration m_configuration; |
| }; |
| // 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 |
| + // distinctiveIdentifier. |
| + // (skipped, distinctiveIdentifier is not passed to CDM.) |
| + // 2.7, 2.8 Set use persistent state from configuration's persistentState. |
| + 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); |
| ScriptPromise promise = helper->promise(); |
| // 2. Asynchronously create and initialize the MediaKeys object. |