<!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>[203696] trunk</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/203696">203696</a></dd>
<dt>Author</dt> <dd>jiewen_tan@apple.com</dd>
<dt>Date</dt> <dd>2016-07-25 13:35:16 -0700 (Mon, 25 Jul 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Rename SubtleCrypto to WebKitSubtleCrypto
https://bugs.webkit.org/show_bug.cgi?id=160067
&lt;rdar://problem/27483617&gt;

Reviewed by Brent Fulgham.

Source/WebCore:

Tests: crypto/webkitSubtle/gc-2.html
       crypto/webkitSubtle/gc-3.html
       crypto/webkitSubtle/gc.html

Rename Class SubtleCrypto to WebKitSubtleCrypto, and Crypto.subtle to Crypto.webkitSubtle in order
to let the new implementation to reuse the name SubtleCrypto. This renaming should match what our
current JSBindings use, and therefore should not introduce any change of behavoir.

* CMakeLists.txt:
Revise project files for for new file names.
* DerivedSources.cpp:
* DerivedSources.make:
* PlatformEfl.cmake:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
Revise project files for for new file names.
* bindings/js/JSWebKitSubtleCryptoCustom.cpp: Renamed from Source/WebCore/bindings/js/JSSubtleCryptoCustom.cpp.
* crypto/WebKitSubtleCrypto.cpp: Renamed from Source/WebCore/crypto/SubtleCrypto.cpp.
* crypto/WebKitSubtleCrypto.h: Renamed from Source/WebCore/crypto/SubtleCrypto.h.
* crypto/WebKitSubtleCrypto.idl: Renamed from Source/WebCore/crypto/SubtleCrypto.idl.
* page/Crypto.cpp:
(WebCore::Crypto::webkitSubtle):
(WebCore::Crypto::subtle): Deleted.
* page/Crypto.h:
* page/Crypto.idl:

LayoutTests:

Move tests involving crypto.webkitSubtle from crypto/subtle to crypto/webkitSubtle.

* crypto/webkitSubtle/gc-2-expected.txt: Renamed from LayoutTests/crypto/subtle/gc-2-expected.txt.
* crypto/webkitSubtle/gc-2.html: Renamed from LayoutTests/crypto/subtle/gc-2.html.
* crypto/webkitSubtle/gc-3-expected.txt: Renamed from LayoutTests/crypto/subtle/gc-3-expected.txt.
* crypto/webkitSubtle/gc-3.html: Renamed from LayoutTests/crypto/subtle/gc-3.html.
* crypto/webkitSubtle/gc-expected.txt: Renamed from LayoutTests/crypto/subtle/gc-expected.txt.
* crypto/webkitSubtle/gc.html: Renamed from LayoutTests/crypto/subtle/gc.html.
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/ios-simulator-wk1/TestExpectations:
* platform/win/TestExpectations:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformeflTestExpectations">trunk/LayoutTests/platform/efl/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformgtkTestExpectations">trunk/LayoutTests/platform/gtk/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorwk1TestExpectations">trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformwinTestExpectations">trunk/LayoutTests/platform/win/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcescpp">trunk/Source/WebCore/DerivedSources.cpp</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcesmake">trunk/Source/WebCore/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebCorePlatformEflcmake">trunk/Source/WebCore/PlatformEfl.cmake</a></li>
<li><a href="#trunkSourceWebCorePlatformGTKcmake">trunk/Source/WebCore/PlatformGTK.cmake</a></li>
<li><a href="#trunkSourceWebCorePlatformMaccmake">trunk/Source/WebCore/PlatformMac.cmake</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorepageCryptocpp">trunk/Source/WebCore/page/Crypto.cpp</a></li>
<li><a href="#trunkSourceWebCorepageCryptoh">trunk/Source/WebCore/page/Crypto.h</a></li>
<li><a href="#trunkSourceWebCorepageCryptoidl">trunk/Source/WebCore/page/Crypto.idl</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/LayoutTests/crypto/webkitSubtle/</li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlegc2expectedtxt">trunk/LayoutTests/crypto/webkitSubtle/gc-2-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlegc2html">trunk/LayoutTests/crypto/webkitSubtle/gc-2.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlegc3expectedtxt">trunk/LayoutTests/crypto/webkitSubtle/gc-3-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlegc3html">trunk/LayoutTests/crypto/webkitSubtle/gc-3.html</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlegcexpectedtxt">trunk/LayoutTests/crypto/webkitSubtle/gc-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptowebkitSubtlegchtml">trunk/LayoutTests/crypto/webkitSubtle/gc.html</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSWebKitSubtleCryptoCustomcpp">trunk/Source/WebCore/bindings/js/JSWebKitSubtleCryptoCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorecryptoWebKitSubtleCryptocpp">trunk/Source/WebCore/crypto/WebKitSubtleCrypto.cpp</a></li>
<li><a href="#trunkSourceWebCorecryptoWebKitSubtleCryptoh">trunk/Source/WebCore/crypto/WebKitSubtleCrypto.h</a></li>
<li><a href="#trunkSourceWebCorecryptoWebKitSubtleCryptoidl">trunk/Source/WebCore/crypto/WebKitSubtleCrypto.idl</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestscryptosubtlegc2expectedtxt">trunk/LayoutTests/crypto/subtle/gc-2-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlegc2html">trunk/LayoutTests/crypto/subtle/gc-2.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlegc3expectedtxt">trunk/LayoutTests/crypto/subtle/gc-3-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlegc3html">trunk/LayoutTests/crypto/subtle/gc-3.html</a></li>
<li><a href="#trunkLayoutTestscryptosubtlegcexpectedtxt">trunk/LayoutTests/crypto/subtle/gc-expected.txt</a></li>
<li><a href="#trunkLayoutTestscryptosubtlegchtml">trunk/LayoutTests/crypto/subtle/gc.html</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSSubtleCryptoCustomcpp">trunk/Source/WebCore/bindings/js/JSSubtleCryptoCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorecryptoSubtleCryptocpp">trunk/Source/WebCore/crypto/SubtleCrypto.cpp</a></li>
<li><a href="#trunkSourceWebCorecryptoSubtleCryptoh">trunk/Source/WebCore/crypto/SubtleCrypto.h</a></li>
<li><a href="#trunkSourceWebCorecryptoSubtleCryptoidl">trunk/Source/WebCore/crypto/SubtleCrypto.idl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (203695 => 203696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-07-25 19:57:47 UTC (rev 203695)
+++ trunk/LayoutTests/ChangeLog        2016-07-25 20:35:16 UTC (rev 203696)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2016-07-25  Jiewen Tan  &lt;jiewen_tan@apple.com&gt;
+
+        Rename SubtleCrypto to WebKitSubtleCrypto
+        https://bugs.webkit.org/show_bug.cgi?id=160067
+        &lt;rdar://problem/27483617&gt;
+
+        Reviewed by Brent Fulgham.
+
+        Move tests involving crypto.webkitSubtle from crypto/subtle to crypto/webkitSubtle.
+
+        * crypto/webkitSubtle/gc-2-expected.txt: Renamed from LayoutTests/crypto/subtle/gc-2-expected.txt.
+        * crypto/webkitSubtle/gc-2.html: Renamed from LayoutTests/crypto/subtle/gc-2.html.
+        * crypto/webkitSubtle/gc-3-expected.txt: Renamed from LayoutTests/crypto/subtle/gc-3-expected.txt.
+        * crypto/webkitSubtle/gc-3.html: Renamed from LayoutTests/crypto/subtle/gc-3.html.
+        * crypto/webkitSubtle/gc-expected.txt: Renamed from LayoutTests/crypto/subtle/gc-expected.txt.
+        * crypto/webkitSubtle/gc.html: Renamed from LayoutTests/crypto/subtle/gc.html.
+        * platform/efl/TestExpectations:
+        * platform/gtk/TestExpectations:
+        * platform/ios-simulator-wk1/TestExpectations:
+        * platform/win/TestExpectations:
+
</ins><span class="cx"> 2016-07-25  Brady Eidson  &lt;beidson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Allow LocalStorage by default for file URLs.
</span></span></pre></div>
<a id="trunkLayoutTestscryptosubtlegc2expectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/gc-2-expected.txt (203695 => 203696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/gc-2-expected.txt        2016-07-25 19:57:47 UTC (rev 203695)
+++ trunk/LayoutTests/crypto/subtle/gc-2-expected.txt        2016-07-25 20:35:16 UTC (rev 203696)
</span><span class="lines">@@ -1,12 +0,0 @@
</span><del>-Test that window.crypto.subtle wrapper preserves custom properties.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-PASS [object Crypto] is defined.
-PASS [object WebKitSubtleCrypto] is defined.
-PASS anotherWindowCrypto.webkitSubtle.foo is &quot;bar&quot;
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlegc2html"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/gc-2.html (203695 => 203696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/gc-2.html        2016-07-25 19:57:47 UTC (rev 203695)
+++ trunk/LayoutTests/crypto/subtle/gc-2.html        2016-07-25 20:35:16 UTC (rev 203696)
</span><span class="lines">@@ -1,46 +0,0 @@
</span><del>-&lt;!DOCTYPE html&gt;
-&lt;html&gt;
-&lt;head&gt;
-&lt;meta charset=&quot;utf-8&quot;&gt;
-&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
-&lt;/head&gt;
-&lt;body&gt;
-&lt;script&gt;
-
-description(&quot;Test that window.crypto.subtle wrapper preserves custom properties.&quot;);
-jsTestIsAsync = true;
-
-var anotherWindowCrypto;
-
-function startTest()
-{
-    anotherWindowCrypto = frames[0].crypto;
-    shouldBeDefined(anotherWindowCrypto);
-    shouldBeDefined(anotherWindowCrypto.webkitSubtle);
-
-    anotherWindowCrypto.webkitSubtle.foo = &quot;bar&quot;;
-    document.body.removeChild(document.getElementsByTagName(&quot;iframe&quot;)[0]);
-    gc();
-    setTimeout(continueTest, 10);
-}
-
-function continueTest()
-{
-    gc();
-    setTimeout(finishTest, 10);
-}
-
-function finishTest()
-{
-    gc();
-    shouldBe('anotherWindowCrypto.webkitSubtle.foo', '&quot;bar&quot;');
-    finishJSTest();
-}
-
-window.onload = startTest;
-
-&lt;/script&gt;
-&lt;iframe src=&quot;about:blank&quot;&gt;&lt;/iframe&gt;
-&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlegc3expectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/gc-3-expected.txt (203695 => 203696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/gc-3-expected.txt        2016-07-25 19:57:47 UTC (rev 203695)
+++ trunk/LayoutTests/crypto/subtle/gc-3-expected.txt        2016-07-25 20:35:16 UTC (rev 203696)
</span><span class="lines">@@ -1,11 +0,0 @@
</span><del>-Test that window.crypto wrapper protects all dependencies, so it can always be used to create crypto.subtle.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-PASS [object Crypto] is defined.
-PASS [object WebKitSubtleCrypto] is defined.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlegc3html"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/gc-3.html (203695 => 203696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/gc-3.html        2016-07-25 19:57:47 UTC (rev 203695)
+++ trunk/LayoutTests/crypto/subtle/gc-3.html        2016-07-25 20:35:16 UTC (rev 203696)
</span><span class="lines">@@ -1,43 +0,0 @@
</span><del>-&lt;!DOCTYPE html&gt;
-&lt;html&gt;
-&lt;head&gt;
-&lt;meta charset=&quot;utf-8&quot;&gt;
-&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
-&lt;/head&gt;
-&lt;body&gt;
-&lt;script&gt;
-
-description(&quot;Test that window.crypto wrapper protects all dependencies, so it can always be used to create crypto.subtle.&quot;);
-jsTestIsAsync = true;
-
-var anotherWindowCrypto;
-
-function startTest()
-{
-    anotherWindowCrypto = frames[0].crypto;
-    shouldBeDefined(anotherWindowCrypto);
-    document.body.removeChild(document.getElementsByTagName(&quot;iframe&quot;)[0]);
-    gc();
-    setTimeout(continueTest, 10);
-}
-
-function continueTest()
-{
-    gc();
-    setTimeout(finishTest, 10);
-}
-
-function finishTest()
-{
-    gc();
-    shouldBeDefined(anotherWindowCrypto.webkitSubtle);
-    finishJSTest();
-}
-
-window.onload = startTest;
-
-&lt;/script&gt;
-&lt;iframe src=&quot;about:blank&quot;&gt;&lt;/iframe&gt;
-&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlegcexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/gc-expected.txt (203695 => 203696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/gc-expected.txt        2016-07-25 19:57:47 UTC (rev 203695)
+++ trunk/LayoutTests/crypto/subtle/gc-expected.txt        2016-07-25 20:35:16 UTC (rev 203696)
</span><span class="lines">@@ -1,10 +0,0 @@
</span><del>-Test that window.crypto.subtle wrapper preserves custom properties.
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-PASS window.crypto.webkitSubtle.foo is &quot;bar&quot;
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
</del></span></pre></div>
<a id="trunkLayoutTestscryptosubtlegchtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/crypto/subtle/gc.html (203695 => 203696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/subtle/gc.html        2016-07-25 19:57:47 UTC (rev 203695)
+++ trunk/LayoutTests/crypto/subtle/gc.html        2016-07-25 20:35:16 UTC (rev 203696)
</span><span class="lines">@@ -1,38 +0,0 @@
</span><del>-&lt;!DOCTYPE html&gt;
-&lt;html&gt;
-&lt;head&gt;
-&lt;meta charset=&quot;utf-8&quot;&gt;
-&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
-&lt;/head&gt;
-&lt;body&gt;
-&lt;script&gt;
-
-description(&quot;Test that window.crypto.subtle wrapper preserves custom properties.&quot;);
-jsTestIsAsync = true;
-
-function startTest()
-{
-    window.crypto.webkitSubtle.foo = &quot;bar&quot;;
-    gc();
-    setTimeout(continueTest, 10);
-}
-
-function continueTest()
-{
-    gc();
-    setTimeout(finishTest, 10);
-}
-
-function finishTest()
-{
-    gc();
-    shouldBe('window.crypto.webkitSubtle.foo', '&quot;bar&quot;');
-    finishJSTest();
-}
-
-window.onload = startTest;
-
-&lt;/script&gt;
-&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlegc2expectedtxtfromrev203695trunkLayoutTestscryptosubtlegc2expectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/gc-2-expected.txt (from rev 203695, trunk/LayoutTests/crypto/subtle/gc-2-expected.txt) (0 => 203696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/gc-2-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/gc-2-expected.txt        2016-07-25 20:35:16 UTC (rev 203696)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+Test that window.crypto.webkitSubtle wrapper preserves custom properties.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS [object Crypto] is defined.
+PASS [object WebKitSubtleCrypto] is defined.
+PASS anotherWindowCrypto.webkitSubtle.foo is &quot;bar&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlegc2htmlfromrev203695trunkLayoutTestscryptosubtlegc2html"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/gc-2.html (from rev 203695, trunk/LayoutTests/crypto/subtle/gc-2.html) (0 => 203696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/gc-2.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/gc-2.html        2016-07-25 20:35:16 UTC (rev 203696)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+
+description(&quot;Test that window.crypto.webkitSubtle wrapper preserves custom properties.&quot;);
+jsTestIsAsync = true;
+
+var anotherWindowCrypto;
+
+function startTest()
+{
+    anotherWindowCrypto = frames[0].crypto;
+    shouldBeDefined(anotherWindowCrypto);
+    shouldBeDefined(anotherWindowCrypto.webkitSubtle);
+
+    anotherWindowCrypto.webkitSubtle.foo = &quot;bar&quot;;
+    document.body.removeChild(document.getElementsByTagName(&quot;iframe&quot;)[0]);
+    gc();
+    setTimeout(continueTest, 10);
+}
+
+function continueTest()
+{
+    gc();
+    setTimeout(finishTest, 10);
+}
+
+function finishTest()
+{
+    gc();
+    shouldBe('anotherWindowCrypto.webkitSubtle.foo', '&quot;bar&quot;');
+    finishJSTest();
+}
+
+window.onload = startTest;
+
+&lt;/script&gt;
+&lt;iframe src=&quot;about:blank&quot;&gt;&lt;/iframe&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlegc3expectedtxtfromrev203695trunkLayoutTestscryptosubtlegc3expectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/gc-3-expected.txt (from rev 203695, trunk/LayoutTests/crypto/subtle/gc-3-expected.txt) (0 => 203696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/gc-3-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/gc-3-expected.txt        2016-07-25 20:35:16 UTC (rev 203696)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+Test that window.crypto wrapper protects all dependencies, so it can always be used to create crypto.webkitSubtle.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS [object Crypto] is defined.
+PASS [object WebKitSubtleCrypto] is defined.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlegc3htmlfromrev203695trunkLayoutTestscryptosubtlegc3html"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/gc-3.html (from rev 203695, trunk/LayoutTests/crypto/subtle/gc-3.html) (0 => 203696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/gc-3.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/gc-3.html        2016-07-25 20:35:16 UTC (rev 203696)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+
+description(&quot;Test that window.crypto wrapper protects all dependencies, so it can always be used to create crypto.webkitSubtle.&quot;);
+jsTestIsAsync = true;
+
+var anotherWindowCrypto;
+
+function startTest()
+{
+    anotherWindowCrypto = frames[0].crypto;
+    shouldBeDefined(anotherWindowCrypto);
+    document.body.removeChild(document.getElementsByTagName(&quot;iframe&quot;)[0]);
+    gc();
+    setTimeout(continueTest, 10);
+}
+
+function continueTest()
+{
+    gc();
+    setTimeout(finishTest, 10);
+}
+
+function finishTest()
+{
+    gc();
+    shouldBeDefined(anotherWindowCrypto.webkitSubtle);
+    finishJSTest();
+}
+
+window.onload = startTest;
+
+&lt;/script&gt;
+&lt;iframe src=&quot;about:blank&quot;&gt;&lt;/iframe&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlegcexpectedtxtfromrev203695trunkLayoutTestscryptosubtlegcexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/gc-expected.txt (from rev 203695, trunk/LayoutTests/crypto/subtle/gc-expected.txt) (0 => 203696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/gc-expected.txt                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/gc-expected.txt        2016-07-25 20:35:16 UTC (rev 203696)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+Test that window.crypto.webkitSubtle wrapper preserves custom properties.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS window.crypto.webkitSubtle.foo is &quot;bar&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestscryptowebkitSubtlegchtmlfromrev203695trunkLayoutTestscryptosubtlegchtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/crypto/webkitSubtle/gc.html (from rev 203695, trunk/LayoutTests/crypto/subtle/gc.html) (0 => 203696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/crypto/webkitSubtle/gc.html                                (rev 0)
+++ trunk/LayoutTests/crypto/webkitSubtle/gc.html        2016-07-25 20:35:16 UTC (rev 203696)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+
+description(&quot;Test that window.crypto.webkitSubtle wrapper preserves custom properties.&quot;);
+jsTestIsAsync = true;
+
+function startTest()
+{
+    window.crypto.webkitSubtle.foo = &quot;bar&quot;;
+    gc();
+    setTimeout(continueTest, 10);
+}
+
+function continueTest()
+{
+    gc();
+    setTimeout(finishTest, 10);
+}
+
+function finishTest()
+{
+    gc();
+    shouldBe('window.crypto.webkitSubtle.foo', '&quot;bar&quot;');
+    finishJSTest();
+}
+
+window.onload = startTest;
+
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformeflTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/efl/TestExpectations (203695 => 203696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/efl/TestExpectations        2016-07-25 19:57:47 UTC (rev 203695)
+++ trunk/LayoutTests/platform/efl/TestExpectations        2016-07-25 20:35:16 UTC (rev 203696)
</span><span class="lines">@@ -1823,6 +1823,7 @@
</span><span class="cx"> # crypto.subtle is not yet enabled, but digest algorithms are already implemented
</span><span class="cx"> # and their tests are whitelisted
</span><span class="cx"> webkit.org/b/133122 crypto/subtle [ Skip ]
</span><ins>+webkit.org/b/133122 crypto/webkitSubtle [ Skip ]
</ins><span class="cx"> webkit.org/b/133319 crypto/subtle/sha-1.html [ Pass ]
</span><span class="cx"> webkit.org/b/133319 crypto/subtle/sha-224.html [ Pass ]
</span><span class="cx"> webkit.org/b/133319 crypto/subtle/sha-256.html [ Pass ]
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtkTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/TestExpectations (203695 => 203696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/TestExpectations        2016-07-25 19:57:47 UTC (rev 203695)
+++ trunk/LayoutTests/platform/gtk/TestExpectations        2016-07-25 20:35:16 UTC (rev 203696)
</span><span class="lines">@@ -409,6 +409,7 @@
</span><span class="cx"> # crypto.subtle is not yet enabled, but digest algorithms are already implemented
</span><span class="cx"> # and their tests are whitelisted
</span><span class="cx"> webkit.org/b/133122 crypto/subtle [ Skip ]
</span><ins>+webkit.org/b/133122 crypto/webkitSubtle [ Skip ]
</ins><span class="cx"> webkit.org/b/133319 crypto/subtle/sha-1.html [ Pass ]
</span><span class="cx"> webkit.org/b/133319 crypto/subtle/sha-224.html [ Pass ]
</span><span class="cx"> webkit.org/b/133319 crypto/subtle/sha-256.html [ Pass ]
</span></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorwk1TestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations (203695 => 203696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations        2016-07-25 19:57:47 UTC (rev 203695)
+++ trunk/LayoutTests/platform/ios-simulator-wk1/TestExpectations        2016-07-25 20:35:16 UTC (rev 203696)
</span><span class="lines">@@ -1005,7 +1005,9 @@
</span><span class="cx"> storage/indexeddb
</span><span class="cx"> imported/w3c/IndexedDB-private-browsing
</span><span class="cx"> imported/w3c/web-platform-tests/IndexedDB
</span><ins>+crypto/subtle/rsa-indexeddb-non-exportable-private.html
</ins><span class="cx"> crypto/subtle/rsa-indexeddb-non-exportable.html
</span><ins>+crypto/subtle/rsa-indexeddb-private.html
</ins><span class="cx"> crypto/subtle/rsa-indexeddb.html
</span><span class="cx"> fast/history/page-cache-indexed-closed-db.html
</span><span class="cx"> fast/history/page-cache-indexed-opened-db.html
</span></span></pre></div>
<a id="trunkLayoutTestsplatformwinTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/win/TestExpectations (203695 => 203696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/win/TestExpectations        2016-07-25 19:57:47 UTC (rev 203695)
+++ trunk/LayoutTests/platform/win/TestExpectations        2016-07-25 20:35:16 UTC (rev 203696)
</span><span class="lines">@@ -259,6 +259,9 @@
</span><span class="cx"> http/tests/security/cross-origin-worker-indexeddb-allowed.html [ Skip ]
</span><span class="cx"> http/tests/security/cross-origin-worker-indexeddb.html [ Skip ]
</span><span class="cx"> http/tests/security/no-indexeddb-from-sandbox.html [ Skip ]
</span><ins>+crypto/subtle/rsa-indexeddb-non-exportable-private.html [ Skip ]
+crypto/subtle/rsa-indexeddb-non-exportable.html [ Skip ]
+crypto/subtle/rsa-indexeddb-private.html [ Skip ]
</ins><span class="cx"> crypto/subtle/rsa-indexeddb.html [ Skip ]
</span><span class="cx"> fast/history/page-cache-indexed-closed-db.html [ Skip ]
</span><span class="cx"> fast/history/page-cache-indexed-opened-db.html [ Skip ]
</span><span class="lines">@@ -593,6 +596,7 @@
</span><span class="cx"> webkit.org/b/116559 storage/websql/ [ Skip ]
</span><span class="cx"> 
</span><span class="cx"> # TODO crypto.subtle is not yet enabled
</span><ins>+crypto/webkitSubtle/ [ Skip ]
</ins><span class="cx"> crypto/subtle/ [ Skip ]
</span><span class="cx"> 
</span><span class="cx"> # TODO Missing WebSpeech implementation
</span></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (203695 => 203696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-07-25 19:57:47 UTC (rev 203695)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-07-25 20:35:16 UTC (rev 203696)
</span><span class="lines">@@ -315,7 +315,7 @@
</span><span class="cx"> 
</span><span class="cx">     crypto/CryptoKey.idl
</span><span class="cx">     crypto/CryptoKeyPair.idl
</span><del>-    crypto/SubtleCrypto.idl
</del><ins>+    crypto/WebKitSubtleCrypto.idl
</ins><span class="cx"> 
</span><span class="cx">     css/CSSCharsetRule.idl
</span><span class="cx">     css/CSSFontFaceLoadEvent.idl
</span><span class="lines">@@ -1210,7 +1210,6 @@
</span><span class="cx">     bindings/js/JSStorageCustom.cpp
</span><span class="cx">     bindings/js/JSStyleSheetCustom.cpp
</span><span class="cx">     bindings/js/JSStyleSheetListCustom.cpp
</span><del>-    bindings/js/JSSubtleCryptoCustom.cpp
</del><span class="cx">     bindings/js/JSTextCustom.cpp
</span><span class="cx">     bindings/js/JSTextTrackCueCustom.cpp
</span><span class="cx">     bindings/js/JSTextTrackCustom.cpp
</span><span class="lines">@@ -1224,6 +1223,7 @@
</span><span class="cx">     bindings/js/JSWebGLRenderingContextBaseCustom.cpp
</span><span class="cx">     bindings/js/JSWebGLRenderingContextCustom.cpp
</span><span class="cx">     bindings/js/JSWebKitPointCustom.cpp
</span><ins>+    bindings/js/JSWebKitSubtleCryptoCustom.cpp
</ins><span class="cx">     bindings/js/JSWorkerCustom.cpp
</span><span class="cx">     bindings/js/JSWorkerGlobalScopeBase.cpp
</span><span class="cx">     bindings/js/JSWorkerGlobalScopeCustom.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (203695 => 203696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-07-25 19:57:47 UTC (rev 203695)
+++ trunk/Source/WebCore/ChangeLog        2016-07-25 20:35:16 UTC (rev 203696)
</span><span class="lines">@@ -1,3 +1,38 @@
</span><ins>+2016-07-25  Jiewen Tan  &lt;jiewen_tan@apple.com&gt;
+
+        Rename SubtleCrypto to WebKitSubtleCrypto
+        https://bugs.webkit.org/show_bug.cgi?id=160067
+        &lt;rdar://problem/27483617&gt;
+
+        Reviewed by Brent Fulgham.
+
+        Tests: crypto/webkitSubtle/gc-2.html
+               crypto/webkitSubtle/gc-3.html
+               crypto/webkitSubtle/gc.html
+
+        Rename Class SubtleCrypto to WebKitSubtleCrypto, and Crypto.subtle to Crypto.webkitSubtle in order
+        to let the new implementation to reuse the name SubtleCrypto. This renaming should match what our
+        current JSBindings use, and therefore should not introduce any change of behavoir.
+
+        * CMakeLists.txt:
+        Revise project files for for new file names.
+        * DerivedSources.cpp:
+        * DerivedSources.make:
+        * PlatformEfl.cmake:
+        * PlatformGTK.cmake:
+        * PlatformMac.cmake:
+        * WebCore.xcodeproj/project.pbxproj:
+        Revise project files for for new file names.
+        * bindings/js/JSWebKitSubtleCryptoCustom.cpp: Renamed from Source/WebCore/bindings/js/JSSubtleCryptoCustom.cpp.
+        * crypto/WebKitSubtleCrypto.cpp: Renamed from Source/WebCore/crypto/SubtleCrypto.cpp.
+        * crypto/WebKitSubtleCrypto.h: Renamed from Source/WebCore/crypto/SubtleCrypto.h.
+        * crypto/WebKitSubtleCrypto.idl: Renamed from Source/WebCore/crypto/SubtleCrypto.idl.
+        * page/Crypto.cpp:
+        (WebCore::Crypto::webkitSubtle):
+        (WebCore::Crypto::subtle): Deleted.
+        * page/Crypto.h:
+        * page/Crypto.idl:
+
</ins><span class="cx"> 2016-07-25  Brady Eidson  &lt;beidson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Allow LocalStorage by default for file URLs.
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.cpp (203695 => 203696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.cpp        2016-07-25 19:57:47 UTC (rev 203695)
+++ trunk/Source/WebCore/DerivedSources.cpp        2016-07-25 20:35:16 UTC (rev 203696)
</span><span class="lines">@@ -427,7 +427,6 @@
</span><span class="cx"> #include &quot;JSSpeechSynthesisEvent.cpp&quot;
</span><span class="cx"> #include &quot;JSSpeechSynthesisUtterance.cpp&quot;
</span><span class="cx"> #include &quot;JSSpeechSynthesisVoice.cpp&quot;
</span><del>-#include &quot;JSSubtleCrypto.cpp&quot;
</del><span class="cx"> #include &quot;JSSQLError.cpp&quot;
</span><span class="cx"> #include &quot;JSSQLException.cpp&quot;
</span><span class="cx"> #include &quot;JSSQLResultSet.cpp&quot;
</span><span class="lines">@@ -646,6 +645,7 @@
</span><span class="cx"> #include &quot;JSWebKitNamespace.cpp&quot;
</span><span class="cx"> #include &quot;JSWebKitPlaybackTargetAvailabilityEvent.cpp&quot;
</span><span class="cx"> #include &quot;JSWebKitPoint.cpp&quot;
</span><ins>+#include &quot;JSWebKitSubtleCrypto.cpp&quot;
</ins><span class="cx"> #include &quot;JSWebKitTransitionEvent.cpp&quot;
</span><span class="cx"> #include &quot;JSWebSocket.cpp&quot;
</span><span class="cx"> #include &quot;JSWheelEvent.cpp&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.make (203695 => 203696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.make        2016-07-25 19:57:47 UTC (rev 203695)
+++ trunk/Source/WebCore/DerivedSources.make        2016-07-25 20:35:16 UTC (rev 203696)
</span><span class="lines">@@ -235,7 +235,7 @@
</span><span class="cx">     $(WebCore)/animation/DocumentTimeline.idl \
</span><span class="cx">     $(WebCore)/crypto/CryptoKey.idl \
</span><span class="cx">     $(WebCore)/crypto/CryptoKeyPair.idl \
</span><del>-    $(WebCore)/crypto/SubtleCrypto.idl \
</del><ins>+    $(WebCore)/crypto/WebKitSubtleCrypto.idl \
</ins><span class="cx">     $(WebCore)/css/CSSCharsetRule.idl \
</span><span class="cx">     $(WebCore)/css/CSSFontFaceLoadEvent.idl \
</span><span class="cx">     $(WebCore)/css/CSSFontFaceRule.idl \
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformEflcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformEfl.cmake (203695 => 203696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformEfl.cmake        2016-07-25 19:57:47 UTC (rev 203695)
+++ trunk/Source/WebCore/PlatformEfl.cmake        2016-07-25 20:35:16 UTC (rev 203696)
</span><span class="lines">@@ -403,7 +403,7 @@
</span><span class="cx">         crypto/CryptoAlgorithmRegistry.cpp
</span><span class="cx">         crypto/CryptoKey.cpp
</span><span class="cx">         crypto/CryptoKeyPair.cpp
</span><del>-        crypto/SubtleCrypto.cpp
</del><ins>+        crypto/WebKitSubtleCrypto.cpp
</ins><span class="cx"> 
</span><span class="cx">         crypto/algorithms/CryptoAlgorithmAES_CBC.cpp
</span><span class="cx">         crypto/algorithms/CryptoAlgorithmAES_KW.cpp
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformGTK.cmake (203695 => 203696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformGTK.cmake        2016-07-25 19:57:47 UTC (rev 203695)
+++ trunk/Source/WebCore/PlatformGTK.cmake        2016-07-25 20:35:16 UTC (rev 203696)
</span><span class="lines">@@ -797,7 +797,7 @@
</span><span class="cx">         crypto/CryptoAlgorithmRegistry.cpp
</span><span class="cx">         crypto/CryptoKey.cpp
</span><span class="cx">         crypto/CryptoKeyPair.cpp
</span><del>-        crypto/SubtleCrypto.cpp
</del><ins>+        crypto/WebKitSubtleCrypto.cpp
</ins><span class="cx"> 
</span><span class="cx">         crypto/algorithms/CryptoAlgorithmAES_CBC.cpp
</span><span class="cx">         crypto/algorithms/CryptoAlgorithmAES_KW.cpp
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformMaccmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformMac.cmake (203695 => 203696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformMac.cmake        2016-07-25 19:57:47 UTC (rev 203695)
+++ trunk/Source/WebCore/PlatformMac.cmake        2016-07-25 20:35:16 UTC (rev 203696)
</span><span class="lines">@@ -196,7 +196,7 @@
</span><span class="cx">     crypto/CryptoAlgorithmRegistry.cpp
</span><span class="cx">     crypto/CryptoKey.cpp
</span><span class="cx">     crypto/CryptoKeyPair.cpp
</span><del>-    crypto/SubtleCrypto.cpp
</del><ins>+    crypto/WebKitSubtleCrypto.cpp
</ins><span class="cx"> 
</span><span class="cx">     crypto/algorithms/CryptoAlgorithmAES_CBC.cpp
</span><span class="cx">     crypto/algorithms/CryptoAlgorithmAES_KW.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (203695 => 203696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-07-25 19:57:47 UTC (rev 203695)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-07-25 20:35:16 UTC (rev 203696)
</span><span class="lines">@@ -2337,6 +2337,11 @@
</span><span class="cx">                 550A0BCA085F6039007353D6 /* QualifiedName.h in Headers */ = {isa = PBXBuildFile; fileRef = 550A0BC8085F6039007353D6 /* QualifiedName.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 555B87EC1CAAF0AB00349425 /* ImageDecoderCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 555B87EA1CAAF0AB00349425 /* ImageDecoderCG.cpp */; };
</span><span class="cx">                 555B87ED1CAAF0AB00349425 /* ImageDecoderCG.h in Headers */ = {isa = PBXBuildFile; fileRef = 555B87EB1CAAF0AB00349425 /* ImageDecoderCG.h */; };
</span><ins>+                5709E8CD1D413D47003244AC /* WebKitSubtleCrypto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5709E8CA1D413CE3003244AC /* WebKitSubtleCrypto.cpp */; };
+                5709E8CE1D413D5B003244AC /* JSWebKitSubtleCryptoCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1FF8F661807460800132674 /* JSWebKitSubtleCryptoCustom.cpp */; };
+                5709E8CF1D413D9A003244AC /* WebKitSubtleCrypto.h in Headers */ = {isa = PBXBuildFile; fileRef = 5709E8CB1D413CE3003244AC /* WebKitSubtleCrypto.h */; };
+                570A99DA1D417408004EC630 /* JSWebKitSubtleCrypto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1FF8F62180745D800132674 /* JSWebKitSubtleCrypto.cpp */; };
+                570A99DB1D41A2F3004EC630 /* JSWebKitSubtleCrypto.h in Headers */ = {isa = PBXBuildFile; fileRef = E1FF8F63180745D800132674 /* JSWebKitSubtleCrypto.h */; };
</ins><span class="cx">                 572A7F211C6E5719009C6149 /* SimulatedClick.h in Headers */ = {isa = PBXBuildFile; fileRef = 572A7F201C6E5719009C6149 /* SimulatedClick.h */; };
</span><span class="cx">                 572A7F231C6E5A66009C6149 /* SimulatedClick.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 572A7F221C6E5A66009C6149 /* SimulatedClick.cpp */; };
</span><span class="cx">                 57EF5E601D20C83900171E60 /* TextCodecReplacement.h in Headers */ = {isa = PBXBuildFile; fileRef = 57EF5E5F1D20C83900171E60 /* TextCodecReplacement.h */; };
</span><span class="lines">@@ -6637,11 +6642,6 @@
</span><span class="cx">                 E1FE137E184D270200892F13 /* CryptoAlgorithmAES_KWMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1FE137C184D270200892F13 /* CryptoAlgorithmAES_KWMac.cpp */; };
</span><span class="cx">                 E1FF57A30F01255B00891EBB /* ThreadGlobalData.h in Headers */ = {isa = PBXBuildFile; fileRef = E1FF57A20F01255B00891EBB /* ThreadGlobalData.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 E1FF57A60F01256B00891EBB /* ThreadGlobalData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1FF57A50F01256B00891EBB /* ThreadGlobalData.cpp */; };
</span><del>-                E1FF8F5F1807442100132674 /* SubtleCrypto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1FF8F5D1807442100132674 /* SubtleCrypto.cpp */; };
-                E1FF8F601807442100132674 /* SubtleCrypto.h in Headers */ = {isa = PBXBuildFile; fileRef = E1FF8F5E1807442100132674 /* SubtleCrypto.h */; };
-                E1FF8F64180745D800132674 /* JSSubtleCrypto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1FF8F62180745D800132674 /* JSSubtleCrypto.cpp */; };
-                E1FF8F65180745D800132674 /* JSSubtleCrypto.h in Headers */ = {isa = PBXBuildFile; fileRef = E1FF8F63180745D800132674 /* JSSubtleCrypto.h */; };
-                E1FF8F681807460800132674 /* JSSubtleCryptoCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1FF8F661807460800132674 /* JSSubtleCryptoCustom.cpp */; };
</del><span class="cx">                 E1FF8F6C180DB5BE00132674 /* CryptoAlgorithmRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1FF8F6A180DB5BE00132674 /* CryptoAlgorithmRegistry.cpp */; };
</span><span class="cx">                 E1FF8F6D180DB5BE00132674 /* CryptoAlgorithmRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = E1FF8F6B180DB5BE00132674 /* CryptoAlgorithmRegistry.h */; };
</span><span class="cx">                 E38838981BAD145F00D62EE3 /* JSModuleLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E38838941BAD145F00D62EE3 /* JSModuleLoader.cpp */; };
</span><span class="lines">@@ -10016,6 +10016,9 @@
</span><span class="cx">                 555B87EA1CAAF0AB00349425 /* ImageDecoderCG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImageDecoderCG.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 555B87EB1CAAF0AB00349425 /* ImageDecoderCG.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageDecoderCG.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 55D408F71A7C631800C78450 /* SVGImageClients.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGImageClients.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                5709E8CA1D413CE3003244AC /* WebKitSubtleCrypto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitSubtleCrypto.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                5709E8CB1D413CE3003244AC /* WebKitSubtleCrypto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitSubtleCrypto.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                5709E8CC1D413CE3003244AC /* WebKitSubtleCrypto.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebKitSubtleCrypto.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 572A7F201C6E5719009C6149 /* SimulatedClick.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimulatedClick.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 572A7F221C6E5A66009C6149 /* SimulatedClick.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimulatedClick.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 57EF5E5F1D20C83900171E60 /* TextCodecReplacement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextCodecReplacement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -13410,8 +13413,8 @@
</span><span class="cx">                 B57CB52C182A3EED0079A647 /* InlineElementBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InlineElementBox.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 B595FF461824CEE300FF51CD /* RenderIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderIterator.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 B59CA59AF170D8FAA5B8C9AD /* MathMLScriptsElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLScriptsElement.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                B59CA59AF170D8FAA5B8CABE /* MathMLPaddedElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLPaddedElement.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 B59CA849D41E6F65D81197AB /* MathMLScriptsElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathMLScriptsElement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                B59CA59AF170D8FAA5B8CABE /* MathMLPaddedElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MathMLPaddedElement.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 B59CA849D41E6F65D81198BC /* MathMLPaddedElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathMLPaddedElement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 B59DD697119029E5007E9684 /* JSDatabaseCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDatabaseCallback.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 B59DD698119029E5007E9684 /* JSDatabaseCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDatabaseCallback.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -14784,12 +14787,9 @@
</span><span class="cx">                 E1FE137C184D270200892F13 /* CryptoAlgorithmAES_KWMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmAES_KWMac.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E1FF57A20F01255B00891EBB /* ThreadGlobalData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadGlobalData.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E1FF57A50F01256B00891EBB /* ThreadGlobalData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadGlobalData.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                E1FF8F5C1807364B00132674 /* SubtleCrypto.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = SubtleCrypto.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
-                E1FF8F5D1807442100132674 /* SubtleCrypto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SubtleCrypto.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                E1FF8F5E1807442100132674 /* SubtleCrypto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SubtleCrypto.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                E1FF8F62180745D800132674 /* JSSubtleCrypto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSubtleCrypto.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                E1FF8F63180745D800132674 /* JSSubtleCrypto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSubtleCrypto.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                E1FF8F661807460800132674 /* JSSubtleCryptoCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSubtleCryptoCustom.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                E1FF8F62180745D800132674 /* JSWebKitSubtleCrypto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitSubtleCrypto.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                E1FF8F63180745D800132674 /* JSWebKitSubtleCrypto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebKitSubtleCrypto.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                E1FF8F661807460800132674 /* JSWebKitSubtleCryptoCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitSubtleCryptoCustom.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 E1FF8F6A180DB5BE00132674 /* CryptoAlgorithmRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmRegistry.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E1FF8F6B180DB5BE00132674 /* CryptoAlgorithmRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmRegistry.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E38838941BAD145F00D62EE3 /* JSModuleLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSModuleLoader.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -22769,7 +22769,6 @@
</span><span class="cx">                                 BC98A27C0C0C9950004BEBF7 /* JSStyleSheetCustom.cpp */,
</span><span class="cx">                                 AD726FEC16D9F4B9003A4E6D /* JSStyleSheetCustom.h */,
</span><span class="cx">                                 A84EBD770CB8C89200079609 /* JSStyleSheetListCustom.cpp */,
</span><del>-                                E1FF8F661807460800132674 /* JSSubtleCryptoCustom.cpp */,
</del><span class="cx">                                 08E4FE450E2BD41400F4CAE0 /* JSSVGLengthCustom.cpp */,
</span><span class="cx">                                 B2C96D8C0B3AF2B7005E80EC /* JSSVGPathSegCustom.cpp */,
</span><span class="cx">                                 07E117061489EBEB00EC5ACE /* JSTextTrackCueCustom.cpp */,
</span><span class="lines">@@ -22785,6 +22784,7 @@
</span><span class="cx">                                 D3F3D3591A69A3B00059FC2B /* JSWebGL2RenderingContextCustom.cpp */,
</span><span class="cx">                                 D3F3D35A1A69A3B00059FC2B /* JSWebGLRenderingContextBaseCustom.cpp */,
</span><span class="cx">                                 49EED14C1051971A00099FAB /* JSWebGLRenderingContextCustom.cpp */,
</span><ins>+                                E1FF8F661807460800132674 /* JSWebKitSubtleCryptoCustom.cpp */,
</ins><span class="cx">                                 BC275B7811C5D1C300C9206C /* JSWebKitPointCustom.cpp */,
</span><span class="cx">                                 E1CA5CBB0E8CDCAF00E8EF90 /* JSWorkerCustom.cpp */,
</span><span class="cx">                                 E18258AB0EF3CD7000933242 /* JSWorkerGlobalScopeCustom.cpp */,
</span><span class="lines">@@ -23794,9 +23794,9 @@
</span><span class="cx">                                 E19727151820549E00592D51 /* CryptoKeyType.h */,
</span><span class="cx">                                 E172AF6F180F289500FBADB9 /* CryptoKeyUsage.h */,
</span><span class="cx">                                 E18DF33418AAF12C00773E59 /* SerializedCryptoKeyWrap.h */,
</span><del>-                                E1FF8F5D1807442100132674 /* SubtleCrypto.cpp */,
-                                E1FF8F5E1807442100132674 /* SubtleCrypto.h */,
-                                E1FF8F5C1807364B00132674 /* SubtleCrypto.idl */,
</del><ins>+                                5709E8CA1D413CE3003244AC /* WebKitSubtleCrypto.cpp */,
+                                5709E8CB1D413CE3003244AC /* WebKitSubtleCrypto.h */,
+                                5709E8CC1D413CE3003244AC /* WebKitSubtleCrypto.idl */,
</ins><span class="cx">                         );
</span><span class="cx">                         path = crypto;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -23808,8 +23808,8 @@
</span><span class="cx">                                 E157A8DF1817331C009F821D /* JSCryptoKey.h */,
</span><span class="cx">                                 E1F80B8B183172B5007885C3 /* JSCryptoKeyPair.cpp */,
</span><span class="cx">                                 E1F80B8C183172B5007885C3 /* JSCryptoKeyPair.h */,
</span><del>-                                E1FF8F62180745D800132674 /* JSSubtleCrypto.cpp */,
-                                E1FF8F63180745D800132674 /* JSSubtleCrypto.h */,
</del><ins>+                                E1FF8F62180745D800132674 /* JSWebKitSubtleCrypto.cpp */,
+                                E1FF8F63180745D800132674 /* JSWebKitSubtleCrypto.h */,
</ins><span class="cx">                         );
</span><span class="cx">                         name = Crypto;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -26581,6 +26581,8 @@
</span><span class="cx">                                 A871D4560A127CBC00B12A68 /* HTMLPlugInElement.h in Headers */,
</span><span class="cx">                                 4415292E0E1AE8A000C4A2D0 /* HTMLPlugInImageElement.h in Headers */,
</span><span class="cx">                                 A8EA7CB00A192B9C00A8EF5F /* HTMLPreElement.h in Headers */,
</span><ins>+                                570A99DB1D41A2F3004EC630 /* JSWebKitSubtleCrypto.h in Headers */,
+                                5709E8CF1D413D9A003244AC /* WebKitSubtleCrypto.h in Headers */,
</ins><span class="cx">                                 977B3873122883E900B81FF8 /* HTMLPreloadScanner.h in Headers */,
</span><span class="cx">                                 A43BF5991149290A00C643CA /* HTMLProgressElement.h in Headers */,
</span><span class="cx">                                 A8CFF7A30A156978000A4234 /* HTMLQuoteElement.h in Headers */,
</span><span class="lines">@@ -27147,7 +27149,6 @@
</span><span class="cx">                                 BCE0139B0C0BEF180043860A /* JSStyleSheet.h in Headers */,
</span><span class="cx">                                 AD726FEE16DA11BC003A4E6D /* JSStyleSheetCustom.h in Headers */,
</span><span class="cx">                                 A84EBD830CB8C97700079609 /* JSStyleSheetList.h in Headers */,
</span><del>-                                E1FF8F65180745D800132674 /* JSSubtleCrypto.h in Headers */,
</del><span class="cx">                                 B20111080AB7740500DB0E68 /* JSSVGAElement.h in Headers */,
</span><span class="cx">                                 24D9129213CA951E00D21915 /* JSSVGAltGlyphDefElement.h in Headers */,
</span><span class="cx">                                 6515EC920D9723FF0063D49A /* JSSVGAltGlyphElement.h in Headers */,
</span><span class="lines">@@ -28377,7 +28378,6 @@
</span><span class="cx">                                 1AE96A931D1A0DDD00B86768 /* JSApplePayShippingMethodSelectedEvent.h in Headers */,
</span><span class="cx">                                 1A8F6B020DB53006001DB794 /* SubstituteResource.h in Headers */,
</span><span class="cx">                                 1AE96A8B1D1A0DDD00B86768 /* JSApplePayPaymentAuthorizedEvent.h in Headers */,
</span><del>-                                E1FF8F601807442100132674 /* SubtleCrypto.h in Headers */,
</del><span class="cx">                                 93B2D8160F9920D2006AE6B2 /* SuddenTermination.h in Headers */,
</span><span class="cx">                                 97C078501165D5BE003A32EF /* SuffixTree.h in Headers */,
</span><span class="cx">                                 97627B9814FB5424002CDCA1 /* Supplementable.h in Headers */,
</span><span class="lines">@@ -29324,6 +29324,8 @@
</span><span class="cx">                         isa = PBXSourcesBuildPhase;
</span><span class="cx">                         buildActionMask = 2147483647;
</span><span class="cx">                         files = (
</span><ins>+                                5709E8CE1D413D5B003244AC /* JSWebKitSubtleCryptoCustom.cpp in Sources */,
+                                5709E8CD1D413D47003244AC /* WebKitSubtleCrypto.cpp in Sources */,
</ins><span class="cx">                                 41E1B1D00FF5986900576B3B /* AbstractWorker.cpp in Sources */,
</span><span class="cx">                                 37F57AB91A50726900876F98 /* AccessibilityARIAGrid.cpp in Sources */,
</span><span class="cx">                                 37F57ABA1A50726F00876F98 /* AccessibilityARIAGridCell.cpp in Sources */,
</span><span class="lines">@@ -30347,6 +30349,7 @@
</span><span class="cx">                                 0707568B142262D600414161 /* HTMLTrackElement.cpp in Sources */,
</span><span class="cx">                                 977B37251228721700B81FF8 /* HTMLTreeBuilder.cpp in Sources */,
</span><span class="cx">                                 A8EA79F30A1916DF00A8EF5F /* HTMLUListElement.cpp in Sources */,
</span><ins>+                                570A99DA1D417408004EC630 /* JSWebKitSubtleCrypto.cpp in Sources */,
</ins><span class="cx">                                 E44613AA0CD6331000FADA75 /* HTMLVideoElement.cpp in Sources */,
</span><span class="cx">                                 839AAFEC1A0C0C8D00605F99 /* HTMLWBRElement.cpp in Sources */,
</span><span class="cx">                                 0B8C56D40F28627F000502E1 /* HTTPHeaderMap.cpp in Sources */,
</span><span class="lines">@@ -30959,8 +30962,6 @@
</span><span class="cx">                                 BC98A27D0C0C9950004BEBF7 /* JSStyleSheetCustom.cpp in Sources */,
</span><span class="cx">                                 A84EBD840CB8C97700079609 /* JSStyleSheetList.cpp in Sources */,
</span><span class="cx">                                 A84EBD780CB8C89200079609 /* JSStyleSheetListCustom.cpp in Sources */,
</span><del>-                                E1FF8F64180745D800132674 /* JSSubtleCrypto.cpp in Sources */,
-                                E1FF8F681807460800132674 /* JSSubtleCryptoCustom.cpp in Sources */,
</del><span class="cx">                                 B20111070AB7740500DB0E68 /* JSSVGAElement.cpp in Sources */,
</span><span class="cx">                                 24D9129113CA951E00D21915 /* JSSVGAltGlyphDefElement.cpp in Sources */,
</span><span class="cx">                                 6515EC910D9723FF0063D49A /* JSSVGAltGlyphElement.cpp in Sources */,
</span><span class="lines">@@ -32019,7 +32020,6 @@
</span><span class="cx">                                 93E227E40AF589AD00D48324 /* SubresourceLoader.cpp in Sources */,
</span><span class="cx">                                 7E37EF2E1339208800B29250 /* SubresourceLoaderCF.cpp in Sources */,
</span><span class="cx">                                 7E8FADC4199A95B100714968 /* SubresourceLoaderCocoa.mm in Sources */,
</span><del>-                                E1FF8F5F1807442100132674 /* SubtleCrypto.cpp in Sources */,
</del><span class="cx">                                 93B2D8180F9920EE006AE6B2 /* SuddenTermination.mm in Sources */,
</span><span class="cx">                                 087558C513B4A57D00F49307 /* SurrogatePairAwareTextIterator.cpp in Sources */,
</span><span class="cx">                                 62C1217C11AB9E77003C462C /* SuspendableTimer.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSSubtleCryptoCustomcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/bindings/js/JSSubtleCryptoCustom.cpp (203695 => 203696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSSubtleCryptoCustom.cpp        2016-07-25 19:57:47 UTC (rev 203695)
+++ trunk/Source/WebCore/bindings/js/JSSubtleCryptoCustom.cpp        2016-07-25 20:35:16 UTC (rev 203696)
</span><span class="lines">@@ -1,805 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include &quot;config.h&quot;
-#include &quot;JSSubtleCrypto.h&quot;
-
-#if ENABLE(SUBTLE_CRYPTO)
-
-#include &quot;CryptoAlgorithm.h&quot;
-#include &quot;CryptoAlgorithmParameters.h&quot;
-#include &quot;CryptoAlgorithmRegistry.h&quot;
-#include &quot;CryptoKeyData.h&quot;
-#include &quot;CryptoKeySerializationRaw.h&quot;
-#include &quot;Document.h&quot;
-#include &quot;ExceptionCode.h&quot;
-#include &quot;JSCryptoAlgorithmDictionary.h&quot;
-#include &quot;JSCryptoKey.h&quot;
-#include &quot;JSCryptoKeyPair.h&quot;
-#include &quot;JSCryptoKeySerializationJWK.h&quot;
-#include &quot;JSCryptoOperationData.h&quot;
-#include &quot;JSDOMPromise.h&quot;
-#include &lt;runtime/Error.h&gt;
-
-using namespace JSC;
-
-namespace WebCore {
-
-enum class CryptoKeyFormat {
-    // An unformatted sequence of bytes. Intended for secret keys.
-    Raw,
-
-    // The DER encoding of the PrivateKeyInfo structure from RFC 5208.
-    PKCS8,
-
-    // The DER encoding of the SubjectPublicKeyInfo structure from RFC 5280.
-    SPKI,
-
-    // The key is represented as JSON according to the JSON Web Key format.
-    JWK
-};
-
-static RefPtr&lt;CryptoAlgorithm&gt; createAlgorithmFromJSValue(ExecState&amp; state, JSValue value)
-{
-    CryptoAlgorithmIdentifier algorithmIdentifier;
-    if (!JSCryptoAlgorithmDictionary::getAlgorithmIdentifier(&amp;state, value, algorithmIdentifier)) {
-        ASSERT(state.hadException());
-        return nullptr;
-    }
-
-    auto result = CryptoAlgorithmRegistry::singleton().create(algorithmIdentifier);
-    if (!result)
-        setDOMException(&amp;state, NOT_SUPPORTED_ERR);
-    return result;
-}
-
-static bool cryptoKeyFormatFromJSValue(ExecState&amp; state, JSValue value, CryptoKeyFormat&amp; result)
-{
-    String keyFormatString = value.toString(&amp;state)-&gt;value(&amp;state);
-    if (state.hadException())
-        return false;
-    if (keyFormatString == &quot;raw&quot;)
-        result = CryptoKeyFormat::Raw;
-    else if (keyFormatString == &quot;pkcs8&quot;)
-        result = CryptoKeyFormat::PKCS8;
-    else if (keyFormatString == &quot;spki&quot;)
-        result = CryptoKeyFormat::SPKI;
-    else if (keyFormatString == &quot;jwk&quot;)
-        result = CryptoKeyFormat::JWK;
-    else {
-        throwTypeError(&amp;state, ASCIILiteral(&quot;Unknown key format&quot;));
-        return false;
-    }
-    return true;
-}
-
-static bool cryptoKeyUsagesFromJSValue(ExecState&amp; state, JSValue value, CryptoKeyUsage&amp; result)
-{
-    if (!isJSArray(value)) {
-        throwTypeError(&amp;state);
-        return false;
-    }
-
-    result = 0;
-
-    JSArray* array = asArray(value);
-    for (size_t i = 0; i &lt; array-&gt;length(); ++i) {
-        JSValue element = array-&gt;getIndex(&amp;state, i);
-        String usageString = element.toString(&amp;state)-&gt;value(&amp;state);
-        if (state.hadException())
-            return false;
-        if (usageString == &quot;encrypt&quot;)
-            result |= CryptoKeyUsageEncrypt;
-        else if (usageString == &quot;decrypt&quot;)
-            result |= CryptoKeyUsageDecrypt;
-        else if (usageString == &quot;sign&quot;)
-            result |= CryptoKeyUsageSign;
-        else if (usageString == &quot;verify&quot;)
-            result |= CryptoKeyUsageVerify;
-        else if (usageString == &quot;deriveKey&quot;)
-            result |= CryptoKeyUsageDeriveKey;
-        else if (usageString == &quot;deriveBits&quot;)
-            result |= CryptoKeyUsageDeriveBits;
-        else if (usageString == &quot;wrapKey&quot;)
-            result |= CryptoKeyUsageWrapKey;
-        else if (usageString == &quot;unwrapKey&quot;)
-            result |= CryptoKeyUsageUnwrapKey;
-    }
-    return true;
-}
-
-JSValue JSSubtleCrypto::encrypt(ExecState&amp; state)
-{
-    if (state.argumentCount() &lt; 3)
-        return state.vm().throwException(&amp;state, createNotEnoughArgumentsError(&amp;state));
-
-    auto algorithm = createAlgorithmFromJSValue(state, state.uncheckedArgument(0));
-    if (!algorithm) {
-        ASSERT(state.hadException());
-        return jsUndefined();
-    }
-
-    auto parameters = JSCryptoAlgorithmDictionary::createParametersForEncrypt(&amp;state, algorithm-&gt;identifier(), state.uncheckedArgument(0));
-    if (!parameters) {
-        ASSERT(state.hadException());
-        return jsUndefined();
-    }
-
-    RefPtr&lt;CryptoKey&gt; key = JSCryptoKey::toWrapped(state.uncheckedArgument(1));
-    if (!key)
-        return throwTypeError(&amp;state);
-
-    if (!key-&gt;allows(CryptoKeyUsageEncrypt)) {
-        wrapped().document()-&gt;addConsoleMessage(MessageSource::JS, MessageLevel::Error, ASCIILiteral(&quot;Key usages do not include 'encrypt'&quot;));
-        setDOMException(&amp;state, NOT_SUPPORTED_ERR);
-        return jsUndefined();
-    }
-
-    CryptoOperationData data;
-    if (!cryptoOperationDataFromJSValue(&amp;state, state.uncheckedArgument(2), data)) {
-        ASSERT(state.hadException());
-        return jsUndefined();
-    }
-
-    
-    JSPromiseDeferred* promiseDeferred = JSPromiseDeferred::create(&amp;state, globalObject());
-    DeferredWrapper wrapper(&amp;state, globalObject(), promiseDeferred);
-    auto successCallback = [wrapper](const Vector&lt;uint8_t&gt;&amp; result) mutable {
-        fulfillPromiseWithArrayBuffer(wrapper, result.data(), result.size());
-    };
-    auto failureCallback = [wrapper]() mutable {
-        wrapper.reject(nullptr);
-    };
-
-    ExceptionCode ec = 0;
-    algorithm-&gt;encrypt(*parameters, *key, data, WTFMove(successCallback), WTFMove(failureCallback), ec);
-    if (ec) {
-        setDOMException(&amp;state, ec);
-        return jsUndefined();
-    }
-
-    return promiseDeferred-&gt;promise();
-}
-
-JSValue JSSubtleCrypto::decrypt(ExecState&amp; state)
-{
-    if (state.argumentCount() &lt; 3)
-        return state.vm().throwException(&amp;state, createNotEnoughArgumentsError(&amp;state));
-
-    auto algorithm = createAlgorithmFromJSValue(state, state.uncheckedArgument(0));
-    if (!algorithm) {
-        ASSERT(state.hadException());
-        return jsUndefined();
-    }
-
-    auto parameters = JSCryptoAlgorithmDictionary::createParametersForDecrypt(&amp;state, algorithm-&gt;identifier(), state.uncheckedArgument(0));
-    if (!parameters) {
-        ASSERT(state.hadException());
-        return jsUndefined();
-    }
-
-    RefPtr&lt;CryptoKey&gt; key = JSCryptoKey::toWrapped(state.uncheckedArgument(1));
-    if (!key)
-        return throwTypeError(&amp;state);
-
-    if (!key-&gt;allows(CryptoKeyUsageDecrypt)) {
-        wrapped().document()-&gt;addConsoleMessage(MessageSource::JS, MessageLevel::Error, ASCIILiteral(&quot;Key usages do not include 'decrypt'&quot;));
-        setDOMException(&amp;state, NOT_SUPPORTED_ERR);
-        return jsUndefined();
-    }
-
-    CryptoOperationData data;
-    if (!cryptoOperationDataFromJSValue(&amp;state, state.uncheckedArgument(2), data)) {
-        ASSERT(state.hadException());
-        return jsUndefined();
-    }
-
-    JSPromiseDeferred* promiseDeferred = JSPromiseDeferred::create(&amp;state, globalObject());
-    DeferredWrapper wrapper(&amp;state, globalObject(), promiseDeferred);
-    auto successCallback = [wrapper](const Vector&lt;uint8_t&gt;&amp; result) mutable {
-        fulfillPromiseWithArrayBuffer(wrapper, result.data(), result.size());
-    };
-    auto failureCallback = [wrapper]() mutable {
-        wrapper.reject(nullptr);
-    };
-
-    ExceptionCode ec = 0;
-    algorithm-&gt;decrypt(*parameters, *key, data, WTFMove(successCallback), WTFMove(failureCallback), ec);
-    if (ec) {
-        setDOMException(&amp;state, ec);
-        return jsUndefined();
-    }
-
-    return promiseDeferred-&gt;promise();
-}
-
-JSValue JSSubtleCrypto::sign(ExecState&amp; state)
-{
-    if (state.argumentCount() &lt; 3)
-        return state.vm().throwException(&amp;state, createNotEnoughArgumentsError(&amp;state));
-
-    auto algorithm = createAlgorithmFromJSValue(state, state.uncheckedArgument(0));
-    if (!algorithm) {
-        ASSERT(state.hadException());
-        return jsUndefined();
-    }
-
-    auto parameters = JSCryptoAlgorithmDictionary::createParametersForSign(&amp;state, algorithm-&gt;identifier(), state.uncheckedArgument(0));
-    if (!parameters) {
-        ASSERT(state.hadException());
-        return jsUndefined();
-    }
-
-    RefPtr&lt;CryptoKey&gt; key = JSCryptoKey::toWrapped(state.uncheckedArgument(1));
-    if (!key)
-        return throwTypeError(&amp;state);
-
-    if (!key-&gt;allows(CryptoKeyUsageSign)) {
-        wrapped().document()-&gt;addConsoleMessage(MessageSource::JS, MessageLevel::Error, ASCIILiteral(&quot;Key usages do not include 'sign'&quot;));
-        setDOMException(&amp;state, NOT_SUPPORTED_ERR);
-        return jsUndefined();
-    }
-
-    CryptoOperationData data;
-    if (!cryptoOperationDataFromJSValue(&amp;state, state.uncheckedArgument(2), data)) {
-        ASSERT(state.hadException());
-        return jsUndefined();
-    }
-
-    JSPromiseDeferred* promiseDeferred = JSPromiseDeferred::create(&amp;state, globalObject());
-    DeferredWrapper wrapper(&amp;state, globalObject(), promiseDeferred);
-    auto successCallback = [wrapper](const Vector&lt;uint8_t&gt;&amp; result) mutable {
-        fulfillPromiseWithArrayBuffer(wrapper, result.data(), result.size());
-    };
-    auto failureCallback = [wrapper]() mutable {
-        wrapper.reject(nullptr);
-    };
-
-    ExceptionCode ec = 0;
-    algorithm-&gt;sign(*parameters, *key, data, WTFMove(successCallback), WTFMove(failureCallback), ec);
-    if (ec) {
-        setDOMException(&amp;state, ec);
-        return jsUndefined();
-    }
-
-    return promiseDeferred-&gt;promise();
-}
-
-JSValue JSSubtleCrypto::verify(ExecState&amp; state)
-{
-    if (state.argumentCount() &lt; 4)
-        return state.vm().throwException(&amp;state, createNotEnoughArgumentsError(&amp;state));
-
-    auto algorithm = createAlgorithmFromJSValue(state, state.uncheckedArgument(0));
-    if (!algorithm) {
-        ASSERT(state.hadException());
-        return jsUndefined();
-    }
-
-    auto parameters = JSCryptoAlgorithmDictionary::createParametersForVerify(&amp;state, algorithm-&gt;identifier(), state.uncheckedArgument(0));
-    if (!parameters) {
-        ASSERT(state.hadException());
-        return jsUndefined();
-    }
-
-    RefPtr&lt;CryptoKey&gt; key = JSCryptoKey::toWrapped(state.uncheckedArgument(1));
-    if (!key)
-        return throwTypeError(&amp;state);
-
-    if (!key-&gt;allows(CryptoKeyUsageVerify)) {
-        wrapped().document()-&gt;addConsoleMessage(MessageSource::JS, MessageLevel::Error, ASCIILiteral(&quot;Key usages do not include 'verify'&quot;));
-        setDOMException(&amp;state, NOT_SUPPORTED_ERR);
-        return jsUndefined();
-    }
-
-    CryptoOperationData signature;
-    if (!cryptoOperationDataFromJSValue(&amp;state, state.uncheckedArgument(2), signature)) {
-        ASSERT(state.hadException());
-        return jsUndefined();
-    }
-
-    CryptoOperationData data;
-    if (!cryptoOperationDataFromJSValue(&amp;state, state.uncheckedArgument(3), data)) {
-        ASSERT(state.hadException());
-        return jsUndefined();
-    }
-
-    JSPromiseDeferred* promiseDeferred = JSPromiseDeferred::create(&amp;state, globalObject());
-    DeferredWrapper wrapper(&amp;state, globalObject(), promiseDeferred);
-    auto successCallback = [wrapper](bool result) mutable {
-        wrapper.resolve(result);
-    };
-    auto failureCallback = [wrapper]() mutable {
-        wrapper.reject(nullptr);
-    };
-
-    ExceptionCode ec = 0;
-    algorithm-&gt;verify(*parameters, *key, signature, data, WTFMove(successCallback), WTFMove(failureCallback), ec);
-    if (ec) {
-        setDOMException(&amp;state, ec);
-        return jsUndefined();
-    }
-
-    return promiseDeferred-&gt;promise();
-}
-
-JSValue JSSubtleCrypto::digest(ExecState&amp; state)
-{
-    if (state.argumentCount() &lt; 2)
-        return state.vm().throwException(&amp;state, createNotEnoughArgumentsError(&amp;state));
-
-    auto algorithm = createAlgorithmFromJSValue(state, state.uncheckedArgument(0));
-    if (!algorithm) {
-        ASSERT(state.hadException());
-        return jsUndefined();
-    }
-
-    auto parameters = JSCryptoAlgorithmDictionary::createParametersForDigest(&amp;state, algorithm-&gt;identifier(), state.uncheckedArgument(0));
-    if (!parameters) {
-        ASSERT(state.hadException());
-        return jsUndefined();
-    }
-
-    CryptoOperationData data;
-    if (!cryptoOperationDataFromJSValue(&amp;state, state.uncheckedArgument(1), data)) {
-        ASSERT(state.hadException());
-        return jsUndefined();
-    }
-
-    JSPromiseDeferred* promiseDeferred = JSPromiseDeferred::create(&amp;state, globalObject());
-    DeferredWrapper wrapper(&amp;state, globalObject(), promiseDeferred);
-    auto successCallback = [wrapper](const Vector&lt;uint8_t&gt;&amp; result) mutable {
-        fulfillPromiseWithArrayBuffer(wrapper, result.data(), result.size());
-    };
-    auto failureCallback = [wrapper]() mutable {
-        wrapper.reject(nullptr);
-    };
-
-    ExceptionCode ec = 0;
-    algorithm-&gt;digest(*parameters, data, WTFMove(successCallback), WTFMove(failureCallback), ec);
-    if (ec) {
-        setDOMException(&amp;state, ec);
-        return jsUndefined();
-    }
-
-    return promiseDeferred-&gt;promise();
-}
-
-JSValue JSSubtleCrypto::generateKey(ExecState&amp; state)
-{
-    if (state.argumentCount() &lt; 1)
-        return state.vm().throwException(&amp;state, createNotEnoughArgumentsError(&amp;state));
-
-    auto algorithm = createAlgorithmFromJSValue(state, state.uncheckedArgument(0));
-    if (!algorithm) {
-        ASSERT(state.hadException());
-        return jsUndefined();
-    }
-
-    auto parameters = JSCryptoAlgorithmDictionary::createParametersForGenerateKey(&amp;state, algorithm-&gt;identifier(), state.uncheckedArgument(0));
-    if (!parameters) {
-        ASSERT(state.hadException());
-        return jsUndefined();
-    }
-
-    bool extractable = false;
-    if (state.argumentCount() &gt;= 2) {
-        extractable = state.uncheckedArgument(1).toBoolean(&amp;state);
-        if (state.hadException())
-            return jsUndefined();
-    }
-
-    CryptoKeyUsage keyUsages = 0;
-    if (state.argumentCount() &gt;= 3) {
-        if (!cryptoKeyUsagesFromJSValue(state, state.argument(2), keyUsages)) {
-            ASSERT(state.hadException());
-            return jsUndefined();
-        }
-    }
-
-    JSPromiseDeferred* promiseDeferred = JSPromiseDeferred::create(&amp;state, globalObject());
-    DeferredWrapper wrapper(&amp;state, globalObject(), promiseDeferred);
-    auto successCallback = [wrapper](CryptoKey* key, CryptoKeyPair* keyPair) mutable {
-        ASSERT(key || keyPair);
-        ASSERT(!key || !keyPair);
-        if (key)
-            wrapper.resolve(key);
-        else
-            wrapper.resolve(keyPair);
-    };
-    auto failureCallback = [wrapper]() mutable {
-        wrapper.reject(nullptr);
-    };
-
-    ExceptionCode ec = 0;
-    algorithm-&gt;generateKey(*parameters, extractable, keyUsages, WTFMove(successCallback), WTFMove(failureCallback), ec);
-    if (ec) {
-        setDOMException(&amp;state, ec);
-        return jsUndefined();
-    }
-
-    return promiseDeferred-&gt;promise();
-}
-
-static void importKey(ExecState&amp; state, CryptoKeyFormat keyFormat, CryptoOperationData data, RefPtr&lt;CryptoAlgorithm&gt; algorithm, RefPtr&lt;CryptoAlgorithmParameters&gt; parameters, bool extractable, CryptoKeyUsage keyUsages, CryptoAlgorithm::KeyCallback callback, CryptoAlgorithm::VoidCallback failureCallback)
-{
-    std::unique_ptr&lt;CryptoKeySerialization&gt; keySerialization;
-    switch (keyFormat) {
-    case CryptoKeyFormat::Raw:
-        keySerialization = CryptoKeySerializationRaw::create(data);
-        break;
-    case CryptoKeyFormat::JWK: {
-        String jwkString = String::fromUTF8(data.first, data.second);
-        if (jwkString.isNull()) {
-            throwTypeError(&amp;state, ASCIILiteral(&quot;JWK JSON serialization is not valid UTF-8&quot;));
-            return;
-        }
-        keySerialization = std::make_unique&lt;JSCryptoKeySerializationJWK&gt;(&amp;state, jwkString);
-        if (state.hadException())
-            return;
-        break;
-    }
-    default:
-        throwTypeError(&amp;state, ASCIILiteral(&quot;Unsupported key format for import&quot;));
-        return;
-    }
-
-    ASSERT(keySerialization);
-
-    Optional&lt;CryptoAlgorithmPair&gt; reconciledResult = keySerialization-&gt;reconcileAlgorithm(algorithm.get(), parameters.get());
-    if (!reconciledResult) {
-        if (!state.hadException())
-            throwTypeError(&amp;state, ASCIILiteral(&quot;Algorithm specified in key is not compatible with one passed to importKey as argument&quot;));
-        return;
-    }
-    if (state.hadException())
-        return;
-
-    algorithm = reconciledResult-&gt;algorithm;
-    parameters = reconciledResult-&gt;parameters;
-    if (!algorithm) {
-        throwTypeError(&amp;state, ASCIILiteral(&quot;Neither key nor function argument has crypto algorithm specified&quot;));
-        return;
-    }
-    ASSERT(parameters);
-
-    keySerialization-&gt;reconcileExtractable(extractable);
-    if (state.hadException())
-        return;
-
-    keySerialization-&gt;reconcileUsages(keyUsages);
-    if (state.hadException())
-        return;
-
-    auto keyData = keySerialization-&gt;keyData();
-    if (state.hadException())
-        return;
-
-    ExceptionCode ec = 0;
-    algorithm-&gt;importKey(*parameters, *keyData, extractable, keyUsages, WTFMove(callback), WTFMove(failureCallback), ec);
-    if (ec)
-        setDOMException(&amp;state, ec);
-}
-
-JSValue JSSubtleCrypto::importKey(ExecState&amp; state)
-{
-    if (state.argumentCount() &lt; 3)
-        return state.vm().throwException(&amp;state, createNotEnoughArgumentsError(&amp;state));
-
-    CryptoKeyFormat keyFormat;
-    if (!cryptoKeyFormatFromJSValue(state, state.argument(0), keyFormat)) {
-        ASSERT(state.hadException());
-        return jsUndefined();
-    }
-
-    CryptoOperationData data;
-    if (!cryptoOperationDataFromJSValue(&amp;state, state.uncheckedArgument(1), data)) {
-        ASSERT(state.hadException());
-        return jsUndefined();
-    }
-
-    RefPtr&lt;CryptoAlgorithm&gt; algorithm;
-    RefPtr&lt;CryptoAlgorithmParameters&gt; parameters;
-    if (!state.uncheckedArgument(2).isNull()) {
-        algorithm = createAlgorithmFromJSValue(state, state.uncheckedArgument(2));
-        if (!algorithm) {
-            ASSERT(state.hadException());
-            return jsUndefined();
-        }
-        parameters = JSCryptoAlgorithmDictionary::createParametersForImportKey(&amp;state, algorithm-&gt;identifier(), state.uncheckedArgument(2));
-        if (!parameters) {
-            ASSERT(state.hadException());
-            return jsUndefined();
-        }
-    }
-
-    bool extractable = false;
-    if (state.argumentCount() &gt;= 4) {
-        extractable = state.uncheckedArgument(3).toBoolean(&amp;state);
-        if (state.hadException())
-            return jsUndefined();
-    }
-
-    CryptoKeyUsage keyUsages = 0;
-    if (state.argumentCount() &gt;= 5) {
-        if (!cryptoKeyUsagesFromJSValue(state, state.argument(4), keyUsages)) {
-            ASSERT(state.hadException());
-            return jsUndefined();
-        }
-    }
-
-    JSPromiseDeferred* promiseDeferred = JSPromiseDeferred::create(&amp;state, globalObject());
-    DeferredWrapper wrapper(&amp;state, globalObject(), promiseDeferred);
-    auto successCallback = [wrapper](CryptoKey&amp; result) mutable {
-        wrapper.resolve(result);
-    };
-    auto failureCallback = [wrapper]() mutable {
-        wrapper.reject(nullptr);
-    };
-
-    WebCore::importKey(state, keyFormat, data, WTFMove(algorithm), WTFMove(parameters), extractable, keyUsages, WTFMove(successCallback), WTFMove(failureCallback));
-    if (state.hadException())
-        return jsUndefined();
-
-    return promiseDeferred-&gt;promise();
-}
-
-static void exportKey(ExecState&amp; state, CryptoKeyFormat keyFormat, const CryptoKey&amp; key, CryptoAlgorithm::VectorCallback callback, CryptoAlgorithm::VoidCallback failureCallback)
-{
-    if (!key.extractable()) {
-        throwTypeError(&amp;state, ASCIILiteral(&quot;Key is not extractable&quot;));
-        return;
-    }
-
-    switch (keyFormat) {
-    case CryptoKeyFormat::Raw: {
-        Vector&lt;uint8_t&gt; result;
-        if (CryptoKeySerializationRaw::serialize(key, result))
-            callback(result);
-        else
-            failureCallback();
-        break;
-    }
-    case CryptoKeyFormat::JWK: {
-        String result = JSCryptoKeySerializationJWK::serialize(&amp;state, key);
-        if (state.hadException())
-            return;
-        CString utf8String = result.utf8(StrictConversion);
-        Vector&lt;uint8_t&gt; resultBuffer;
-        resultBuffer.append(utf8String.data(), utf8String.length());
-        callback(resultBuffer);
-        break;
-    }
-    default:
-        throwTypeError(&amp;state, ASCIILiteral(&quot;Unsupported key format for export&quot;));
-        break;
-    }
-}
-
-JSValue JSSubtleCrypto::exportKey(ExecState&amp; state)
-{
-    if (state.argumentCount() &lt; 2)
-        return state.vm().throwException(&amp;state, createNotEnoughArgumentsError(&amp;state));
-
-    CryptoKeyFormat keyFormat;
-    if (!cryptoKeyFormatFromJSValue(state, state.argument(0), keyFormat)) {
-        ASSERT(state.hadException());
-        return jsUndefined();
-    }
-
-    RefPtr&lt;CryptoKey&gt; key = JSCryptoKey::toWrapped(state.uncheckedArgument(1));
-    if (!key)
-        return throwTypeError(&amp;state);
-
-    JSPromiseDeferred* promiseDeferred = JSPromiseDeferred::create(&amp;state, globalObject());
-    DeferredWrapper wrapper(&amp;state, globalObject(), promiseDeferred);
-    auto successCallback = [wrapper](const Vector&lt;uint8_t&gt;&amp; result) mutable {
-        fulfillPromiseWithArrayBuffer(wrapper, result.data(), result.size());
-    };
-    auto failureCallback = [wrapper]() mutable {
-        wrapper.reject(nullptr);
-    };
-
-    WebCore::exportKey(state, keyFormat, *key, WTFMove(successCallback), WTFMove(failureCallback));
-    if (state.hadException())
-        return jsUndefined();
-
-    return promiseDeferred-&gt;promise();
-}
-
-JSValue JSSubtleCrypto::wrapKey(ExecState&amp; state)
-{
-    if (state.argumentCount() &lt; 4)
-        return state.vm().throwException(&amp;state, createNotEnoughArgumentsError(&amp;state));
-
-    CryptoKeyFormat keyFormat;
-    if (!cryptoKeyFormatFromJSValue(state, state.argument(0), keyFormat)) {
-        ASSERT(state.hadException());
-        return jsUndefined();
-    }
-
-    RefPtr&lt;CryptoKey&gt; key = JSCryptoKey::toWrapped(state.uncheckedArgument(1));
-    if (!key)
-        return throwTypeError(&amp;state);
-
-    RefPtr&lt;CryptoKey&gt; wrappingKey = JSCryptoKey::toWrapped(state.uncheckedArgument(2));
-    if (!key)
-        return throwTypeError(&amp;state);
-
-    if (!wrappingKey-&gt;allows(CryptoKeyUsageWrapKey)) {
-        wrapped().document()-&gt;addConsoleMessage(MessageSource::JS, MessageLevel::Error, ASCIILiteral(&quot;Key usages do not include 'wrapKey'&quot;));
-        setDOMException(&amp;state, NOT_SUPPORTED_ERR);
-        return jsUndefined();
-    }
-
-    auto algorithm = createAlgorithmFromJSValue(state, state.uncheckedArgument(3));
-    if (!algorithm) {
-        ASSERT(state.hadException());
-        return jsUndefined();
-    }
-
-    auto parameters = JSCryptoAlgorithmDictionary::createParametersForEncrypt(&amp;state, algorithm-&gt;identifier(), state.uncheckedArgument(3));
-    if (!parameters) {
-        ASSERT(state.hadException());
-        return jsUndefined();
-    }
-
-    JSPromiseDeferred* promiseDeferred = JSPromiseDeferred::create(&amp;state, globalObject());
-    DeferredWrapper wrapper(&amp;state, globalObject(), promiseDeferred);
-
-    auto exportSuccessCallback = [keyFormat, algorithm, parameters, wrappingKey, wrapper](const Vector&lt;uint8_t&gt;&amp; exportedKeyData) mutable {
-        auto encryptSuccessCallback = [wrapper](const Vector&lt;uint8_t&gt;&amp; encryptedData) mutable {
-            fulfillPromiseWithArrayBuffer(wrapper, encryptedData.data(), encryptedData.size());
-        };
-        auto encryptFailureCallback = [wrapper]() mutable {
-            wrapper.reject(nullptr);
-        };
-        ExceptionCode ec = 0;
-        algorithm-&gt;encryptForWrapKey(*parameters, *wrappingKey, std::make_pair(exportedKeyData.data(), exportedKeyData.size()), WTFMove(encryptSuccessCallback), WTFMove(encryptFailureCallback), ec);
-        if (ec) {
-            // FIXME: Report failure details to console, and possibly to calling script once there is a standardized way to pass errors to WebCrypto promise reject functions.
-            wrapper.reject(nullptr);
-        }
-    };
-
-    auto exportFailureCallback = [wrapper]() mutable {
-        wrapper.reject(nullptr);
-    };
-
-    ExceptionCode ec = 0;
-    WebCore::exportKey(state, keyFormat, *key, WTFMove(exportSuccessCallback), WTFMove(exportFailureCallback));
-    if (ec) {
-        setDOMException(&amp;state, ec);
-        return jsUndefined();
-    }
-
-    return promiseDeferred-&gt;promise();
-}
-
-JSValue JSSubtleCrypto::unwrapKey(ExecState&amp; state)
-{
-    if (state.argumentCount() &lt; 5)
-        return state.vm().throwException(&amp;state, createNotEnoughArgumentsError(&amp;state));
-
-    CryptoKeyFormat keyFormat;
-    if (!cryptoKeyFormatFromJSValue(state, state.argument(0), keyFormat)) {
-        ASSERT(state.hadException());
-        return jsUndefined();
-    }
-
-    CryptoOperationData wrappedKeyData;
-    if (!cryptoOperationDataFromJSValue(&amp;state, state.uncheckedArgument(1), wrappedKeyData)) {
-        ASSERT(state.hadException());
-        return jsUndefined();
-    }
-
-    RefPtr&lt;CryptoKey&gt; unwrappingKey = JSCryptoKey::toWrapped(state.uncheckedArgument(2));
-    if (!unwrappingKey)
-        return throwTypeError(&amp;state);
-
-    if (!unwrappingKey-&gt;allows(CryptoKeyUsageUnwrapKey)) {
-        wrapped().document()-&gt;addConsoleMessage(MessageSource::JS, MessageLevel::Error, ASCIILiteral(&quot;Key usages do not include 'unwrapKey'&quot;));
-        setDOMException(&amp;state, NOT_SUPPORTED_ERR);
-        return jsUndefined();
-    }
-
-    auto unwrapAlgorithm = createAlgorithmFromJSValue(state, state.uncheckedArgument(3));
-    if (!unwrapAlgorithm) {
-        ASSERT(state.hadException());
-        return jsUndefined();
-    }
-    auto unwrapAlgorithmParameters = JSCryptoAlgorithmDictionary::createParametersForDecrypt(&amp;state, unwrapAlgorithm-&gt;identifier(), state.uncheckedArgument(3));
-    if (!unwrapAlgorithmParameters) {
-        ASSERT(state.hadException());
-        return jsUndefined();
-    }
-
-    RefPtr&lt;CryptoAlgorithm&gt; unwrappedKeyAlgorithm;
-    RefPtr&lt;CryptoAlgorithmParameters&gt; unwrappedKeyAlgorithmParameters;
-    if (!state.uncheckedArgument(4).isNull()) {
-        unwrappedKeyAlgorithm = createAlgorithmFromJSValue(state, state.uncheckedArgument(4));
-        if (!unwrappedKeyAlgorithm) {
-            ASSERT(state.hadException());
-            return jsUndefined();
-        }
-        unwrappedKeyAlgorithmParameters = JSCryptoAlgorithmDictionary::createParametersForImportKey(&amp;state, unwrappedKeyAlgorithm-&gt;identifier(), state.uncheckedArgument(4));
-        if (!unwrappedKeyAlgorithmParameters) {
-            ASSERT(state.hadException());
-            return jsUndefined();
-        }
-    }
-
-    bool extractable = false;
-    if (state.argumentCount() &gt;= 6) {
-        extractable = state.uncheckedArgument(5).toBoolean(&amp;state);
-        if (state.hadException())
-            return jsUndefined();
-    }
-
-    CryptoKeyUsage keyUsages = 0;
-    if (state.argumentCount() &gt;= 7) {
-        if (!cryptoKeyUsagesFromJSValue(state, state.argument(6), keyUsages)) {
-            ASSERT(state.hadException());
-            return jsUndefined();
-        }
-    }
-
-    JSPromiseDeferred* promiseDeferred = JSPromiseDeferred::create(&amp;state, globalObject());
-    DeferredWrapper wrapper(&amp;state, globalObject(), promiseDeferred);
-    Strong&lt;JSDOMGlobalObject&gt; domGlobalObject(state.vm(), globalObject());
-
-    auto decryptSuccessCallback = [domGlobalObject, keyFormat, unwrappedKeyAlgorithm, unwrappedKeyAlgorithmParameters, extractable, keyUsages, wrapper](const Vector&lt;uint8_t&gt;&amp; result) mutable {
-        auto importSuccessCallback = [wrapper](CryptoKey&amp; key) mutable {
-            wrapper.resolve(key);
-        };
-        auto importFailureCallback = [wrapper]() mutable {
-            wrapper.reject(nullptr);
-        };
-        ExecState&amp; state = *domGlobalObject-&gt;globalExec();
-        WebCore::importKey(state, keyFormat, std::make_pair(result.data(), result.size()), unwrappedKeyAlgorithm, unwrappedKeyAlgorithmParameters, extractable, keyUsages, WTFMove(importSuccessCallback), WTFMove(importFailureCallback));
-        if (state.hadException()) {
-            // FIXME: Report exception details to console, and possibly to calling script once there is a standardized way to pass errors to WebCrypto promise reject functions.
-            state.clearException();
-            wrapper.reject(nullptr);
-        }
-    };
-
-    auto decryptFailureCallback = [wrapper]() mutable {
-        wrapper.reject(nullptr);
-    };
-
-    ExceptionCode ec = 0;
-    unwrapAlgorithm-&gt;decryptForUnwrapKey(*unwrapAlgorithmParameters, *unwrappingKey, wrappedKeyData, WTFMove(decryptSuccessCallback), WTFMove(decryptFailureCallback), ec);
-    if (ec) {
-        setDOMException(&amp;state, ec);
-        return jsUndefined();
-    }
-
-    return promiseDeferred-&gt;promise();
-}
-
-} // namespace WebCore
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSWebKitSubtleCryptoCustomcppfromrev203695trunkSourceWebCorebindingsjsJSSubtleCryptoCustomcpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/bindings/js/JSWebKitSubtleCryptoCustom.cpp (from rev 203695, trunk/Source/WebCore/bindings/js/JSSubtleCryptoCustom.cpp) (0 => 203696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSWebKitSubtleCryptoCustom.cpp                                (rev 0)
+++ trunk/Source/WebCore/bindings/js/JSWebKitSubtleCryptoCustom.cpp        2016-07-25 20:35:16 UTC (rev 203696)
</span><span class="lines">@@ -0,0 +1,805 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;JSWebKitSubtleCrypto.h&quot;
+
+#if ENABLE(SUBTLE_CRYPTO)
+
+#include &quot;CryptoAlgorithm.h&quot;
+#include &quot;CryptoAlgorithmParameters.h&quot;
+#include &quot;CryptoAlgorithmRegistry.h&quot;
+#include &quot;CryptoKeyData.h&quot;
+#include &quot;CryptoKeySerializationRaw.h&quot;
+#include &quot;Document.h&quot;
+#include &quot;ExceptionCode.h&quot;
+#include &quot;JSCryptoAlgorithmDictionary.h&quot;
+#include &quot;JSCryptoKey.h&quot;
+#include &quot;JSCryptoKeyPair.h&quot;
+#include &quot;JSCryptoKeySerializationJWK.h&quot;
+#include &quot;JSCryptoOperationData.h&quot;
+#include &quot;JSDOMPromise.h&quot;
+#include &lt;runtime/Error.h&gt;
+
+using namespace JSC;
+
+namespace WebCore {
+
+enum class CryptoKeyFormat {
+    // An unformatted sequence of bytes. Intended for secret keys.
+    Raw,
+
+    // The DER encoding of the PrivateKeyInfo structure from RFC 5208.
+    PKCS8,
+
+    // The DER encoding of the SubjectPublicKeyInfo structure from RFC 5280.
+    SPKI,
+
+    // The key is represented as JSON according to the JSON Web Key format.
+    JWK
+};
+
+static RefPtr&lt;CryptoAlgorithm&gt; createAlgorithmFromJSValue(ExecState&amp; state, JSValue value)
+{
+    CryptoAlgorithmIdentifier algorithmIdentifier;
+    if (!JSCryptoAlgorithmDictionary::getAlgorithmIdentifier(&amp;state, value, algorithmIdentifier)) {
+        ASSERT(state.hadException());
+        return nullptr;
+    }
+
+    auto result = CryptoAlgorithmRegistry::singleton().create(algorithmIdentifier);
+    if (!result)
+        setDOMException(&amp;state, NOT_SUPPORTED_ERR);
+    return result;
+}
+
+static bool cryptoKeyFormatFromJSValue(ExecState&amp; state, JSValue value, CryptoKeyFormat&amp; result)
+{
+    String keyFormatString = value.toString(&amp;state)-&gt;value(&amp;state);
+    if (state.hadException())
+        return false;
+    if (keyFormatString == &quot;raw&quot;)
+        result = CryptoKeyFormat::Raw;
+    else if (keyFormatString == &quot;pkcs8&quot;)
+        result = CryptoKeyFormat::PKCS8;
+    else if (keyFormatString == &quot;spki&quot;)
+        result = CryptoKeyFormat::SPKI;
+    else if (keyFormatString == &quot;jwk&quot;)
+        result = CryptoKeyFormat::JWK;
+    else {
+        throwTypeError(&amp;state, ASCIILiteral(&quot;Unknown key format&quot;));
+        return false;
+    }
+    return true;
+}
+
+static bool cryptoKeyUsagesFromJSValue(ExecState&amp; state, JSValue value, CryptoKeyUsage&amp; result)
+{
+    if (!isJSArray(value)) {
+        throwTypeError(&amp;state);
+        return false;
+    }
+
+    result = 0;
+
+    JSArray* array = asArray(value);
+    for (size_t i = 0; i &lt; array-&gt;length(); ++i) {
+        JSValue element = array-&gt;getIndex(&amp;state, i);
+        String usageString = element.toString(&amp;state)-&gt;value(&amp;state);
+        if (state.hadException())
+            return false;
+        if (usageString == &quot;encrypt&quot;)
+            result |= CryptoKeyUsageEncrypt;
+        else if (usageString == &quot;decrypt&quot;)
+            result |= CryptoKeyUsageDecrypt;
+        else if (usageString == &quot;sign&quot;)
+            result |= CryptoKeyUsageSign;
+        else if (usageString == &quot;verify&quot;)
+            result |= CryptoKeyUsageVerify;
+        else if (usageString == &quot;deriveKey&quot;)
+            result |= CryptoKeyUsageDeriveKey;
+        else if (usageString == &quot;deriveBits&quot;)
+            result |= CryptoKeyUsageDeriveBits;
+        else if (usageString == &quot;wrapKey&quot;)
+            result |= CryptoKeyUsageWrapKey;
+        else if (usageString == &quot;unwrapKey&quot;)
+            result |= CryptoKeyUsageUnwrapKey;
+    }
+    return true;
+}
+
+JSValue JSWebKitSubtleCrypto::encrypt(ExecState&amp; state)
+{
+    if (state.argumentCount() &lt; 3)
+        return state.vm().throwException(&amp;state, createNotEnoughArgumentsError(&amp;state));
+
+    auto algorithm = createAlgorithmFromJSValue(state, state.uncheckedArgument(0));
+    if (!algorithm) {
+        ASSERT(state.hadException());
+        return jsUndefined();
+    }
+
+    auto parameters = JSCryptoAlgorithmDictionary::createParametersForEncrypt(&amp;state, algorithm-&gt;identifier(), state.uncheckedArgument(0));
+    if (!parameters) {
+        ASSERT(state.hadException());
+        return jsUndefined();
+    }
+
+    RefPtr&lt;CryptoKey&gt; key = JSCryptoKey::toWrapped(state.uncheckedArgument(1));
+    if (!key)
+        return throwTypeError(&amp;state);
+
+    if (!key-&gt;allows(CryptoKeyUsageEncrypt)) {
+        wrapped().document()-&gt;addConsoleMessage(MessageSource::JS, MessageLevel::Error, ASCIILiteral(&quot;Key usages do not include 'encrypt'&quot;));
+        setDOMException(&amp;state, NOT_SUPPORTED_ERR);
+        return jsUndefined();
+    }
+
+    CryptoOperationData data;
+    if (!cryptoOperationDataFromJSValue(&amp;state, state.uncheckedArgument(2), data)) {
+        ASSERT(state.hadException());
+        return jsUndefined();
+    }
+
+    
+    JSPromiseDeferred* promiseDeferred = JSPromiseDeferred::create(&amp;state, globalObject());
+    DeferredWrapper wrapper(&amp;state, globalObject(), promiseDeferred);
+    auto successCallback = [wrapper](const Vector&lt;uint8_t&gt;&amp; result) mutable {
+        fulfillPromiseWithArrayBuffer(wrapper, result.data(), result.size());
+    };
+    auto failureCallback = [wrapper]() mutable {
+        wrapper.reject(nullptr);
+    };
+
+    ExceptionCode ec = 0;
+    algorithm-&gt;encrypt(*parameters, *key, data, WTFMove(successCallback), WTFMove(failureCallback), ec);
+    if (ec) {
+        setDOMException(&amp;state, ec);
+        return jsUndefined();
+    }
+
+    return promiseDeferred-&gt;promise();
+}
+
+JSValue JSWebKitSubtleCrypto::decrypt(ExecState&amp; state)
+{
+    if (state.argumentCount() &lt; 3)
+        return state.vm().throwException(&amp;state, createNotEnoughArgumentsError(&amp;state));
+
+    auto algorithm = createAlgorithmFromJSValue(state, state.uncheckedArgument(0));
+    if (!algorithm) {
+        ASSERT(state.hadException());
+        return jsUndefined();
+    }
+
+    auto parameters = JSCryptoAlgorithmDictionary::createParametersForDecrypt(&amp;state, algorithm-&gt;identifier(), state.uncheckedArgument(0));
+    if (!parameters) {
+        ASSERT(state.hadException());
+        return jsUndefined();
+    }
+
+    RefPtr&lt;CryptoKey&gt; key = JSCryptoKey::toWrapped(state.uncheckedArgument(1));
+    if (!key)
+        return throwTypeError(&amp;state);
+
+    if (!key-&gt;allows(CryptoKeyUsageDecrypt)) {
+        wrapped().document()-&gt;addConsoleMessage(MessageSource::JS, MessageLevel::Error, ASCIILiteral(&quot;Key usages do not include 'decrypt'&quot;));
+        setDOMException(&amp;state, NOT_SUPPORTED_ERR);
+        return jsUndefined();
+    }
+
+    CryptoOperationData data;
+    if (!cryptoOperationDataFromJSValue(&amp;state, state.uncheckedArgument(2), data)) {
+        ASSERT(state.hadException());
+        return jsUndefined();
+    }
+
+    JSPromiseDeferred* promiseDeferred = JSPromiseDeferred::create(&amp;state, globalObject());
+    DeferredWrapper wrapper(&amp;state, globalObject(), promiseDeferred);
+    auto successCallback = [wrapper](const Vector&lt;uint8_t&gt;&amp; result) mutable {
+        fulfillPromiseWithArrayBuffer(wrapper, result.data(), result.size());
+    };
+    auto failureCallback = [wrapper]() mutable {
+        wrapper.reject(nullptr);
+    };
+
+    ExceptionCode ec = 0;
+    algorithm-&gt;decrypt(*parameters, *key, data, WTFMove(successCallback), WTFMove(failureCallback), ec);
+    if (ec) {
+        setDOMException(&amp;state, ec);
+        return jsUndefined();
+    }
+
+    return promiseDeferred-&gt;promise();
+}
+
+JSValue JSWebKitSubtleCrypto::sign(ExecState&amp; state)
+{
+    if (state.argumentCount() &lt; 3)
+        return state.vm().throwException(&amp;state, createNotEnoughArgumentsError(&amp;state));
+
+    auto algorithm = createAlgorithmFromJSValue(state, state.uncheckedArgument(0));
+    if (!algorithm) {
+        ASSERT(state.hadException());
+        return jsUndefined();
+    }
+
+    auto parameters = JSCryptoAlgorithmDictionary::createParametersForSign(&amp;state, algorithm-&gt;identifier(), state.uncheckedArgument(0));
+    if (!parameters) {
+        ASSERT(state.hadException());
+        return jsUndefined();
+    }
+
+    RefPtr&lt;CryptoKey&gt; key = JSCryptoKey::toWrapped(state.uncheckedArgument(1));
+    if (!key)
+        return throwTypeError(&amp;state);
+
+    if (!key-&gt;allows(CryptoKeyUsageSign)) {
+        wrapped().document()-&gt;addConsoleMessage(MessageSource::JS, MessageLevel::Error, ASCIILiteral(&quot;Key usages do not include 'sign'&quot;));
+        setDOMException(&amp;state, NOT_SUPPORTED_ERR);
+        return jsUndefined();
+    }
+
+    CryptoOperationData data;
+    if (!cryptoOperationDataFromJSValue(&amp;state, state.uncheckedArgument(2), data)) {
+        ASSERT(state.hadException());
+        return jsUndefined();
+    }
+
+    JSPromiseDeferred* promiseDeferred = JSPromiseDeferred::create(&amp;state, globalObject());
+    DeferredWrapper wrapper(&amp;state, globalObject(), promiseDeferred);
+    auto successCallback = [wrapper](const Vector&lt;uint8_t&gt;&amp; result) mutable {
+        fulfillPromiseWithArrayBuffer(wrapper, result.data(), result.size());
+    };
+    auto failureCallback = [wrapper]() mutable {
+        wrapper.reject(nullptr);
+    };
+
+    ExceptionCode ec = 0;
+    algorithm-&gt;sign(*parameters, *key, data, WTFMove(successCallback), WTFMove(failureCallback), ec);
+    if (ec) {
+        setDOMException(&amp;state, ec);
+        return jsUndefined();
+    }
+
+    return promiseDeferred-&gt;promise();
+}
+
+JSValue JSWebKitSubtleCrypto::verify(ExecState&amp; state)
+{
+    if (state.argumentCount() &lt; 4)
+        return state.vm().throwException(&amp;state, createNotEnoughArgumentsError(&amp;state));
+
+    auto algorithm = createAlgorithmFromJSValue(state, state.uncheckedArgument(0));
+    if (!algorithm) {
+        ASSERT(state.hadException());
+        return jsUndefined();
+    }
+
+    auto parameters = JSCryptoAlgorithmDictionary::createParametersForVerify(&amp;state, algorithm-&gt;identifier(), state.uncheckedArgument(0));
+    if (!parameters) {
+        ASSERT(state.hadException());
+        return jsUndefined();
+    }
+
+    RefPtr&lt;CryptoKey&gt; key = JSCryptoKey::toWrapped(state.uncheckedArgument(1));
+    if (!key)
+        return throwTypeError(&amp;state);
+
+    if (!key-&gt;allows(CryptoKeyUsageVerify)) {
+        wrapped().document()-&gt;addConsoleMessage(MessageSource::JS, MessageLevel::Error, ASCIILiteral(&quot;Key usages do not include 'verify'&quot;));
+        setDOMException(&amp;state, NOT_SUPPORTED_ERR);
+        return jsUndefined();
+    }
+
+    CryptoOperationData signature;
+    if (!cryptoOperationDataFromJSValue(&amp;state, state.uncheckedArgument(2), signature)) {
+        ASSERT(state.hadException());
+        return jsUndefined();
+    }
+
+    CryptoOperationData data;
+    if (!cryptoOperationDataFromJSValue(&amp;state, state.uncheckedArgument(3), data)) {
+        ASSERT(state.hadException());
+        return jsUndefined();
+    }
+
+    JSPromiseDeferred* promiseDeferred = JSPromiseDeferred::create(&amp;state, globalObject());
+    DeferredWrapper wrapper(&amp;state, globalObject(), promiseDeferred);
+    auto successCallback = [wrapper](bool result) mutable {
+        wrapper.resolve(result);
+    };
+    auto failureCallback = [wrapper]() mutable {
+        wrapper.reject(nullptr);
+    };
+
+    ExceptionCode ec = 0;
+    algorithm-&gt;verify(*parameters, *key, signature, data, WTFMove(successCallback), WTFMove(failureCallback), ec);
+    if (ec) {
+        setDOMException(&amp;state, ec);
+        return jsUndefined();
+    }
+
+    return promiseDeferred-&gt;promise();
+}
+
+JSValue JSWebKitSubtleCrypto::digest(ExecState&amp; state)
+{
+    if (state.argumentCount() &lt; 2)
+        return state.vm().throwException(&amp;state, createNotEnoughArgumentsError(&amp;state));
+
+    auto algorithm = createAlgorithmFromJSValue(state, state.uncheckedArgument(0));
+    if (!algorithm) {
+        ASSERT(state.hadException());
+        return jsUndefined();
+    }
+
+    auto parameters = JSCryptoAlgorithmDictionary::createParametersForDigest(&amp;state, algorithm-&gt;identifier(), state.uncheckedArgument(0));
+    if (!parameters) {
+        ASSERT(state.hadException());
+        return jsUndefined();
+    }
+
+    CryptoOperationData data;
+    if (!cryptoOperationDataFromJSValue(&amp;state, state.uncheckedArgument(1), data)) {
+        ASSERT(state.hadException());
+        return jsUndefined();
+    }
+
+    JSPromiseDeferred* promiseDeferred = JSPromiseDeferred::create(&amp;state, globalObject());
+    DeferredWrapper wrapper(&amp;state, globalObject(), promiseDeferred);
+    auto successCallback = [wrapper](const Vector&lt;uint8_t&gt;&amp; result) mutable {
+        fulfillPromiseWithArrayBuffer(wrapper, result.data(), result.size());
+    };
+    auto failureCallback = [wrapper]() mutable {
+        wrapper.reject(nullptr);
+    };
+
+    ExceptionCode ec = 0;
+    algorithm-&gt;digest(*parameters, data, WTFMove(successCallback), WTFMove(failureCallback), ec);
+    if (ec) {
+        setDOMException(&amp;state, ec);
+        return jsUndefined();
+    }
+
+    return promiseDeferred-&gt;promise();
+}
+
+JSValue JSWebKitSubtleCrypto::generateKey(ExecState&amp; state)
+{
+    if (state.argumentCount() &lt; 1)
+        return state.vm().throwException(&amp;state, createNotEnoughArgumentsError(&amp;state));
+
+    auto algorithm = createAlgorithmFromJSValue(state, state.uncheckedArgument(0));
+    if (!algorithm) {
+        ASSERT(state.hadException());
+        return jsUndefined();
+    }
+
+    auto parameters = JSCryptoAlgorithmDictionary::createParametersForGenerateKey(&amp;state, algorithm-&gt;identifier(), state.uncheckedArgument(0));
+    if (!parameters) {
+        ASSERT(state.hadException());
+        return jsUndefined();
+    }
+
+    bool extractable = false;
+    if (state.argumentCount() &gt;= 2) {
+        extractable = state.uncheckedArgument(1).toBoolean(&amp;state);
+        if (state.hadException())
+            return jsUndefined();
+    }
+
+    CryptoKeyUsage keyUsages = 0;
+    if (state.argumentCount() &gt;= 3) {
+        if (!cryptoKeyUsagesFromJSValue(state, state.argument(2), keyUsages)) {
+            ASSERT(state.hadException());
+            return jsUndefined();
+        }
+    }
+
+    JSPromiseDeferred* promiseDeferred = JSPromiseDeferred::create(&amp;state, globalObject());
+    DeferredWrapper wrapper(&amp;state, globalObject(), promiseDeferred);
+    auto successCallback = [wrapper](CryptoKey* key, CryptoKeyPair* keyPair) mutable {
+        ASSERT(key || keyPair);
+        ASSERT(!key || !keyPair);
+        if (key)
+            wrapper.resolve(key);
+        else
+            wrapper.resolve(keyPair);
+    };
+    auto failureCallback = [wrapper]() mutable {
+        wrapper.reject(nullptr);
+    };
+
+    ExceptionCode ec = 0;
+    algorithm-&gt;generateKey(*parameters, extractable, keyUsages, WTFMove(successCallback), WTFMove(failureCallback), ec);
+    if (ec) {
+        setDOMException(&amp;state, ec);
+        return jsUndefined();
+    }
+
+    return promiseDeferred-&gt;promise();
+}
+
+static void importKey(ExecState&amp; state, CryptoKeyFormat keyFormat, CryptoOperationData data, RefPtr&lt;CryptoAlgorithm&gt; algorithm, RefPtr&lt;CryptoAlgorithmParameters&gt; parameters, bool extractable, CryptoKeyUsage keyUsages, CryptoAlgorithm::KeyCallback callback, CryptoAlgorithm::VoidCallback failureCallback)
+{
+    std::unique_ptr&lt;CryptoKeySerialization&gt; keySerialization;
+    switch (keyFormat) {
+    case CryptoKeyFormat::Raw:
+        keySerialization = CryptoKeySerializationRaw::create(data);
+        break;
+    case CryptoKeyFormat::JWK: {
+        String jwkString = String::fromUTF8(data.first, data.second);
+        if (jwkString.isNull()) {
+            throwTypeError(&amp;state, ASCIILiteral(&quot;JWK JSON serialization is not valid UTF-8&quot;));
+            return;
+        }
+        keySerialization = std::make_unique&lt;JSCryptoKeySerializationJWK&gt;(&amp;state, jwkString);
+        if (state.hadException())
+            return;
+        break;
+    }
+    default:
+        throwTypeError(&amp;state, ASCIILiteral(&quot;Unsupported key format for import&quot;));
+        return;
+    }
+
+    ASSERT(keySerialization);
+
+    Optional&lt;CryptoAlgorithmPair&gt; reconciledResult = keySerialization-&gt;reconcileAlgorithm(algorithm.get(), parameters.get());
+    if (!reconciledResult) {
+        if (!state.hadException())
+            throwTypeError(&amp;state, ASCIILiteral(&quot;Algorithm specified in key is not compatible with one passed to importKey as argument&quot;));
+        return;
+    }
+    if (state.hadException())
+        return;
+
+    algorithm = reconciledResult-&gt;algorithm;
+    parameters = reconciledResult-&gt;parameters;
+    if (!algorithm) {
+        throwTypeError(&amp;state, ASCIILiteral(&quot;Neither key nor function argument has crypto algorithm specified&quot;));
+        return;
+    }
+    ASSERT(parameters);
+
+    keySerialization-&gt;reconcileExtractable(extractable);
+    if (state.hadException())
+        return;
+
+    keySerialization-&gt;reconcileUsages(keyUsages);
+    if (state.hadException())
+        return;
+
+    auto keyData = keySerialization-&gt;keyData();
+    if (state.hadException())
+        return;
+
+    ExceptionCode ec = 0;
+    algorithm-&gt;importKey(*parameters, *keyData, extractable, keyUsages, WTFMove(callback), WTFMove(failureCallback), ec);
+    if (ec)
+        setDOMException(&amp;state, ec);
+}
+
+JSValue JSWebKitSubtleCrypto::importKey(ExecState&amp; state)
+{
+    if (state.argumentCount() &lt; 3)
+        return state.vm().throwException(&amp;state, createNotEnoughArgumentsError(&amp;state));
+
+    CryptoKeyFormat keyFormat;
+    if (!cryptoKeyFormatFromJSValue(state, state.argument(0), keyFormat)) {
+        ASSERT(state.hadException());
+        return jsUndefined();
+    }
+
+    CryptoOperationData data;
+    if (!cryptoOperationDataFromJSValue(&amp;state, state.uncheckedArgument(1), data)) {
+        ASSERT(state.hadException());
+        return jsUndefined();
+    }
+
+    RefPtr&lt;CryptoAlgorithm&gt; algorithm;
+    RefPtr&lt;CryptoAlgorithmParameters&gt; parameters;
+    if (!state.uncheckedArgument(2).isNull()) {
+        algorithm = createAlgorithmFromJSValue(state, state.uncheckedArgument(2));
+        if (!algorithm) {
+            ASSERT(state.hadException());
+            return jsUndefined();
+        }
+        parameters = JSCryptoAlgorithmDictionary::createParametersForImportKey(&amp;state, algorithm-&gt;identifier(), state.uncheckedArgument(2));
+        if (!parameters) {
+            ASSERT(state.hadException());
+            return jsUndefined();
+        }
+    }
+
+    bool extractable = false;
+    if (state.argumentCount() &gt;= 4) {
+        extractable = state.uncheckedArgument(3).toBoolean(&amp;state);
+        if (state.hadException())
+            return jsUndefined();
+    }
+
+    CryptoKeyUsage keyUsages = 0;
+    if (state.argumentCount() &gt;= 5) {
+        if (!cryptoKeyUsagesFromJSValue(state, state.argument(4), keyUsages)) {
+            ASSERT(state.hadException());
+            return jsUndefined();
+        }
+    }
+
+    JSPromiseDeferred* promiseDeferred = JSPromiseDeferred::create(&amp;state, globalObject());
+    DeferredWrapper wrapper(&amp;state, globalObject(), promiseDeferred);
+    auto successCallback = [wrapper](CryptoKey&amp; result) mutable {
+        wrapper.resolve(result);
+    };
+    auto failureCallback = [wrapper]() mutable {
+        wrapper.reject(nullptr);
+    };
+
+    WebCore::importKey(state, keyFormat, data, WTFMove(algorithm), WTFMove(parameters), extractable, keyUsages, WTFMove(successCallback), WTFMove(failureCallback));
+    if (state.hadException())
+        return jsUndefined();
+
+    return promiseDeferred-&gt;promise();
+}
+
+static void exportKey(ExecState&amp; state, CryptoKeyFormat keyFormat, const CryptoKey&amp; key, CryptoAlgorithm::VectorCallback callback, CryptoAlgorithm::VoidCallback failureCallback)
+{
+    if (!key.extractable()) {
+        throwTypeError(&amp;state, ASCIILiteral(&quot;Key is not extractable&quot;));
+        return;
+    }
+
+    switch (keyFormat) {
+    case CryptoKeyFormat::Raw: {
+        Vector&lt;uint8_t&gt; result;
+        if (CryptoKeySerializationRaw::serialize(key, result))
+            callback(result);
+        else
+            failureCallback();
+        break;
+    }
+    case CryptoKeyFormat::JWK: {
+        String result = JSCryptoKeySerializationJWK::serialize(&amp;state, key);
+        if (state.hadException())
+            return;
+        CString utf8String = result.utf8(StrictConversion);
+        Vector&lt;uint8_t&gt; resultBuffer;
+        resultBuffer.append(utf8String.data(), utf8String.length());
+        callback(resultBuffer);
+        break;
+    }
+    default:
+        throwTypeError(&amp;state, ASCIILiteral(&quot;Unsupported key format for export&quot;));
+        break;
+    }
+}
+
+JSValue JSWebKitSubtleCrypto::exportKey(ExecState&amp; state)
+{
+    if (state.argumentCount() &lt; 2)
+        return state.vm().throwException(&amp;state, createNotEnoughArgumentsError(&amp;state));
+
+    CryptoKeyFormat keyFormat;
+    if (!cryptoKeyFormatFromJSValue(state, state.argument(0), keyFormat)) {
+        ASSERT(state.hadException());
+        return jsUndefined();
+    }
+
+    RefPtr&lt;CryptoKey&gt; key = JSCryptoKey::toWrapped(state.uncheckedArgument(1));
+    if (!key)
+        return throwTypeError(&amp;state);
+
+    JSPromiseDeferred* promiseDeferred = JSPromiseDeferred::create(&amp;state, globalObject());
+    DeferredWrapper wrapper(&amp;state, globalObject(), promiseDeferred);
+    auto successCallback = [wrapper](const Vector&lt;uint8_t&gt;&amp; result) mutable {
+        fulfillPromiseWithArrayBuffer(wrapper, result.data(), result.size());
+    };
+    auto failureCallback = [wrapper]() mutable {
+        wrapper.reject(nullptr);
+    };
+
+    WebCore::exportKey(state, keyFormat, *key, WTFMove(successCallback), WTFMove(failureCallback));
+    if (state.hadException())
+        return jsUndefined();
+
+    return promiseDeferred-&gt;promise();
+}
+
+JSValue JSWebKitSubtleCrypto::wrapKey(ExecState&amp; state)
+{
+    if (state.argumentCount() &lt; 4)
+        return state.vm().throwException(&amp;state, createNotEnoughArgumentsError(&amp;state));
+
+    CryptoKeyFormat keyFormat;
+    if (!cryptoKeyFormatFromJSValue(state, state.argument(0), keyFormat)) {
+        ASSERT(state.hadException());
+        return jsUndefined();
+    }
+
+    RefPtr&lt;CryptoKey&gt; key = JSCryptoKey::toWrapped(state.uncheckedArgument(1));
+    if (!key)
+        return throwTypeError(&amp;state);
+
+    RefPtr&lt;CryptoKey&gt; wrappingKey = JSCryptoKey::toWrapped(state.uncheckedArgument(2));
+    if (!key)
+        return throwTypeError(&amp;state);
+
+    if (!wrappingKey-&gt;allows(CryptoKeyUsageWrapKey)) {
+        wrapped().document()-&gt;addConsoleMessage(MessageSource::JS, MessageLevel::Error, ASCIILiteral(&quot;Key usages do not include 'wrapKey'&quot;));
+        setDOMException(&amp;state, NOT_SUPPORTED_ERR);
+        return jsUndefined();
+    }
+
+    auto algorithm = createAlgorithmFromJSValue(state, state.uncheckedArgument(3));
+    if (!algorithm) {
+        ASSERT(state.hadException());
+        return jsUndefined();
+    }
+
+    auto parameters = JSCryptoAlgorithmDictionary::createParametersForEncrypt(&amp;state, algorithm-&gt;identifier(), state.uncheckedArgument(3));
+    if (!parameters) {
+        ASSERT(state.hadException());
+        return jsUndefined();
+    }
+
+    JSPromiseDeferred* promiseDeferred = JSPromiseDeferred::create(&amp;state, globalObject());
+    DeferredWrapper wrapper(&amp;state, globalObject(), promiseDeferred);
+
+    auto exportSuccessCallback = [keyFormat, algorithm, parameters, wrappingKey, wrapper](const Vector&lt;uint8_t&gt;&amp; exportedKeyData) mutable {
+        auto encryptSuccessCallback = [wrapper](const Vector&lt;uint8_t&gt;&amp; encryptedData) mutable {
+            fulfillPromiseWithArrayBuffer(wrapper, encryptedData.data(), encryptedData.size());
+        };
+        auto encryptFailureCallback = [wrapper]() mutable {
+            wrapper.reject(nullptr);
+        };
+        ExceptionCode ec = 0;
+        algorithm-&gt;encryptForWrapKey(*parameters, *wrappingKey, std::make_pair(exportedKeyData.data(), exportedKeyData.size()), WTFMove(encryptSuccessCallback), WTFMove(encryptFailureCallback), ec);
+        if (ec) {
+            // FIXME: Report failure details to console, and possibly to calling script once there is a standardized way to pass errors to WebCrypto promise reject functions.
+            wrapper.reject(nullptr);
+        }
+    };
+
+    auto exportFailureCallback = [wrapper]() mutable {
+        wrapper.reject(nullptr);
+    };
+
+    ExceptionCode ec = 0;
+    WebCore::exportKey(state, keyFormat, *key, WTFMove(exportSuccessCallback), WTFMove(exportFailureCallback));
+    if (ec) {
+        setDOMException(&amp;state, ec);
+        return jsUndefined();
+    }
+
+    return promiseDeferred-&gt;promise();
+}
+
+JSValue JSWebKitSubtleCrypto::unwrapKey(ExecState&amp; state)
+{
+    if (state.argumentCount() &lt; 5)
+        return state.vm().throwException(&amp;state, createNotEnoughArgumentsError(&amp;state));
+
+    CryptoKeyFormat keyFormat;
+    if (!cryptoKeyFormatFromJSValue(state, state.argument(0), keyFormat)) {
+        ASSERT(state.hadException());
+        return jsUndefined();
+    }
+
+    CryptoOperationData wrappedKeyData;
+    if (!cryptoOperationDataFromJSValue(&amp;state, state.uncheckedArgument(1), wrappedKeyData)) {
+        ASSERT(state.hadException());
+        return jsUndefined();
+    }
+
+    RefPtr&lt;CryptoKey&gt; unwrappingKey = JSCryptoKey::toWrapped(state.uncheckedArgument(2));
+    if (!unwrappingKey)
+        return throwTypeError(&amp;state);
+
+    if (!unwrappingKey-&gt;allows(CryptoKeyUsageUnwrapKey)) {
+        wrapped().document()-&gt;addConsoleMessage(MessageSource::JS, MessageLevel::Error, ASCIILiteral(&quot;Key usages do not include 'unwrapKey'&quot;));
+        setDOMException(&amp;state, NOT_SUPPORTED_ERR);
+        return jsUndefined();
+    }
+
+    auto unwrapAlgorithm = createAlgorithmFromJSValue(state, state.uncheckedArgument(3));
+    if (!unwrapAlgorithm) {
+        ASSERT(state.hadException());
+        return jsUndefined();
+    }
+    auto unwrapAlgorithmParameters = JSCryptoAlgorithmDictionary::createParametersForDecrypt(&amp;state, unwrapAlgorithm-&gt;identifier(), state.uncheckedArgument(3));
+    if (!unwrapAlgorithmParameters) {
+        ASSERT(state.hadException());
+        return jsUndefined();
+    }
+
+    RefPtr&lt;CryptoAlgorithm&gt; unwrappedKeyAlgorithm;
+    RefPtr&lt;CryptoAlgorithmParameters&gt; unwrappedKeyAlgorithmParameters;
+    if (!state.uncheckedArgument(4).isNull()) {
+        unwrappedKeyAlgorithm = createAlgorithmFromJSValue(state, state.uncheckedArgument(4));
+        if (!unwrappedKeyAlgorithm) {
+            ASSERT(state.hadException());
+            return jsUndefined();
+        }
+        unwrappedKeyAlgorithmParameters = JSCryptoAlgorithmDictionary::createParametersForImportKey(&amp;state, unwrappedKeyAlgorithm-&gt;identifier(), state.uncheckedArgument(4));
+        if (!unwrappedKeyAlgorithmParameters) {
+            ASSERT(state.hadException());
+            return jsUndefined();
+        }
+    }
+
+    bool extractable = false;
+    if (state.argumentCount() &gt;= 6) {
+        extractable = state.uncheckedArgument(5).toBoolean(&amp;state);
+        if (state.hadException())
+            return jsUndefined();
+    }
+
+    CryptoKeyUsage keyUsages = 0;
+    if (state.argumentCount() &gt;= 7) {
+        if (!cryptoKeyUsagesFromJSValue(state, state.argument(6), keyUsages)) {
+            ASSERT(state.hadException());
+            return jsUndefined();
+        }
+    }
+
+    JSPromiseDeferred* promiseDeferred = JSPromiseDeferred::create(&amp;state, globalObject());
+    DeferredWrapper wrapper(&amp;state, globalObject(), promiseDeferred);
+    Strong&lt;JSDOMGlobalObject&gt; domGlobalObject(state.vm(), globalObject());
+
+    auto decryptSuccessCallback = [domGlobalObject, keyFormat, unwrappedKeyAlgorithm, unwrappedKeyAlgorithmParameters, extractable, keyUsages, wrapper](const Vector&lt;uint8_t&gt;&amp; result) mutable {
+        auto importSuccessCallback = [wrapper](CryptoKey&amp; key) mutable {
+            wrapper.resolve(key);
+        };
+        auto importFailureCallback = [wrapper]() mutable {
+            wrapper.reject(nullptr);
+        };
+        ExecState&amp; state = *domGlobalObject-&gt;globalExec();
+        WebCore::importKey(state, keyFormat, std::make_pair(result.data(), result.size()), unwrappedKeyAlgorithm, unwrappedKeyAlgorithmParameters, extractable, keyUsages, WTFMove(importSuccessCallback), WTFMove(importFailureCallback));
+        if (state.hadException()) {
+            // FIXME: Report exception details to console, and possibly to calling script once there is a standardized way to pass errors to WebCrypto promise reject functions.
+            state.clearException();
+            wrapper.reject(nullptr);
+        }
+    };
+
+    auto decryptFailureCallback = [wrapper]() mutable {
+        wrapper.reject(nullptr);
+    };
+
+    ExceptionCode ec = 0;
+    unwrapAlgorithm-&gt;decryptForUnwrapKey(*unwrapAlgorithmParameters, *unwrappingKey, wrappedKeyData, WTFMove(decryptSuccessCallback), WTFMove(decryptFailureCallback), ec);
+    if (ec) {
+        setDOMException(&amp;state, ec);
+        return jsUndefined();
+    }
+
+    return promiseDeferred-&gt;promise();
+}
+
+} // namespace WebCore
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCorecryptoSubtleCryptocpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/crypto/SubtleCrypto.cpp (203695 => 203696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/SubtleCrypto.cpp        2016-07-25 19:57:47 UTC (rev 203695)
+++ trunk/Source/WebCore/crypto/SubtleCrypto.cpp        2016-07-25 20:35:16 UTC (rev 203696)
</span><span class="lines">@@ -1,47 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include &quot;config.h&quot;
-#include &quot;SubtleCrypto.h&quot;
-
-#if ENABLE(SUBTLE_CRYPTO)
-
-#include &quot;Document.h&quot;
-
-namespace WebCore {
-
-SubtleCrypto::SubtleCrypto(Document&amp; document)
-    : ContextDestructionObserver(&amp;document)
-{
-}
-
-Document* SubtleCrypto::document() const
-{
-    return downcast&lt;Document&gt;(scriptExecutionContext());
-}
-
-}
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCorecryptoSubtleCryptoh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/crypto/SubtleCrypto.h (203695 => 203696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/SubtleCrypto.h        2016-07-25 19:57:47 UTC (rev 203695)
+++ trunk/Source/WebCore/crypto/SubtleCrypto.h        2016-07-25 20:35:16 UTC (rev 203696)
</span><span class="lines">@@ -1,53 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SubtleCrypto_h
-#define SubtleCrypto_h
-
-#include &quot;ContextDestructionObserver.h&quot; 
-#include &lt;wtf/RefCounted.h&gt;
-#include &lt;wtf/RefPtr.h&gt;
-
-#if ENABLE(SUBTLE_CRYPTO)
-
-namespace WebCore {
-
-class Document;
-
-class SubtleCrypto : public ContextDestructionObserver, public RefCounted&lt;SubtleCrypto&gt; {
-public:
-    static Ref&lt;SubtleCrypto&gt; create(Document&amp; document) { return adoptRef(*new SubtleCrypto(document)); }
-
-    Document* document() const;
-
-private:
-    SubtleCrypto(Document&amp;);
-};
-
-}
-
-#endif
-
-#endif // SubtleCrypto_h
</del></span></pre></div>
<a id="trunkSourceWebCorecryptoSubtleCryptoidl"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/crypto/SubtleCrypto.idl (203695 => 203696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/SubtleCrypto.idl        2016-07-25 19:57:47 UTC (rev 203695)
+++ trunk/Source/WebCore/crypto/SubtleCrypto.idl        2016-07-25 20:35:16 UTC (rev 203696)
</span><span class="lines">@@ -1,42 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
-    Conditional=SUBTLE_CRYPTO,
-    InterfaceName=WebKitSubtleCrypto,
-    GenerateIsReachable=ImplDocument,
-    NoInterfaceObject,
-] interface SubtleCrypto {
-    [Custom] Promise encrypt(AlgorithmIdentifier algorithm, Key key, sequence&lt;CryptoOperationData&gt; data);
-    [Custom] Promise decrypt(AlgorithmIdentifier algorithm, Key key, sequence&lt;CryptoOperationData&gt; data);
-    [Custom] Promise sign(AlgorithmIdentifier algorithm, Key key, sequence&lt;CryptoOperationData&gt; data);
-    [Custom] Promise verify(AlgorithmIdentifier algorithm, Key key, CryptoOperationData signature, sequence&lt;CryptoOperationData&gt; data);
-    [Custom] Promise digest(AlgorithmIdentifier algorithm, sequence&lt;CryptoOperationData&gt; data);
-    [Custom] Promise generateKey(AlgorithmIdentifier algorithm, optional boolean extractable, optional sequence&lt;KeyUsage&gt; keyUsages);
-    [Custom] Promise importKey(KeyFormat format, CryptoOperationData keyData, AlgorithmIdentifier? algorithm, optional boolean extractable, optional sequence&lt;KeyUsage&gt; keyUsages);
-    [Custom] Promise exportKey(KeyFormat format, Key key);
-    [Custom] Promise wrapKey(KeyFormat format, Key key, Key wrappingKey, AlgorithmIdentifier wrapAlgorithm);
-    [Custom] Promise unwrapKey(KeyFormat format, CryptoOperationData wrappedKey, Key unwrappingKey, AlgorithmIdentifier unwrapAlgorithm, AlgorithmIdentifier? unwrappedKeyAlgorithm, optional boolean extractable, optional sequence&lt;KeyUsage&gt; keyUsages);
-};
</del></span></pre></div>
<a id="trunkSourceWebCorecryptoWebKitSubtleCryptocppfromrev203695trunkSourceWebCorecryptoSubtleCryptocpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/crypto/WebKitSubtleCrypto.cpp (from rev 203695, trunk/Source/WebCore/crypto/SubtleCrypto.cpp) (0 => 203696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/WebKitSubtleCrypto.cpp                                (rev 0)
+++ trunk/Source/WebCore/crypto/WebKitSubtleCrypto.cpp        2016-07-25 20:35:16 UTC (rev 203696)
</span><span class="lines">@@ -0,0 +1,47 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;WebKitSubtleCrypto.h&quot;
+
+#if ENABLE(SUBTLE_CRYPTO)
+
+#include &quot;Document.h&quot;
+
+namespace WebCore {
+
+WebKitSubtleCrypto::WebKitSubtleCrypto(Document&amp; document)
+    : ContextDestructionObserver(&amp;document)
+{
+}
+
+Document* WebKitSubtleCrypto::document() const
+{
+    return downcast&lt;Document&gt;(scriptExecutionContext());
+}
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCorecryptoWebKitSubtleCryptohfromrev203695trunkSourceWebCorecryptoSubtleCryptoh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/crypto/WebKitSubtleCrypto.h (from rev 203695, trunk/Source/WebCore/crypto/SubtleCrypto.h) (0 => 203696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/WebKitSubtleCrypto.h                                (rev 0)
+++ trunk/Source/WebCore/crypto/WebKitSubtleCrypto.h        2016-07-25 20:35:16 UTC (rev 203696)
</span><span class="lines">@@ -0,0 +1,50 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include &quot;ContextDestructionObserver.h&quot; 
+#include &lt;wtf/RefCounted.h&gt;
+#include &lt;wtf/RefPtr.h&gt;
+
+#if ENABLE(SUBTLE_CRYPTO)
+
+namespace WebCore {
+
+class Document;
+
+class WebKitSubtleCrypto : public ContextDestructionObserver, public RefCounted&lt;WebKitSubtleCrypto&gt; {
+public:
+    static Ref&lt;WebKitSubtleCrypto&gt; create(Document&amp; document) { return adoptRef(*new WebKitSubtleCrypto(document)); }
+
+    Document* document() const;
+
+private:
+    WebKitSubtleCrypto(Document&amp;);
+};
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCorecryptoWebKitSubtleCryptoidlfromrev203695trunkSourceWebCorecryptoSubtleCryptoidl"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/crypto/WebKitSubtleCrypto.idl (from rev 203695, trunk/Source/WebCore/crypto/SubtleCrypto.idl) (0 => 203696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/crypto/WebKitSubtleCrypto.idl                                (rev 0)
+++ trunk/Source/WebCore/crypto/WebKitSubtleCrypto.idl        2016-07-25 20:35:16 UTC (rev 203696)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    Conditional=SUBTLE_CRYPTO,
+    GenerateIsReachable=ImplDocument,
+    NoInterfaceObject,
+] interface WebKitSubtleCrypto {
+    [Custom] Promise encrypt(AlgorithmIdentifier algorithm, Key key, sequence&lt;CryptoOperationData&gt; data);
+    [Custom] Promise decrypt(AlgorithmIdentifier algorithm, Key key, sequence&lt;CryptoOperationData&gt; data);
+    [Custom] Promise sign(AlgorithmIdentifier algorithm, Key key, sequence&lt;CryptoOperationData&gt; data);
+    [Custom] Promise verify(AlgorithmIdentifier algorithm, Key key, CryptoOperationData signature, sequence&lt;CryptoOperationData&gt; data);
+    [Custom] Promise digest(AlgorithmIdentifier algorithm, sequence&lt;CryptoOperationData&gt; data);
+    [Custom] Promise generateKey(AlgorithmIdentifier algorithm, optional boolean extractable, optional sequence&lt;KeyUsage&gt; keyUsages);
+    [Custom] Promise importKey(KeyFormat format, CryptoOperationData keyData, AlgorithmIdentifier? algorithm, optional boolean extractable, optional sequence&lt;KeyUsage&gt; keyUsages);
+    [Custom] Promise exportKey(KeyFormat format, Key key);
+    [Custom] Promise wrapKey(KeyFormat format, Key key, Key wrappingKey, AlgorithmIdentifier wrapAlgorithm);
+    [Custom] Promise unwrapKey(KeyFormat format, CryptoOperationData wrappedKey, Key unwrappingKey, AlgorithmIdentifier unwrapAlgorithm, AlgorithmIdentifier? unwrappedKeyAlgorithm, optional boolean extractable, optional sequence&lt;KeyUsage&gt; keyUsages);
+};
</ins></span></pre></div>
<a id="trunkSourceWebCorepageCryptocpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Crypto.cpp (203695 => 203696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Crypto.cpp        2016-07-25 19:57:47 UTC (rev 203695)
+++ trunk/Source/WebCore/page/Crypto.cpp        2016-07-25 20:35:16 UTC (rev 203696)
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Document.h&quot;
</span><span class="cx"> #include &quot;ExceptionCode.h&quot;
</span><del>-#include &quot;SubtleCrypto.h&quot;
</del><ins>+#include &quot;WebKitSubtleCrypto.h&quot;
</ins><span class="cx"> #include &lt;runtime/ArrayBufferView.h&gt;
</span><span class="cx"> #include &lt;wtf/CryptographicallyRandomNumber.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -67,13 +67,13 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(SUBTLE_CRYPTO)
</span><del>-SubtleCrypto* Crypto::subtle()
</del><ins>+WebKitSubtleCrypto* Crypto::webkitSubtle()
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(isMainThread());
</span><del>-    if (!m_subtle)
-        m_subtle = SubtleCrypto::create(*document());
</del><ins>+    if (!m_webkitSubtle)
+        m_webkitSubtle = WebKitSubtleCrypto::create(*document());
</ins><span class="cx"> 
</span><del>-    return m_subtle.get();
</del><ins>+    return m_webkitSubtle.get();
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageCryptoh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Crypto.h (203695 => 203696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Crypto.h        2016-07-25 19:57:47 UTC (rev 203695)
+++ trunk/Source/WebCore/page/Crypto.h        2016-07-25 20:35:16 UTC (rev 203696)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx"> typedef int ExceptionCode;
</span><span class="cx"> 
</span><span class="cx"> class Document;
</span><del>-class SubtleCrypto;
</del><ins>+class WebKitSubtleCrypto;
</ins><span class="cx"> 
</span><span class="cx"> class Crypto : public ContextDestructionObserver, public RefCounted&lt;Crypto&gt; {
</span><span class="cx"> public:
</span><span class="lines">@@ -57,7 +57,7 @@
</span><span class="cx">     void getRandomValues(JSC::ArrayBufferView*, ExceptionCode&amp;);
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(SUBTLE_CRYPTO)
</span><del>-    SubtleCrypto* subtle();
</del><ins>+    WebKitSubtleCrypto* webkitSubtle();
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx">     Crypto(Document&amp;);
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(SUBTLE_CRYPTO)
</span><del>-    RefPtr&lt;SubtleCrypto&gt; m_subtle;
</del><ins>+    RefPtr&lt;WebKitSubtleCrypto&gt; m_webkitSubtle;
</ins><span class="cx"> #endif
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageCryptoidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Crypto.idl (203695 => 203696)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Crypto.idl        2016-07-25 19:57:47 UTC (rev 203695)
+++ trunk/Source/WebCore/page/Crypto.idl        2016-07-25 20:35:16 UTC (rev 203696)
</span><span class="lines">@@ -32,5 +32,5 @@
</span><span class="cx"> ] interface Crypto {
</span><span class="cx">     [Custom, RaisesException] ArrayBufferView getRandomValues(ArrayBufferView array);
</span><span class="cx"> 
</span><del>-    [Conditional=SUBTLE_CRYPTO, ImplementedAs=subtle] readonly attribute SubtleCrypto webkitSubtle;
</del><ins>+    [Conditional=SUBTLE_CRYPTO] readonly attribute WebKitSubtleCrypto webkitSubtle;
</ins><span class="cx"> };
</span></span></pre>
</div>
</div>

</body>
</html>