<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[206984] trunk/Source/WebCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/206984">206984</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2016-10-09 23:54:21 -0700 (Sun, 09 Oct 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Move encrypted media from legacy to new DOM exceptions
https://bugs.webkit.org/show_bug.cgi?id=163194
Reviewed by Youenn Fablet.
* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::createSession): Take a reference instead of a pointer.
* Modules/encryptedmedia/CDM.h: Updated for above change.
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
(WebCore::WebKitMediaKeySession::create): Take a reference instead of a pointer.
(WebCore::WebKitMediaKeySession::MediaKeySession): Ditto.
(WebCore::WebKitMediaKeySession::~MediaKeySession): Removed unneeded code that
sets m_session to null.
(WebCore::WebKitMediaKeySession::keyRequestTimerFired): Use auto.
(WebCore::WebKitMediaKeySession::update): Use ExceptionOr.
(WebCore::WebKitMediaKeySession::addKeyTimerFired): Use m_keys directly instead
of calling the keys function.
(WebCore::WebKitMediaKeySession::sendError): Set m_error directly instead of
calling the setError function.
(WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory): Use auto.
(WebCore::WebKitMediaKeySession::hasPendingActivity): Check m_session directly
instead of writing !isClosed.
(WebCore::WebKitMediaKeySession::setError): Deleted.
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.h: Use pragma once. Removed
unneeded includes. Changed create to take a reference instead of a pointer.
Made most members and base classes private instead of public. Also removed
a few now-unneeded functions. Made everything that was formerly protected
private instead, since the two are the same in a final class.
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.idl: Removed unneeded comments.
Moved from MayThrowLegacyException to MayThrowException.
* Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
(WebCore::WebKitMediaKeys::create): Use ExceptionOr.
(WebCore::WebKitMediaKeys::MediaKeys): Made argument be an rvalue reference.
Also initialize m_mediaElement in the class definition.
(WebCore::WebKitMediaKeys::~MediaKeys): Call detachKeys instead of setKeys(nullptr).
(WebCore::WebKitMediaKeys::createSession): Use ExceptionOr. Also pass reference
insteead of pointer to create. Also removed unneeded separate checks for null
strings in code that already calls isEmpty.
(WebCore::WebKitMediaKeys::isTypeSupported): Removed unneeded checks for null strings
in code that already calls isEmpty.
(WebCore::WebKitMediaKeys::cdmMediaPlayer): Tweaked a bit.
(WebCore::WebKitMediaKeys::cachedKeyForKeyId): Use auto.
* Modules/encryptedmedia/legacy/WebKitMediaKeys.h: Use pragma once. Removed unneeded includes.
Changed cdm() function to return a reference. Initialize m_mediaElement.
Use private instead of protected.
* Modules/encryptedmedia/legacy/WebKitMediaKeys.idl: Use ConstructorMayThrowException
and MayThrowException instead of the legacy versions.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmediaCDMcpp">trunk/Source/WebCore/Modules/encryptedmedia/CDM.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmediaCDMh">trunk/Source/WebCore/Modules/encryptedmedia/CDM.h</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeySessioncpp">trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeySessionh">trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.h</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeySessionidl">trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeyscpp">trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeysh">trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeys.h</a></li>
<li><a href="#trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeysidl">trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeys.idl</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (206983 => 206984)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-10 06:21:52 UTC (rev 206983)
+++ trunk/Source/WebCore/ChangeLog        2016-10-10 06:54:21 UTC (rev 206984)
</span><span class="lines">@@ -1,3 +1,59 @@
</span><ins>+2016-10-09 Darin Adler <darin@apple.com>
+
+ Move encrypted media from legacy to new DOM exceptions
+ https://bugs.webkit.org/show_bug.cgi?id=163194
+
+ Reviewed by Youenn Fablet.
+
+ * Modules/encryptedmedia/CDM.cpp:
+ (WebCore::CDM::createSession): Take a reference instead of a pointer.
+ * Modules/encryptedmedia/CDM.h: Updated for above change.
+
+ * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
+ (WebCore::WebKitMediaKeySession::create): Take a reference instead of a pointer.
+ (WebCore::WebKitMediaKeySession::MediaKeySession): Ditto.
+ (WebCore::WebKitMediaKeySession::~MediaKeySession): Removed unneeded code that
+ sets m_session to null.
+ (WebCore::WebKitMediaKeySession::keyRequestTimerFired): Use auto.
+ (WebCore::WebKitMediaKeySession::update): Use ExceptionOr.
+ (WebCore::WebKitMediaKeySession::addKeyTimerFired): Use m_keys directly instead
+ of calling the keys function.
+ (WebCore::WebKitMediaKeySession::sendError): Set m_error directly instead of
+ calling the setError function.
+ (WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory): Use auto.
+ (WebCore::WebKitMediaKeySession::hasPendingActivity): Check m_session directly
+ instead of writing !isClosed.
+ (WebCore::WebKitMediaKeySession::setError): Deleted.
+
+ * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h: Use pragma once. Removed
+ unneeded includes. Changed create to take a reference instead of a pointer.
+ Made most members and base classes private instead of public. Also removed
+ a few now-unneeded functions. Made everything that was formerly protected
+ private instead, since the two are the same in a final class.
+
+ * Modules/encryptedmedia/legacy/WebKitMediaKeySession.idl: Removed unneeded comments.
+ Moved from MayThrowLegacyException to MayThrowException.
+
+ * Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
+ (WebCore::WebKitMediaKeys::create): Use ExceptionOr.
+ (WebCore::WebKitMediaKeys::MediaKeys): Made argument be an rvalue reference.
+ Also initialize m_mediaElement in the class definition.
+ (WebCore::WebKitMediaKeys::~MediaKeys): Call detachKeys instead of setKeys(nullptr).
+ (WebCore::WebKitMediaKeys::createSession): Use ExceptionOr. Also pass reference
+ insteead of pointer to create. Also removed unneeded separate checks for null
+ strings in code that already calls isEmpty.
+ (WebCore::WebKitMediaKeys::isTypeSupported): Removed unneeded checks for null strings
+ in code that already calls isEmpty.
+ (WebCore::WebKitMediaKeys::cdmMediaPlayer): Tweaked a bit.
+ (WebCore::WebKitMediaKeys::cachedKeyForKeyId): Use auto.
+
+ * Modules/encryptedmedia/legacy/WebKitMediaKeys.h: Use pragma once. Removed unneeded includes.
+ Changed cdm() function to return a reference. Initialize m_mediaElement.
+ Use private instead of protected.
+
+ * Modules/encryptedmedia/legacy/WebKitMediaKeys.idl: Use ConstructorMayThrowException
+ and MayThrowException instead of the legacy versions.
+
</ins><span class="cx"> 2016-10-09 Zan Dobersek <zdobersek@igalia.com>
</span><span class="cx">
</span><span class="cx"> ENABLE_LEGACY_ENCRYPTED_MEDIA interfaces should have a hard-coded WebKit prefix
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaCDMcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/encryptedmedia/CDM.cpp (206983 => 206984)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/CDM.cpp        2016-10-10 06:21:52 UTC (rev 206983)
+++ trunk/Source/WebCore/Modules/encryptedmedia/CDM.cpp        2016-10-10 06:54:21 UTC (rev 206984)
</span><span class="lines">@@ -131,9 +131,9 @@
</span><span class="cx"> return m_private->supportsMIMEType(mimeType);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-std::unique_ptr<CDMSession> CDM::createSession(CDMSessionClient* client)
</del><ins>+std::unique_ptr<CDMSession> CDM::createSession(CDMSessionClient& client)
</ins><span class="cx"> {
</span><del>- std::unique_ptr<CDMSession> session = m_private->createSession(client);
</del><ins>+ auto session = m_private->createSession(&client);
</ins><span class="cx"> if (mediaPlayer())
</span><span class="cx"> mediaPlayer()->setCDMSession(session.get());
</span><span class="cx"> return session;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmediaCDMh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/encryptedmedia/CDM.h (206983 => 206984)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/CDM.h        2016-10-10 06:21:52 UTC (rev 206983)
+++ trunk/Source/WebCore/Modules/encryptedmedia/CDM.h        2016-10-10 06:54:21 UTC (rev 206984)
</span><span class="lines">@@ -23,8 +23,7 @@
</span><span class="cx"> * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef CDM_h
-#define CDM_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(LEGACY_ENCRYPTED_MEDIA)
</span><span class="cx">
</span><span class="lines">@@ -62,7 +61,7 @@
</span><span class="cx"> ~CDM();
</span><span class="cx">
</span><span class="cx"> bool supportsMIMEType(const String&) const;
</span><del>- std::unique_ptr<CDMSession> createSession(CDMSessionClient*);
</del><ins>+ std::unique_ptr<CDMSession> createSession(CDMSessionClient&);
</ins><span class="cx">
</span><span class="cx"> const String& keySystem() const { return m_keySystem; }
</span><span class="cx">
</span><span class="lines">@@ -80,5 +79,3 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #endif // ENABLE(LEGACY_ENCRYPTED_MEDIA)
</span><del>-
-#endif // CDM_h
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeySessioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp (206983 => 206984)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp        2016-10-10 06:21:52 UTC (rev 206983)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp        2016-10-10 06:54:21 UTC (rev 206984)
</span><span class="lines">@@ -28,13 +28,10 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(LEGACY_ENCRYPTED_MEDIA)
</span><span class="cx">
</span><del>-#include "CDM.h"
-#include "CDMSession.h"
</del><span class="cx"> #include "Document.h"
</span><del>-#include "Event.h"
</del><span class="cx"> #include "EventNames.h"
</span><ins>+#include "ExceptionCode.h"
</ins><span class="cx"> #include "FileSystem.h"
</span><del>-#include "GenericEventQueue.h"
</del><span class="cx"> #include "Settings.h"
</span><span class="cx"> #include "WebKitMediaKeyError.h"
</span><span class="cx"> #include "WebKitMediaKeyMessageEvent.h"
</span><span class="lines">@@ -42,7 +39,7 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-Ref<WebKitMediaKeySession> WebKitMediaKeySession::create(ScriptExecutionContext& context, WebKitMediaKeys* keys, const String& keySystem)
</del><ins>+Ref<WebKitMediaKeySession> WebKitMediaKeySession::create(ScriptExecutionContext& context, WebKitMediaKeys& keys, const String& keySystem)
</ins><span class="cx"> {
</span><span class="cx"> auto session = adoptRef(*new WebKitMediaKeySession(context, keys, keySystem));
</span><span class="cx"> session->suspendIfNeeded();
</span><span class="lines">@@ -49,12 +46,12 @@
</span><span class="cx"> return session;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-WebKitMediaKeySession::WebKitMediaKeySession(ScriptExecutionContext& context, WebKitMediaKeys* keys, const String& keySystem)
</del><ins>+WebKitMediaKeySession::WebKitMediaKeySession(ScriptExecutionContext& context, WebKitMediaKeys& keys, const String& keySystem)
</ins><span class="cx"> : ActiveDOMObject(&context)
</span><del>- , m_keys(keys)
</del><ins>+ , m_keys(&keys)
</ins><span class="cx"> , m_keySystem(keySystem)
</span><span class="cx"> , m_asyncEventQueue(*this)
</span><del>- , m_session(keys->cdm()->createSession(this))
</del><ins>+ , m_session(keys.cdm().createSession(*this))
</ins><span class="cx"> , m_keyRequestTimer(*this, &WebKitMediaKeySession::keyRequestTimerFired)
</span><span class="cx"> , m_addKeyTimer(*this, &WebKitMediaKeySession::addKeyTimerFired)
</span><span class="cx"> {
</span><span class="lines">@@ -62,19 +59,12 @@
</span><span class="cx">
</span><span class="cx"> WebKitMediaKeySession::~WebKitMediaKeySession()
</span><span class="cx"> {
</span><del>- if (m_session) {
</del><ins>+ if (m_session)
</ins><span class="cx"> m_session->setClient(nullptr);
</span><del>- m_session = nullptr;
- }
</del><span class="cx">
</span><span class="cx"> m_asyncEventQueue.cancelAllEvents();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebKitMediaKeySession::setError(WebKitMediaKeyError* error)
-{
- m_error = error;
-}
-
</del><span class="cx"> void WebKitMediaKeySession::close()
</span><span class="cx"> {
</span><span class="cx"> if (m_session)
</span><span class="lines">@@ -104,7 +94,7 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> while (!m_pendingKeyRequests.isEmpty()) {
</span><del>- PendingKeyRequest request = m_pendingKeyRequests.takeFirst();
</del><ins>+ auto request = m_pendingKeyRequests.takeFirst();
</ins><span class="cx">
</span><span class="cx"> // NOTE: Continued from step 5 in MediaKeys::createSession().
</span><span class="cx"> // The user agent will asynchronously execute the following steps in the task:
</span><span class="lines">@@ -117,7 +107,7 @@
</span><span class="cx">
</span><span class="cx"> // 3. Use cdm to generate a key request and follow the steps for the first matching condition from the following list:
</span><span class="cx">
</span><del>- RefPtr<Uint8Array> keyRequest = m_session->generateKeyRequest(request.mimeType, request.initData.ptr(), destinationURL, errorCode, systemCode);
</del><ins>+ auto keyRequest = m_session->generateKeyRequest(request.mimeType, request.initData.ptr(), destinationURL, errorCode, systemCode);
</ins><span class="cx">
</span><span class="cx"> // Otherwise [if a request is not successfully generated]:
</span><span class="cx"> if (errorCode) {
</span><span class="lines">@@ -140,20 +130,20 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebKitMediaKeySession::update(Ref<Uint8Array>&& key, ExceptionCode& ec)
</del><ins>+ExceptionOr<void> WebKitMediaKeySession::update(Ref<Uint8Array>&& key)
</ins><span class="cx"> {
</span><span class="cx"> // From <http://dvcs.w3.org/hg/html-media/raw-file/tip/encrypted-media/encrypted-media.html#dom-addkey>:
</span><span class="cx"> // The addKey(key) method must run the following steps:
</span><span class="cx"> // 1. If the first or second argument [sic] is an empty array, throw an INVALID_ACCESS_ERR.
</span><span class="cx"> // NOTE: the reference to a "second argument" is a spec bug.
</span><del>- if (!key->length()) {
- ec = INVALID_ACCESS_ERR;
- return;
- }
</del><ins>+ if (!key->length())
+ return Exception { INVALID_ACCESS_ERR };
</ins><span class="cx">
</span><span class="cx"> // 2. Schedule a task to handle the call, providing key.
</span><span class="cx"> m_pendingKeys.append(WTFMove(key));
</span><span class="cx"> m_addKeyTimer.startOneShot(0);
</span><ins>+
+ return { };
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebKitMediaKeySession::addKeyTimerFired()
</span><span class="lines">@@ -192,7 +182,8 @@
</span><span class="cx"> keyaddedEvent->setTarget(this);
</span><span class="cx"> m_asyncEventQueue.enqueueEvent(WTFMove(keyaddedEvent));
</span><span class="cx">
</span><del>- keys()->keyAdded();
</del><ins>+ ASSERT(m_keys);
+ m_keys->keyAdded();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // 2.8. If any of the preceding steps in the task failed
</span><span class="lines">@@ -216,10 +207,9 @@
</span><span class="cx"> m_asyncEventQueue.enqueueEvent(WTFMove(event));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebKitMediaKeySession::sendError(CDMSessionClient::MediaKeyErrorCode errorCode, uint32_t systemCode)
</del><ins>+void WebKitMediaKeySession::sendError(MediaKeyErrorCode errorCode, uint32_t systemCode)
</ins><span class="cx"> {
</span><del>- Ref<WebKitMediaKeyError> error = WebKitMediaKeyError::create(errorCode, systemCode).get();
- setError(error.ptr());
</del><ins>+ m_error = WebKitMediaKeyError::create(errorCode, systemCode);
</ins><span class="cx">
</span><span class="cx"> auto keyerrorEvent = Event::create(eventNames().webkitkeyerrorEvent, false, false);
</span><span class="cx"> keyerrorEvent->setTarget(this);
</span><span class="lines">@@ -228,19 +218,19 @@
</span><span class="cx">
</span><span class="cx"> String WebKitMediaKeySession::mediaKeysStorageDirectory() const
</span><span class="cx"> {
</span><del>- Document* document = downcast<Document>(scriptExecutionContext());
</del><ins>+ auto* document = downcast<Document>(scriptExecutionContext());
</ins><span class="cx"> if (!document)
</span><span class="cx"> return emptyString();
</span><span class="cx">
</span><del>- Settings* settings = document->settings();
</del><ins>+ auto* settings = document->settings();
</ins><span class="cx"> if (!settings)
</span><span class="cx"> return emptyString();
</span><span class="cx">
</span><del>- String storageDirectory = settings->mediaKeysStorageDirectory();
</del><ins>+ auto storageDirectory = settings->mediaKeysStorageDirectory();
</ins><span class="cx"> if (storageDirectory.isEmpty())
</span><span class="cx"> return emptyString();
</span><span class="cx">
</span><del>- SecurityOrigin* origin = document->securityOrigin();
</del><ins>+ auto* origin = document->securityOrigin();
</ins><span class="cx"> if (!origin)
</span><span class="cx"> return emptyString();
</span><span class="cx">
</span><span class="lines">@@ -249,7 +239,7 @@
</span><span class="cx">
</span><span class="cx"> bool WebKitMediaKeySession::hasPendingActivity() const
</span><span class="cx"> {
</span><del>- return (m_keys && !isClosed()) || m_asyncEventQueue.hasPendingEvents();
</del><ins>+ return (m_keys && m_session) || m_asyncEventQueue.hasPendingEvents();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebKitMediaKeySession::stop()
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeySessionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.h (206983 => 206984)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.h        2016-10-10 06:21:52 UTC (rev 206983)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.h        2016-10-10 06:54:21 UTC (rev 206984)
</span><span class="lines">@@ -23,8 +23,7 @@
</span><span class="cx"> * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef WebKitMediaKeySession_h
-#define WebKitMediaKeySession_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(LEGACY_ENCRYPTED_MEDIA)
</span><span class="cx">
</span><span class="lines">@@ -31,13 +30,11 @@
</span><span class="cx"> #include "ActiveDOMObject.h"
</span><span class="cx"> #include "CDMSession.h"
</span><span class="cx"> #include "EventTarget.h"
</span><del>-#include "ExceptionCode.h"
</del><ins>+#include "ExceptionOr.h"
</ins><span class="cx"> #include "GenericEventQueue.h"
</span><span class="cx"> #include "Timer.h"
</span><span class="cx"> #include <runtime/Uint8Array.h>
</span><span class="cx"> #include <wtf/Deque.h>
</span><del>-#include <wtf/RefCounted.h>
-#include <wtf/text/WTFString.h>
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -44,50 +41,48 @@
</span><span class="cx"> class WebKitMediaKeyError;
</span><span class="cx"> class WebKitMediaKeys;
</span><span class="cx">
</span><del>-class WebKitMediaKeySession final : public RefCounted<WebKitMediaKeySession>, public EventTargetWithInlineData, public ActiveDOMObject, public CDMSessionClient {
</del><ins>+class WebKitMediaKeySession final : public RefCounted<WebKitMediaKeySession>, public EventTargetWithInlineData, private ActiveDOMObject, private CDMSessionClient {
</ins><span class="cx"> public:
</span><del>- static Ref<WebKitMediaKeySession> create(ScriptExecutionContext&, WebKitMediaKeys*, const String& keySystem);
</del><ins>+ static Ref<WebKitMediaKeySession> create(ScriptExecutionContext&, WebKitMediaKeys&, const String& keySystem);
</ins><span class="cx"> ~WebKitMediaKeySession();
</span><span class="cx">
</span><ins>+ WebKitMediaKeyError* error() { return m_error.get(); }
</ins><span class="cx"> const String& keySystem() const { return m_keySystem; }
</span><del>- CDMSession* session() { return m_session.get(); }
</del><span class="cx"> const String& sessionId() const;
</span><ins>+ ExceptionOr<void> update(Ref<Uint8Array>&& key);
+ void close();
</ins><span class="cx">
</span><del>- void setError(WebKitMediaKeyError*);
- WebKitMediaKeyError* error() { return m_error.get(); }
</del><ins>+ CDMSession* session() { return m_session.get(); }
</ins><span class="cx">
</span><del>- void setKeys(WebKitMediaKeys* keys) { m_keys = keys; }
- WebKitMediaKeys* keys() const { return m_keys; }
</del><ins>+ void detachKeys() { m_keys = nullptr; }
</ins><span class="cx">
</span><span class="cx"> void generateKeyRequest(const String& mimeType, Ref<Uint8Array>&& initData);
</span><del>- void update(Ref<Uint8Array>&& key, ExceptionCode&);
</del><ins>+ RefPtr<ArrayBuffer> cachedKeyForKeyId(const String& keyId) const;
</ins><span class="cx">
</span><del>- bool isClosed() const { return !m_session; }
- void close();
</del><ins>+ using RefCounted::ref;
+ using RefCounted::deref;
</ins><span class="cx">
</span><del>- RefPtr<ArrayBuffer> cachedKeyForKeyId(const String& keyId) const;
</del><ins>+ bool hasPendingActivity() const final;
</ins><span class="cx">
</span><del>- using RefCounted<WebKitMediaKeySession>::ref;
- using RefCounted<WebKitMediaKeySession>::deref;
</del><ins>+private:
+ WebKitMediaKeySession(ScriptExecutionContext&, WebKitMediaKeys&, const String& keySystem);
+ void keyRequestTimerFired();
+ void addKeyTimerFired();
</ins><span class="cx">
</span><del>- void enqueueEvent(RefPtr<Event>&&);
</del><ins>+ void sendMessage(Uint8Array*, String destinationURL) final;
+ void sendError(MediaKeyErrorCode, uint32_t systemCode) final;
+ String mediaKeysStorageDirectory() const final;
</ins><span class="cx">
</span><del>- EventTargetInterface eventTargetInterface() const override { return WebKitMediaKeySessionEventTargetInterfaceType; }
- ScriptExecutionContext* scriptExecutionContext() const override { return ActiveDOMObject::scriptExecutionContext(); }
</del><ins>+ void refEventTarget() final { ref(); }
+ void derefEventTarget() final { deref(); }
</ins><span class="cx">
</span><del>- // ActiveDOMObject API.
- bool hasPendingActivity() const override;
</del><ins>+ void stop() final;
+ bool canSuspendForDocumentSuspension() const final;
+ const char* activeDOMObjectName() const final;
</ins><span class="cx">
</span><del>-protected:
- WebKitMediaKeySession(ScriptExecutionContext&, WebKitMediaKeys*, const String& keySystem);
- void keyRequestTimerFired();
- void addKeyTimerFired();
</del><ins>+ EventTargetInterface eventTargetInterface() const final { return WebKitMediaKeySessionEventTargetInterfaceType; }
+ ScriptExecutionContext* scriptExecutionContext() const final { return ActiveDOMObject::scriptExecutionContext(); }
</ins><span class="cx">
</span><del>- // CDMSessionClient
- void sendMessage(Uint8Array*, String destinationURL) override;
- void sendError(MediaKeyErrorCode, uint32_t systemCode) override;
- String mediaKeysStorageDirectory() const override;
-
</del><span class="cx"> WebKitMediaKeys* m_keys;
</span><span class="cx"> String m_keySystem;
</span><span class="cx"> String m_sessionId;
</span><span class="lines">@@ -104,19 +99,8 @@
</span><span class="cx">
</span><span class="cx"> Deque<Ref<Uint8Array>> m_pendingKeys;
</span><span class="cx"> Timer m_addKeyTimer;
</span><del>-
-private:
- void refEventTarget() override { ref(); }
- void derefEventTarget() override { deref(); }
-
- // ActiveDOMObject API.
- void stop() override;
- bool canSuspendForDocumentSuspension() const override;
- const char* activeDOMObjectName() const override;
</del><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #endif // ENABLE(LEGACY_ENCRYPTED_MEDIA)
</span><del>-
-#endif // WebKitMediaKeySession_h
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeySessionidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.idl (206983 => 206984)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.idl        2016-10-10 06:21:52 UTC (rev 206983)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeySession.idl        2016-10-10 06:54:21 UTC (rev 206984)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -24,18 +24,15 @@
</span><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> [
</span><ins>+ ActiveDOMObject,
</ins><span class="cx"> Conditional=LEGACY_ENCRYPTED_MEDIA,
</span><del>- ActiveDOMObject,
</del><span class="cx"> ] interface WebKitMediaKeySession : EventTarget {
</span><del>- // error state
</del><span class="cx"> readonly attribute WebKitMediaKeyError error;
</span><span class="cx">
</span><del>- // session properties
</del><span class="cx"> readonly attribute DOMString keySystem;
</span><span class="cx"> readonly attribute DOMString sessionId;
</span><span class="cx">
</span><del>- // session operations
- [MayThrowLegacyException] void update(Uint8Array key);
</del><ins>+ [MayThrowException] void update(Uint8Array key);
</ins><span class="cx"> void close();
</span><span class="cx">
</span><span class="cx"> attribute EventHandler onwebkitkeyadded;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeyscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp (206983 => 206984)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp        2016-10-10 06:21:52 UTC (rev 206983)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp        2016-10-10 06:54:21 UTC (rev 206984)
</span><span class="lines">@@ -28,35 +28,28 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(LEGACY_ENCRYPTED_MEDIA)
</span><span class="cx">
</span><del>-#include "CDM.h"
</del><span class="cx"> #include "EventNames.h"
</span><span class="cx"> #include "HTMLMediaElement.h"
</span><del>-#include "UUID.h"
-#include "WebKitMediaKeyMessageEvent.h"
</del><span class="cx"> #include "WebKitMediaKeySession.h"
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-RefPtr<WebKitMediaKeys> WebKitMediaKeys::create(const String& keySystem, ExceptionCode& ec)
</del><ins>+ExceptionOr<Ref<WebKitMediaKeys>> WebKitMediaKeys::create(const String& keySystem)
</ins><span class="cx"> {
</span><span class="cx"> // From <http://dvcs.w3.org/hg/html-media/raw-file/tip/encrypted-media/encrypted-media.html#dom-media-keys-constructor>:
</span><span class="cx"> // The MediaKeys(keySystem) constructor must run the following steps:
</span><span class="cx">
</span><span class="cx"> // 1. If keySystem is null or an empty string, throw an INVALID_ACCESS_ERR exception and abort these steps.
</span><del>- if (keySystem.isNull() || keySystem.isEmpty()) {
- ec = INVALID_ACCESS_ERR;
- return nullptr;
- }
</del><ins>+ if (keySystem.isEmpty())
+ return Exception { INVALID_ACCESS_ERR };
</ins><span class="cx">
</span><span class="cx"> // 2. If keySystem is not one of the user agent's supported Key Systems, throw a NOT_SUPPORTED_ERR and abort these steps.
</span><del>- if (!CDM::supportsKeySystem(keySystem)) {
- ec = NOT_SUPPORTED_ERR;
- return nullptr;
- }
</del><ins>+ if (!CDM::supportsKeySystem(keySystem))
+ return Exception { NOT_SUPPORTED_ERR };
</ins><span class="cx">
</span><span class="cx"> // 3. Let cdm be the content decryption module corresponding to keySystem.
</span><span class="cx"> // 4. Load cdm if necessary.
</span><del>- std::unique_ptr<CDM> cdm = CDM::create(keySystem);
</del><ins>+ auto cdm = CDM::create(keySystem);
</ins><span class="cx">
</span><span class="cx"> // 5. Create a new MediaKeys object.
</span><span class="cx"> // 5.1 Let the keySystem attribute be keySystem.
</span><span class="lines">@@ -64,9 +57,8 @@
</span><span class="cx"> return adoptRef(*new WebKitMediaKeys(keySystem, WTFMove(cdm)));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-WebKitMediaKeys::WebKitMediaKeys(const String& keySystem, std::unique_ptr<CDM> cdm)
- : m_mediaElement(nullptr)
- , m_keySystem(keySystem)
</del><ins>+WebKitMediaKeys::WebKitMediaKeys(const String& keySystem, std::unique_ptr<CDM>&& cdm)
+ : m_keySystem(keySystem)
</ins><span class="cx"> , m_cdm(WTFMove(cdm))
</span><span class="cx"> {
</span><span class="cx"> m_cdm->setClient(this);
</span><span class="lines">@@ -78,11 +70,11 @@
</span><span class="cx"> // When destroying a MediaKeys object, follow the steps in close().
</span><span class="cx"> for (auto& session : m_sessions) {
</span><span class="cx"> session->close();
</span><del>- session->setKeys(nullptr);
</del><ins>+ session->detachKeys();
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-RefPtr<WebKitMediaKeySession> WebKitMediaKeys::createSession(ScriptExecutionContext& context, const String& type, Ref<Uint8Array>&& initData, ExceptionCode& ec)
</del><ins>+ExceptionOr<Ref<WebKitMediaKeySession>> WebKitMediaKeys::createSession(ScriptExecutionContext& context, const String& type, Ref<Uint8Array>&& initData)
</ins><span class="cx"> {
</span><span class="cx"> // From <http://www.w3.org/TR/2014/WD-encrypted-media-20140218/#dom-createsession>:
</span><span class="cx"> // The createSession(type, initData) method must run the following steps:
</span><span class="lines">@@ -89,28 +81,22 @@
</span><span class="cx"> // Note: The contents of initData are container-specific Initialization Data.
</span><span class="cx">
</span><span class="cx"> // 1. If contentType is null or an empty string, throw an INVALID_ACCESS_ERR exception and abort these steps.
</span><del>- if (type.isEmpty()) {
- ec = INVALID_ACCESS_ERR;
- return nullptr;
- }
</del><ins>+ if (type.isEmpty())
+ return Exception { INVALID_ACCESS_ERR };
</ins><span class="cx">
</span><span class="cx"> // 2. If initData is an empty array, throw an INVALID_ACCESS_ERR exception and abort these steps.
</span><del>- if (!initData->length()) {
- ec = INVALID_ACCESS_ERR;
- return nullptr;
- }
</del><ins>+ if (!initData->length())
+ return Exception { INVALID_ACCESS_ERR };
</ins><span class="cx">
</span><span class="cx"> // 3. If type contains a MIME type that is not supported or is not supported by the keySystem, throw
</span><span class="cx"> // a NOT_SUPPORTED_ERR exception and abort these steps.
</span><del>- if (!type.isNull() && !type.isEmpty() && !m_cdm->supportsMIMEType(type)) {
- ec = NOT_SUPPORTED_ERR;
- return nullptr;
- }
</del><ins>+ if (!m_cdm->supportsMIMEType(type))
+ return Exception { NOT_SUPPORTED_ERR };
</ins><span class="cx">
</span><span class="cx"> // 4. Create a new MediaKeySession object.
</span><span class="cx"> // 4.1 Let the keySystem attribute be keySystem.
</span><span class="cx"> // 4.2 Let the sessionId attribute be a unique Session ID string. It may be generated by cdm.
</span><del>- auto session = WebKitMediaKeySession::create(context, this, keySystem());
</del><ins>+ auto session = WebKitMediaKeySession::create(context, *this, m_keySystem);
</ins><span class="cx">
</span><span class="cx"> m_sessions.append(session.copyRef());
</span><span class="cx">
</span><span class="lines">@@ -125,11 +111,11 @@
</span><span class="cx"> {
</span><span class="cx"> // 1. If keySystem contains an unrecognized or unsupported Key System, return false and abort these steps.
</span><span class="cx"> // Key system string comparison is case-sensitive.
</span><del>- if (keySystem.isNull() || keySystem.isEmpty() || !CDM::supportsKeySystem(keySystem))
</del><ins>+ if (keySystem.isEmpty() || !CDM::supportsKeySystem(keySystem))
</ins><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> // 2. If type is null or an empty string, return true and abort these steps.
</span><del>- if (mimeType.isNull() || mimeType.isEmpty())
</del><ins>+ if (mimeType.isEmpty())
</ins><span class="cx"> return true;
</span><span class="cx">
</span><span class="cx"> // 3. If the Key System specified by keySystem does not support decrypting the container and/or codec
</span><span class="lines">@@ -154,9 +140,9 @@
</span><span class="cx">
</span><span class="cx"> MediaPlayer* WebKitMediaKeys::cdmMediaPlayer(const CDM*) const
</span><span class="cx"> {
</span><del>- if (m_mediaElement)
- return m_mediaElement->player();
- return 0;
</del><ins>+ if (!m_mediaElement)
+ return nullptr;
+ return m_mediaElement->player();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebKitMediaKeys::keyAdded()
</span><span class="lines">@@ -163,13 +149,12 @@
</span><span class="cx"> {
</span><span class="cx"> if (m_mediaElement)
</span><span class="cx"> m_mediaElement->keyAdded();
</span><del>-
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> RefPtr<ArrayBuffer> WebKitMediaKeys::cachedKeyForKeyId(const String& keyId) const
</span><span class="cx"> {
</span><span class="cx"> for (auto& session : m_sessions) {
</span><del>- if (RefPtr<ArrayBuffer> key = session->cachedKeyForKeyId(keyId))
</del><ins>+ if (auto key = session->cachedKeyForKeyId(keyId))
</ins><span class="cx"> return key;
</span><span class="cx"> }
</span><span class="cx"> return nullptr;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeysh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeys.h (206983 => 206984)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeys.h        2016-10-10 06:21:52 UTC (rev 206983)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeys.h        2016-10-10 06:54:21 UTC (rev 206984)
</span><span class="lines">@@ -23,51 +23,44 @@
</span><span class="cx"> * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-#ifndef WebKitMediaKeys_h
-#define WebKitMediaKeys_h
</del><ins>+#pragma once
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(LEGACY_ENCRYPTED_MEDIA)
</span><span class="cx">
</span><span class="cx"> #include "CDM.h"
</span><del>-#include "EventTarget.h"
-#include "ExceptionCode.h"
</del><ins>+#include "ExceptionOr.h"
</ins><span class="cx"> #include <runtime/Uint8Array.h>
</span><del>-#include <wtf/RefCounted.h>
</del><span class="cx"> #include <wtf/Vector.h>
</span><del>-#include <wtf/text/WTFString.h>
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> class HTMLMediaElement;
</span><ins>+class ScriptExecutionContext;
</ins><span class="cx"> class WebKitMediaKeySession;
</span><span class="cx">
</span><del>-class WebKitMediaKeys : public RefCounted<WebKitMediaKeys>, public CDMClient {
</del><ins>+class WebKitMediaKeys final : public RefCounted<WebKitMediaKeys>, private CDMClient {
</ins><span class="cx"> public:
</span><del>- static RefPtr<WebKitMediaKeys> create(const String& keySystem, ExceptionCode&);
</del><ins>+ static ExceptionOr<Ref<WebKitMediaKeys>> create(const String& keySystem);
</ins><span class="cx"> virtual ~WebKitMediaKeys();
</span><span class="cx">
</span><del>- RefPtr<WebKitMediaKeySession> createSession(ScriptExecutionContext&, const String& mimeType, Ref<Uint8Array>&& initData, ExceptionCode&);
-
</del><ins>+ ExceptionOr<Ref<WebKitMediaKeySession>> createSession(ScriptExecutionContext&, const String& mimeType, Ref<Uint8Array>&& initData);
</ins><span class="cx"> static bool isTypeSupported(const String& keySystem, const String& mimeType);
</span><del>-
</del><span class="cx"> const String& keySystem() const { return m_keySystem; }
</span><del>- CDM* cdm() { return m_cdm.get(); }
</del><span class="cx">
</span><del>- HTMLMediaElement* mediaElement() const { return m_mediaElement; }
</del><ins>+ CDM& cdm() { ASSERT(m_cdm); return *m_cdm; }
+
</ins><span class="cx"> void setMediaElement(HTMLMediaElement*);
</span><span class="cx">
</span><span class="cx"> void keyAdded();
</span><span class="cx"> RefPtr<ArrayBuffer> cachedKeyForKeyId(const String& keyId) const;
</span><span class="cx">
</span><del>-protected:
- // CDMClient:
- MediaPlayer* cdmMediaPlayer(const CDM*) const override;
</del><ins>+private:
+ MediaPlayer* cdmMediaPlayer(const CDM*) const final;
</ins><span class="cx">
</span><del>- WebKitMediaKeys(const String& keySystem, std::unique_ptr<CDM>);
</del><ins>+ WebKitMediaKeys(const String& keySystem, std::unique_ptr<CDM>&&);
</ins><span class="cx">
</span><span class="cx"> Vector<Ref<WebKitMediaKeySession>> m_sessions;
</span><del>-
- HTMLMediaElement* m_mediaElement;
</del><ins>+ HTMLMediaElement* m_mediaElement { nullptr };
</ins><span class="cx"> String m_keySystem;
</span><span class="cx"> std::unique_ptr<CDM> m_cdm;
</span><span class="cx"> };
</span><span class="lines">@@ -75,5 +68,3 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #endif // ENABLE(LEGACY_ENCRYPTED_MEDIA)
</span><del>-
-#endif // WebKitMediaKeys_h
</del></span></pre></div>
<a id="trunkSourceWebCoreModulesencryptedmedialegacyWebKitMediaKeysidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeys.idl (206983 => 206984)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeys.idl        2016-10-10 06:21:52 UTC (rev 206983)
+++ trunk/Source/WebCore/Modules/encryptedmedia/legacy/WebKitMediaKeys.idl        2016-10-10 06:54:21 UTC (rev 206984)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -26,9 +26,9 @@
</span><span class="cx"> [
</span><span class="cx"> Conditional=LEGACY_ENCRYPTED_MEDIA,
</span><span class="cx"> Constructor(DOMString keySystem),
</span><del>- ConstructorMayThrowLegacyException,
</del><ins>+ ConstructorMayThrowException,
</ins><span class="cx"> ] interface WebKitMediaKeys {
</span><del>- [CallWith=ScriptExecutionContext, MayThrowLegacyException] WebKitMediaKeySession createSession(DOMString type, Uint8Array initData);
</del><ins>+ [CallWith=ScriptExecutionContext, MayThrowException] WebKitMediaKeySession createSession(DOMString type, Uint8Array initData);
</ins><span class="cx"> static boolean isTypeSupported(DOMString keySystem, optional DOMString type);
</span><span class="cx"> readonly attribute DOMString keySystem;
</span><span class="cx"> };
</span></span></pre>
</div>
</div>
</body>
</html>