<!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>[199797] 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/199797">199797</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2016-04-20 16:43:34 -0700 (Wed, 20 Apr 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Modern IDB (Workers): Introduce &quot;IDBConnectionProxy&quot; for future threading abstraction, and adopt it in IDBFactory.
https://bugs.webkit.org/show_bug.cgi?id=156810

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (Covered by changes to existing tests).

Add the IDBConnectionProxy object, including the ability to replicate IDBFactory functionality:
* Modules/indexeddb/client/IDBConnectionProxy.cpp: Added.
(WebCore::IDBClient::IDBConnectionProxy::IDBConnectionProxy):
(WebCore::IDBClient::IDBConnectionProxy::openDatabase):
(WebCore::IDBClient::IDBConnectionProxy::deleteDatabase):
* Modules/indexeddb/client/IDBConnectionProxy.h:

Add pure virtual IDBConnectionProxy accessor:
* dom/ScriptExecutionContext.h:

Implement it:
* dom/Document.cpp:
(WebCore::Document::idbConnectionProxy):
* dom/Document.h:

Implement it:
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::idbConnectionProxy):
* workers/WorkerGlobalScope.h:

* Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
(WebCore::DOMWindowIndexedDatabase::indexedDB):

Don't keep a reference to IDBConnectionToServer, but rather get at the context's IDBConnectionProxy:
* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::create):
(WebCore::IDBFactory::IDBFactory):
(WebCore::IDBFactory::open):
(WebCore::IDBFactory::openInternal):
(WebCore::IDBFactory::deleteDatabase):
* Modules/indexeddb/IDBFactory.h:
* Modules/indexeddb/IDBFactory.idl:

* Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp:
(WebCore::WorkerGlobalScopeIndexedDatabase::indexedDB):

* Modules/indexeddb/client/IDBConnectionToServer.h:

* inspector/InspectorIndexedDBAgent.cpp:

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:

LayoutTests:

* storage/indexeddb/intversion-bad-parameters-expected.txt:
* storage/indexeddb/intversion-bad-parameters-private-expected.txt:
* storage/indexeddb/modern/opendatabase-request-event-expected.txt:
* storage/indexeddb/modern/opendatabase-request-event-private-expected.txt:
* storage/indexeddb/modern/opendatabase-request-expected.txt:
* storage/indexeddb/modern/opendatabase-request-private-expected.txt:
* storage/indexeddb/modern/workers-enable-expected.txt:
* storage/indexeddb/version-change-event-basic-expected.txt:
* storage/indexeddb/version-change-event-basic-private-expected.txt:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbintversionbadparametersexpectedtxt">trunk/LayoutTests/storage/indexeddb/intversion-bad-parameters-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbintversionbadparametersprivateexpectedtxt">trunk/LayoutTests/storage/indexeddb/intversion-bad-parameters-private-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernopendatabaserequesteventexpectedtxt">trunk/LayoutTests/storage/indexeddb/modern/opendatabase-request-event-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernopendatabaserequesteventprivateexpectedtxt">trunk/LayoutTests/storage/indexeddb/modern/opendatabase-request-event-private-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernopendatabaserequestexpectedtxt">trunk/LayoutTests/storage/indexeddb/modern/opendatabase-request-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernopendatabaserequestprivateexpectedtxt">trunk/LayoutTests/storage/indexeddb/modern/opendatabase-request-private-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernworkersenableexpectedtxt">trunk/LayoutTests/storage/indexeddb/modern/workers-enable-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbversionchangeeventbasicexpectedtxt">trunk/LayoutTests/storage/indexeddb/version-change-event-basic-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbversionchangeeventbasicprivateexpectedtxt">trunk/LayoutTests/storage/indexeddb/version-change-event-basic-private-expected.txt</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="#trunkSourceWebCoreModulesindexeddbDOMWindowIndexedDatabasecpp">trunk/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBFactorycpp">trunk/Source/WebCore/Modules/indexeddb/IDBFactory.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBFactoryh">trunk/Source/WebCore/Modules/indexeddb/IDBFactory.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBFactoryidl">trunk/Source/WebCore/Modules/indexeddb/IDBFactory.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbWorkerGlobalScopeIndexedDatabasecpp">trunk/Source/WebCore/Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServerh">trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoredomDocumentcpp">trunk/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumenth">trunk/Source/WebCore/dom/Document.h</a></li>
<li><a href="#trunkSourceWebCoredomScriptExecutionContexth">trunk/Source/WebCore/dom/ScriptExecutionContext.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorIndexedDBAgentcpp">trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerGlobalScopecpp">trunk/Source/WebCore/workers/WorkerGlobalScope.cpp</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerGlobalScopeh">trunk/Source/WebCore/workers/WorkerGlobalScope.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBConnectionProxycpp">trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBConnectionProxyh">trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (199796 => 199797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-04-20 23:28:29 UTC (rev 199796)
+++ trunk/LayoutTests/ChangeLog        2016-04-20 23:43:34 UTC (rev 199797)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2016-04-20  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        Modern IDB (Workers): Introduce &quot;IDBConnectionProxy&quot; for future threading abstraction, and adopt it in IDBFactory.
+        https://bugs.webkit.org/show_bug.cgi?id=156810
+
+        Reviewed by Alex Christensen.
+
+        * storage/indexeddb/intversion-bad-parameters-expected.txt:
+        * storage/indexeddb/intversion-bad-parameters-private-expected.txt:
+        * storage/indexeddb/modern/opendatabase-request-event-expected.txt:
+        * storage/indexeddb/modern/opendatabase-request-event-private-expected.txt:
+        * storage/indexeddb/modern/opendatabase-request-expected.txt:
+        * storage/indexeddb/modern/opendatabase-request-private-expected.txt:
+        * storage/indexeddb/modern/workers-enable-expected.txt:
+        * storage/indexeddb/version-change-event-basic-expected.txt:
+        * storage/indexeddb/version-change-event-basic-private-expected.txt:
+
</ins><span class="cx"> 2016-04-20  Ryan Haddad  &lt;ryanhaddad@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Marking compositing/webgl/webgl-reflection.html as failing on ios-simulator
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbintversionbadparametersexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/intversion-bad-parameters-expected.txt (199796 => 199797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/intversion-bad-parameters-expected.txt        2016-04-20 23:28:29 UTC (rev 199796)
+++ trunk/LayoutTests/storage/indexeddb/intversion-bad-parameters-expected.txt        2016-04-20 23:43:34 UTC (rev 199797)
</span><span class="lines">@@ -13,7 +13,7 @@
</span><span class="cx"> PASS indexedDB.open(dbname, 'stringversion') threw TypeError: Value NaN is outside the range [0, 9007199254740991]
</span><span class="cx"> Expecting TypeError exception from indexedDB.open(dbname, 0)
</span><span class="cx"> PASS Exception was thrown.
</span><del>-PASS indexedDB.open(dbname, 0) threw TypeError: Type error
</del><ins>+PASS indexedDB.open(dbname, 0) threw TypeError: IDBFactory.open() called with a version of 0
</ins><span class="cx"> Expecting TypeError exception from indexedDB.open(dbname, -5)
</span><span class="cx"> PASS Exception was thrown.
</span><span class="cx"> PASS indexedDB.open(dbname, -5) threw TypeError: Value -5 is outside the range [0, 9007199254740991]
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx"> PASS indexedDB.open(dbname, 0x20000000000000) threw TypeError: Value 9007199254740992 is outside the range [0, 9007199254740991]
</span><span class="cx"> Expecting TypeError exception from indexedDB.open(dbname, null)
</span><span class="cx"> PASS Exception was thrown.
</span><del>-PASS indexedDB.open(dbname, null) threw TypeError: Type error
</del><ins>+PASS indexedDB.open(dbname, null) threw TypeError: IDBFactory.open() called with a version of 0
</ins><span class="cx"> Expecting TypeError exception from indexedDB.open(dbname, undefined)
</span><span class="cx"> PASS Exception was thrown.
</span><span class="cx"> PASS indexedDB.open(dbname, undefined) threw TypeError: Value NaN is outside the range [0, 9007199254740991]
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbintversionbadparametersprivateexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/intversion-bad-parameters-private-expected.txt (199796 => 199797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/intversion-bad-parameters-private-expected.txt        2016-04-20 23:28:29 UTC (rev 199796)
+++ trunk/LayoutTests/storage/indexeddb/intversion-bad-parameters-private-expected.txt        2016-04-20 23:43:34 UTC (rev 199797)
</span><span class="lines">@@ -13,7 +13,7 @@
</span><span class="cx"> PASS indexedDB.open(dbname, 'stringversion') threw TypeError: Value NaN is outside the range [0, 9007199254740991]
</span><span class="cx"> Expecting TypeError exception from indexedDB.open(dbname, 0)
</span><span class="cx"> PASS Exception was thrown.
</span><del>-PASS indexedDB.open(dbname, 0) threw TypeError: Type error
</del><ins>+PASS indexedDB.open(dbname, 0) threw TypeError: IDBFactory.open() called with a version of 0
</ins><span class="cx"> Expecting TypeError exception from indexedDB.open(dbname, -5)
</span><span class="cx"> PASS Exception was thrown.
</span><span class="cx"> PASS indexedDB.open(dbname, -5) threw TypeError: Value -5 is outside the range [0, 9007199254740991]
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx"> PASS indexedDB.open(dbname, 0x20000000000000) threw TypeError: Value 9007199254740992 is outside the range [0, 9007199254740991]
</span><span class="cx"> Expecting TypeError exception from indexedDB.open(dbname, null)
</span><span class="cx"> PASS Exception was thrown.
</span><del>-PASS indexedDB.open(dbname, null) threw TypeError: Type error
</del><ins>+PASS indexedDB.open(dbname, null) threw TypeError: IDBFactory.open() called with a version of 0
</ins><span class="cx"> Expecting TypeError exception from indexedDB.open(dbname, undefined)
</span><span class="cx"> PASS Exception was thrown.
</span><span class="cx"> PASS indexedDB.open(dbname, undefined) threw TypeError: Value NaN is outside the range [0, 9007199254740991]
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernopendatabaserequesteventexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/modern/opendatabase-request-event-expected.txt (199796 => 199797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/opendatabase-request-event-expected.txt        2016-04-20 23:28:29 UTC (rev 199796)
+++ trunk/LayoutTests/storage/indexeddb/modern/opendatabase-request-event-expected.txt        2016-04-20 23:43:34 UTC (rev 199797)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx"> On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-Caught exception TypeError: Type error
</del><ins>+Caught exception TypeError: IDBFactory.open() called with a version of 0
</ins><span class="cx"> Caught exception TypeError: Value -1 is outside the range [0, 9007199254740991]
</span><span class="cx"> [object IDBOpenDBRequest]
</span><span class="cx"> upgradeneeded: old version - 0 new version - 1
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernopendatabaserequesteventprivateexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/modern/opendatabase-request-event-private-expected.txt (199796 => 199797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/opendatabase-request-event-private-expected.txt        2016-04-20 23:28:29 UTC (rev 199796)
+++ trunk/LayoutTests/storage/indexeddb/modern/opendatabase-request-event-private-expected.txt        2016-04-20 23:43:34 UTC (rev 199797)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx"> On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-Caught exception TypeError: Type error
</del><ins>+Caught exception TypeError: IDBFactory.open() called with a version of 0
</ins><span class="cx"> Caught exception TypeError: Value -1 is outside the range [0, 9007199254740991]
</span><span class="cx"> [object IDBOpenDBRequest]
</span><span class="cx"> upgradeneeded: old version - 0 new version - 1
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernopendatabaserequestexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/modern/opendatabase-request-expected.txt (199796 => 199797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/opendatabase-request-expected.txt        2016-04-20 23:28:29 UTC (rev 199796)
+++ trunk/LayoutTests/storage/indexeddb/modern/opendatabase-request-expected.txt        2016-04-20 23:43:34 UTC (rev 199797)
</span><span class="lines">@@ -6,7 +6,7 @@
</span><span class="cx"> [object IDBOpenDBRequest]
</span><span class="cx"> [object IDBOpenDBRequest]
</span><span class="cx"> TypeError: Not enough arguments
</span><del>-TypeError: Type error
</del><ins>+TypeError: IDBFactory.open() called with a version of 0
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernopendatabaserequestprivateexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/modern/opendatabase-request-private-expected.txt (199796 => 199797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/opendatabase-request-private-expected.txt        2016-04-20 23:28:29 UTC (rev 199796)
+++ trunk/LayoutTests/storage/indexeddb/modern/opendatabase-request-private-expected.txt        2016-04-20 23:43:34 UTC (rev 199797)
</span><span class="lines">@@ -6,7 +6,7 @@
</span><span class="cx"> [object IDBOpenDBRequest]
</span><span class="cx"> [object IDBOpenDBRequest]
</span><span class="cx"> TypeError: Not enough arguments
</span><del>-TypeError: Type error
</del><ins>+TypeError: IDBFactory.open() called with a version of 0
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernworkersenableexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/modern/workers-enable-expected.txt (199796 => 199797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/workers-enable-expected.txt        2016-04-20 23:28:29 UTC (rev 199796)
+++ trunk/LayoutTests/storage/indexeddb/modern/workers-enable-expected.txt        2016-04-20 23:43:34 UTC (rev 199797)
</span><span class="lines">@@ -5,8 +5,8 @@
</span><span class="cx"> 
</span><span class="cx"> Starting worker: resources/workers-enable.js
</span><span class="cx"> PASS [Worker] self.indexedDB is defined.
</span><del>-FAIL [Worker] self.indexedDB should be non-null. Was null
-FAIL [Worker] self.indexedDB instanceof IDBFactory should be true. Was false.
</del><ins>+PASS [Worker] self.indexedDB is non-null.
+PASS [Worker] self.indexedDB instanceof IDBFactory is true
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbversionchangeeventbasicexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/version-change-event-basic-expected.txt (199796 => 199797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/version-change-event-basic-expected.txt        2016-04-20 23:28:29 UTC (rev 199796)
+++ trunk/LayoutTests/storage/indexeddb/version-change-event-basic-expected.txt        2016-04-20 23:43:34 UTC (rev 199797)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-0 version: TypeError: Type error
</del><ins>+0 version: TypeError: IDBFactory.open() called with a version of 0
</ins><span class="cx"> Negative version: TypeError: Value -1 is outside the range [0, 9007199254740991]
</span><span class="cx"> String version: TypeError: Value NaN is outside the range [0, 9007199254740991]
</span><span class="cx"> First request: 0 1
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbversionchangeeventbasicprivateexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/version-change-event-basic-private-expected.txt (199796 => 199797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/version-change-event-basic-private-expected.txt        2016-04-20 23:28:29 UTC (rev 199796)
+++ trunk/LayoutTests/storage/indexeddb/version-change-event-basic-private-expected.txt        2016-04-20 23:43:34 UTC (rev 199797)
</span><span class="lines">@@ -1,4 +1,4 @@
</span><del>-0 version: TypeError: Type error
</del><ins>+0 version: TypeError: IDBFactory.open() called with a version of 0
</ins><span class="cx"> Negative version: TypeError: Value -1 is outside the range [0, 9007199254740991]
</span><span class="cx"> String version: TypeError: Value NaN is outside the range [0, 9007199254740991]
</span><span class="cx"> First request: 0 1
</span></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (199796 => 199797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-04-20 23:28:29 UTC (rev 199796)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-04-20 23:43:34 UTC (rev 199797)
</span><span class="lines">@@ -855,6 +855,7 @@
</span><span class="cx">     Modules/indexeddb/IDBVersionChangeEvent.cpp
</span><span class="cx">     Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp
</span><span class="cx"> 
</span><ins>+    Modules/indexeddb/client/IDBConnectionProxy.cpp
</ins><span class="cx">     Modules/indexeddb/client/IDBConnectionToServer.cpp
</span><span class="cx">     Modules/indexeddb/client/TransactionOperation.cpp
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (199796 => 199797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-04-20 23:28:29 UTC (rev 199796)
+++ trunk/Source/WebCore/ChangeLog        2016-04-20 23:43:34 UTC (rev 199797)
</span><span class="lines">@@ -1,3 +1,56 @@
</span><ins>+2016-04-20  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        Modern IDB (Workers): Introduce &quot;IDBConnectionProxy&quot; for future threading abstraction, and adopt it in IDBFactory.
+        https://bugs.webkit.org/show_bug.cgi?id=156810
+
+        Reviewed by Alex Christensen.
+
+        No new tests (Covered by changes to existing tests).
+
+        Add the IDBConnectionProxy object, including the ability to replicate IDBFactory functionality:
+        * Modules/indexeddb/client/IDBConnectionProxy.cpp: Added.
+        (WebCore::IDBClient::IDBConnectionProxy::IDBConnectionProxy):
+        (WebCore::IDBClient::IDBConnectionProxy::openDatabase):
+        (WebCore::IDBClient::IDBConnectionProxy::deleteDatabase):
+        * Modules/indexeddb/client/IDBConnectionProxy.h: 
+        
+        Add pure virtual IDBConnectionProxy accessor:
+        * dom/ScriptExecutionContext.h: 
+
+        Implement it:
+        * dom/Document.cpp:
+        (WebCore::Document::idbConnectionProxy):
+        * dom/Document.h:
+        
+        Implement it:
+        * workers/WorkerGlobalScope.cpp:
+        (WebCore::WorkerGlobalScope::idbConnectionProxy):
+        * workers/WorkerGlobalScope.h:
+        
+        * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
+        (WebCore::DOMWindowIndexedDatabase::indexedDB):
+
+
+        Don't keep a reference to IDBConnectionToServer, but rather get at the context's IDBConnectionProxy:
+        * Modules/indexeddb/IDBFactory.cpp:
+        (WebCore::IDBFactory::create):
+        (WebCore::IDBFactory::IDBFactory):
+        (WebCore::IDBFactory::open):
+        (WebCore::IDBFactory::openInternal):
+        (WebCore::IDBFactory::deleteDatabase):
+        * Modules/indexeddb/IDBFactory.h:
+        * Modules/indexeddb/IDBFactory.idl:
+
+        * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp:
+        (WebCore::WorkerGlobalScopeIndexedDatabase::indexedDB):
+
+        * Modules/indexeddb/client/IDBConnectionToServer.h:
+
+        * inspector/InspectorIndexedDBAgent.cpp:
+
+        * CMakeLists.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+
</ins><span class="cx"> 2016-04-20  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Use Optional&lt;size_t&gt; for OrderIterator::m_orderIndex instead of int
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbDOMWindowIndexedDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.cpp (199796 => 199797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.cpp        2016-04-20 23:28:29 UTC (rev 199796)
+++ trunk/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.cpp        2016-04-20 23:43:34 UTC (rev 199797)
</span><span class="lines">@@ -112,7 +112,7 @@
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     if (!m_idbFactory)
</span><del>-        m_idbFactory = IDBFactory::create(page-&gt;idbConnection());
</del><ins>+        m_idbFactory = IDBFactory::create();
</ins><span class="cx"> 
</span><span class="cx">     return m_idbFactory.get();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBFactorycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBFactory.cpp (199796 => 199797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBFactory.cpp        2016-04-20 23:28:29 UTC (rev 199796)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBFactory.cpp        2016-04-20 23:43:34 UTC (rev 199797)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include &quot;Document.h&quot;
</span><span class="cx"> #include &quot;ExceptionCode.h&quot;
</span><span class="cx"> #include &quot;IDBBindingUtilities.h&quot;
</span><ins>+#include &quot;IDBConnectionProxy.h&quot;
</ins><span class="cx"> #include &quot;IDBConnectionToServer.h&quot;
</span><span class="cx"> #include &quot;IDBDatabaseIdentifier.h&quot;
</span><span class="cx"> #include &quot;IDBKey.h&quot;
</span><span class="lines">@@ -62,13 +63,12 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Ref&lt;IDBFactory&gt; IDBFactory::create(IDBClient::IDBConnectionToServer&amp; connection)
</del><ins>+Ref&lt;IDBFactory&gt; IDBFactory::create()
</ins><span class="cx"> {
</span><del>-    return adoptRef(*new IDBFactory(connection));
</del><ins>+    return adoptRef(*new IDBFactory);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-IDBFactory::IDBFactory(IDBClient::IDBConnectionToServer&amp; connection)
-    : m_connectionToServer(connection)
</del><ins>+IDBFactory::IDBFactory()
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -76,34 +76,37 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBOpenDBRequest&gt; IDBFactory::open(ScriptExecutionContext&amp; context, const String&amp; name, ExceptionCode&amp; ec)
</del><ins>+RefPtr&lt;IDBOpenDBRequest&gt; IDBFactory::open(ScriptExecutionContext&amp; context, const String&amp; name, ExceptionCodeWithMessage&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBFactory::open&quot;);
</span><span class="cx">     
</span><span class="cx">     return openInternal(context, name, 0, ec);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBOpenDBRequest&gt; IDBFactory::open(ScriptExecutionContext&amp; context, const String&amp; name, unsigned long long version, ExceptionCode&amp; ec)
</del><ins>+RefPtr&lt;IDBOpenDBRequest&gt; IDBFactory::open(ScriptExecutionContext&amp; context, const String&amp; name, unsigned long long version, ExceptionCodeWithMessage&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBFactory::open&quot;);
</span><span class="cx">     
</span><span class="cx">     if (!version) {
</span><del>-        ec = TypeError;
</del><ins>+        ec.code = TypeError;
+        ec.message = ASCIILiteral(&quot;IDBFactory.open() called with a version of 0&quot;);
</ins><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return openInternal(context, name, version, ec);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBOpenDBRequest&gt; IDBFactory::openInternal(ScriptExecutionContext&amp; context, const String&amp; name, unsigned long long version, ExceptionCode&amp; ec)
</del><ins>+RefPtr&lt;IDBOpenDBRequest&gt; IDBFactory::openInternal(ScriptExecutionContext&amp; context, const String&amp; name, unsigned long long version, ExceptionCodeWithMessage&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     if (name.isNull()) {
</span><del>-        ec = TypeError;
</del><ins>+        ec.code = TypeError;
+        ec.message = ASCIILiteral(&quot;IDBFactory.open() called without a database name&quot;);
</ins><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (shouldThrowSecurityException(context)) {
</span><del>-        ec = SECURITY_ERR;
</del><ins>+        ec.code = SECURITY_ERR;
+        ec.message = ASCIILiteral(&quot;IDBFactory.open() called in an invalid security context&quot;);
</ins><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -111,27 +114,33 @@
</span><span class="cx">     ASSERT(context.topOrigin());
</span><span class="cx">     IDBDatabaseIdentifier databaseIdentifier(name, *context.securityOrigin(), *context.topOrigin());
</span><span class="cx">     if (!databaseIdentifier.isValid()) {
</span><del>-        ec = TypeError;
</del><ins>+        ec.code = TypeError;
+        ec.message = ASCIILiteral(&quot;IDBFactory.open() called with an invalid security origin&quot;);
</ins><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    auto request = IDBOpenDBRequest::createOpenRequest(m_connectionToServer.get(), context, databaseIdentifier, version);
-    m_connectionToServer-&gt;openDatabase(request.get());
</del><ins>+    auto* connectionProxy = context.idbConnectionProxy();
+    if (!connectionProxy) {
+        ec.code = SECURITY_ERR;
+        ec.message = ASCIILiteral(&quot;IDBFactory.open() called at an invalid time&quot;);
+        return nullptr;
+    }
</ins><span class="cx"> 
</span><del>-    return adoptRef(&amp;request.leakRef());
</del><ins>+    return connectionProxy-&gt;openDatabase(context, databaseIdentifier, version);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;IDBOpenDBRequest&gt; IDBFactory::deleteDatabase(ScriptExecutionContext&amp; context, const String&amp; name, ExceptionCode&amp; ec)
</del><ins>+RefPtr&lt;IDBOpenDBRequest&gt; IDBFactory::deleteDatabase(ScriptExecutionContext&amp; context, const String&amp; name, ExceptionCodeWithMessage&amp; ec)
</ins><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBFactory::deleteDatabase - %s&quot;, name.utf8().data());
</span><span class="cx"> 
</span><span class="cx">     if (name.isNull()) {
</span><del>-        ec = TypeError;
-        return nullptr;
</del><ins>+        ec.code = TypeError;
+        ec.message = ASCIILiteral(&quot;IDBFactory.deleteDatabase() called without a database name&quot;);
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     if (shouldThrowSecurityException(context)) {
</span><del>-        ec = SECURITY_ERR;
</del><ins>+        ec.code = SECURITY_ERR;
+        ec.message = ASCIILiteral(&quot;IDBFactory.deleteDatabase() called in an invalid security context&quot;);
</ins><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -139,14 +148,19 @@
</span><span class="cx">     ASSERT(context.topOrigin());
</span><span class="cx">     IDBDatabaseIdentifier databaseIdentifier(name, *context.securityOrigin(), *context.topOrigin());
</span><span class="cx">     if (!databaseIdentifier.isValid()) {
</span><del>-        ec = TypeError;
</del><ins>+        ec.code = TypeError;
+        ec.message = ASCIILiteral(&quot;IDBFactory.deleteDatabase() called with an invalid security origin&quot;);
</ins><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    auto request = IDBOpenDBRequest::createDeleteRequest(m_connectionToServer.get(), context, databaseIdentifier);
-    m_connectionToServer-&gt;deleteDatabase(request.get());
</del><ins>+    auto* connectionProxy = context.idbConnectionProxy();
+    if (!connectionProxy) {
+        ec.code = SECURITY_ERR;
+        ec.message = ASCIILiteral(&quot;IDBFactory.deleteDatabase() called at an invalid time&quot;);
+        return nullptr;
+    }
</ins><span class="cx"> 
</span><del>-    return adoptRef(&amp;request.leakRef());
</del><ins>+    return connectionProxy-&gt;deleteDatabase(context, databaseIdentifier);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> short IDBFactory::cmp(ScriptExecutionContext&amp; context, JSValue firstValue, JSValue secondValue, ExceptionCodeWithMessage&amp; ec)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBFactoryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBFactory.h (199796 => 199797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBFactory.h        2016-04-20 23:28:29 UTC (rev 199796)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBFactory.h        2016-04-20 23:43:34 UTC (rev 199797)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2015, 2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -29,7 +29,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="cx"> #include &lt;wtf/Ref.h&gt;
</span><del>-#include &lt;wtf/RefCounted.h&gt;
</del><ins>+#include &lt;wtf/ThreadSafeRefCounted.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> class JSValue;
</span><span class="lines">@@ -48,23 +48,21 @@
</span><span class="cx"> 
</span><span class="cx"> typedef int ExceptionCode;
</span><span class="cx"> 
</span><del>-class IDBFactory : public RefCounted&lt;IDBFactory&gt; {
</del><ins>+class IDBFactory : public ThreadSafeRefCounted&lt;IDBFactory&gt; {
</ins><span class="cx"> public:
</span><del>-    static Ref&lt;IDBFactory&gt; create(IDBClient::IDBConnectionToServer&amp;);
</del><ins>+    static Ref&lt;IDBFactory&gt; create();
</ins><span class="cx">     ~IDBFactory();
</span><span class="cx"> 
</span><del>-    RefPtr&lt;IDBOpenDBRequest&gt; open(ScriptExecutionContext&amp;, const String&amp; name, ExceptionCode&amp;);
-    RefPtr&lt;IDBOpenDBRequest&gt; open(ScriptExecutionContext&amp;, const String&amp; name, unsigned long long version, ExceptionCode&amp;);
-    RefPtr&lt;IDBOpenDBRequest&gt; deleteDatabase(ScriptExecutionContext&amp;, const String&amp; name, ExceptionCode&amp;);
</del><ins>+    RefPtr&lt;IDBOpenDBRequest&gt; open(ScriptExecutionContext&amp;, const String&amp; name, ExceptionCodeWithMessage&amp;);
+    RefPtr&lt;IDBOpenDBRequest&gt; open(ScriptExecutionContext&amp;, const String&amp; name, unsigned long long version, ExceptionCodeWithMessage&amp;);
+    RefPtr&lt;IDBOpenDBRequest&gt; deleteDatabase(ScriptExecutionContext&amp;, const String&amp; name, ExceptionCodeWithMessage&amp;);
</ins><span class="cx"> 
</span><span class="cx">     short cmp(ScriptExecutionContext&amp;, JSC::JSValue first, JSC::JSValue second, ExceptionCodeWithMessage&amp;);
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    explicit IDBFactory(IDBClient::IDBConnectionToServer&amp;);
</del><ins>+    explicit IDBFactory();
</ins><span class="cx"> 
</span><del>-    RefPtr&lt;IDBOpenDBRequest&gt; openInternal(ScriptExecutionContext&amp;, const String&amp; name, unsigned long long version, ExceptionCode&amp;);
-
-    Ref&lt;IDBClient::IDBConnectionToServer&gt; m_connectionToServer;
</del><ins>+    RefPtr&lt;IDBOpenDBRequest&gt; openInternal(ScriptExecutionContext&amp;, const String&amp; name, unsigned long long version, ExceptionCodeWithMessage&amp;);
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBFactoryidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBFactory.idl (199796 => 199797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBFactory.idl        2016-04-20 23:28:29 UTC (rev 199796)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBFactory.idl        2016-04-20 23:43:34 UTC (rev 199797)
</span><span class="lines">@@ -29,8 +29,8 @@
</span><span class="cx">     SkipVTableValidation,
</span><span class="cx">     Exposed=(Window,Worker),
</span><span class="cx"> ] interface IDBFactory {
</span><del>-    [CallWith=ScriptExecutionContext, RaisesException] IDBOpenDBRequest open(DOMString name, [EnforceRange] optional unsigned long long version);
-    [CallWith=ScriptExecutionContext, RaisesException] IDBOpenDBRequest deleteDatabase(DOMString name);
</del><ins>+    [CallWith=ScriptExecutionContext, RaisesExceptionWithMessage] IDBOpenDBRequest open(DOMString name, [EnforceRange] optional unsigned long long version);
+    [CallWith=ScriptExecutionContext, RaisesExceptionWithMessage] IDBOpenDBRequest deleteDatabase(DOMString name);
</ins><span class="cx">     [CallWith=ScriptExecutionContext, RaisesExceptionWithMessage] short cmp(any first, any second);
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbWorkerGlobalScopeIndexedDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp (199796 => 199797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp        2016-04-20 23:28:29 UTC (rev 199796)
+++ trunk/Source/WebCore/Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp        2016-04-20 23:43:34 UTC (rev 199797)
</span><span class="lines">@@ -69,7 +69,10 @@
</span><span class="cx"> 
</span><span class="cx"> IDBFactory* WorkerGlobalScopeIndexedDatabase::indexedDB()
</span><span class="cx"> {
</span><del>-    return nullptr;
</del><ins>+    if (!m_idbFactory)
+        m_idbFactory = IDBFactory::create();
+
+    return m_idbFactory.get();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionProxycpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp (0 => 199797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp                                (rev 0)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp        2016-04-20 23:43:34 UTC (rev 199797)
</span><span class="lines">@@ -0,0 +1,71 @@
</span><ins>+/*
+ * Copyright (C) 2016 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;IDBConnectionProxy.h&quot;
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include &quot;IDBOpenDBRequest.h&quot;
+#include &lt;wtf/MainThread.h&gt;
+
+namespace WebCore {
+namespace IDBClient {
+
+IDBConnectionProxy::IDBConnectionProxy(IDBConnectionToServer&amp; connection)
+    : m_connectionToServer(connection)
+{
+}
+
+RefPtr&lt;IDBOpenDBRequest&gt; IDBConnectionProxy::openDatabase(ScriptExecutionContext&amp; context, const IDBDatabaseIdentifier&amp; databaseIdentifier, uint64_t version)
+{
+    // FIXME: Get rid of the need for IDB objects to hold a reference to the IDBConnectionToServer,
+    // which will enable them to operate on Worker threads.
+    if (!isMainThread())
+        return nullptr;
+
+    auto request = IDBOpenDBRequest::createOpenRequest(m_connectionToServer.get(), context, databaseIdentifier, version);
+    m_connectionToServer-&gt;openDatabase(request.get());
+
+    return adoptRef(&amp;request.leakRef());
+}
+
+RefPtr&lt;IDBOpenDBRequest&gt; IDBConnectionProxy::deleteDatabase(ScriptExecutionContext&amp; context, const IDBDatabaseIdentifier&amp; databaseIdentifier)
+{
+    // FIXME: Get rid of the need for IDB objects to hold a reference to the IDBConnectionToServer,
+    // which will enable them to operate on Worker threads.
+    if (!isMainThread())
+        return nullptr;
+
+    auto request = IDBOpenDBRequest::createDeleteRequest(m_connectionToServer.get(), context, databaseIdentifier);
+    m_connectionToServer-&gt;deleteDatabase(request.get());
+
+    return adoptRef(&amp;request.leakRef());
+}
+
+} // namesapce IDBClient
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionProxyhfromrev199796trunkSourceWebCoreModulesindexeddbIDBFactoryh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.h (from rev 199796, trunk/Source/WebCore/Modules/indexeddb/IDBFactory.h) (0 => 199797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.h                                (rev 0)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.h        2016-04-20 23:43:34 UTC (rev 199797)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+/*
+ * Copyright (C) 2016 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
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include &quot;IDBConnectionToServer.h&quot;
+
+namespace WebCore {
+
+class IDBDatabaseIdentifier;
+class IDBOpenDBRequest;
+class ScriptExecutionContext;
+
+namespace IDBClient {
+
+class IDBConnectionProxy {
+public:
+    IDBConnectionProxy(IDBConnectionToServer&amp;);
+
+    RefPtr&lt;IDBOpenDBRequest&gt; openDatabase(ScriptExecutionContext&amp;, const IDBDatabaseIdentifier&amp;, uint64_t version);
+    RefPtr&lt;IDBOpenDBRequest&gt; deleteDatabase(ScriptExecutionContext&amp;, const IDBDatabaseIdentifier&amp;);
+
+private:
+    Ref&lt;IDBConnectionToServer&gt; m_connectionToServer;
+};
+
+} // namespace IDBClient
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h (199796 => 199797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h        2016-04-20 23:28:29 UTC (rev 199796)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h        2016-04-20 23:43:34 UTC (rev 199797)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2015, 2016 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -23,8 +23,7 @@
</span><span class="cx">  * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef IDBConnectionToServer_h
-#define IDBConnectionToServer_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><span class="lines">@@ -34,7 +33,7 @@
</span><span class="cx"> #include &lt;wtf/HashMap.h&gt;
</span><span class="cx"> #include &lt;wtf/HashSet.h&gt;
</span><span class="cx"> #include &lt;wtf/Ref.h&gt;
</span><del>-#include &lt;wtf/RefCounted.h&gt;
</del><ins>+#include &lt;wtf/ThreadSafeRefCounted.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -51,7 +50,7 @@
</span><span class="cx"> 
</span><span class="cx"> class TransactionOperation;
</span><span class="cx"> 
</span><del>-class IDBConnectionToServer : public RefCounted&lt;IDBConnectionToServer&gt; {
</del><ins>+class IDBConnectionToServer : public ThreadSafeRefCounted&lt;IDBConnectionToServer&gt; {
</ins><span class="cx"> public:
</span><span class="cx">     WEBCORE_EXPORT static Ref&lt;IDBConnectionToServer&gt; create(IDBConnectionToServerDelegate&amp;);
</span><span class="cx"> 
</span><span class="lines">@@ -143,4 +142,3 @@
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(INDEXED_DATABASE)
</span><del>-#endif // IDBConnectionToServer_h
</del></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (199796 => 199797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-04-20 23:28:29 UTC (rev 199796)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-04-20 23:43:34 UTC (rev 199797)
</span><span class="lines">@@ -2085,6 +2085,8 @@
</span><span class="cx">                 517A63C41B74318B00E7DCDC /* KeyedEncoderCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 517A63C11B74317E00E7DCDC /* KeyedEncoderCF.cpp */; };
</span><span class="cx">                 517A63C51B74318F00E7DCDC /* KeyedDecoderCF.h in Headers */ = {isa = PBXBuildFile; fileRef = 517A63C01B74317E00E7DCDC /* KeyedDecoderCF.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 517A63C61B74319200E7DCDC /* KeyedEncoderCF.h in Headers */ = {isa = PBXBuildFile; fileRef = 517A63C21B74317E00E7DCDC /* KeyedEncoderCF.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                517B25A91CC82B2A0061C011 /* IDBConnectionProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 517B25A71CC820320061C011 /* IDBConnectionProxy.cpp */; };
+                517B25AA1CC82B2A0061C011 /* IDBConnectionProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 517B25A81CC820320061C011 /* IDBConnectionProxy.h */; };
</ins><span class="cx">                 517FBA1E151AB17C00B57959 /* DOMWindowExtension.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 517FBA17151AA71B00B57959 /* DOMWindowExtension.cpp */; };
</span><span class="cx">                 5185FC741BB4C4E80012898F /* DOMWindowIndexedDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D7196C181106DF0016DC51 /* DOMWindowIndexedDatabase.cpp */; };
</span><span class="cx">                 5185FC751BB4C4E80012898F /* DOMWindowIndexedDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D7196D181106DF0016DC51 /* DOMWindowIndexedDatabase.h */; };
</span><span class="lines">@@ -9672,6 +9674,8 @@
</span><span class="cx">                 517A63C01B74317E00E7DCDC /* KeyedDecoderCF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeyedDecoderCF.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 517A63C11B74317E00E7DCDC /* KeyedEncoderCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KeyedEncoderCF.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 517A63C21B74317E00E7DCDC /* KeyedEncoderCF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeyedEncoderCF.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                517B25A71CC820320061C011 /* IDBConnectionProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBConnectionProxy.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                517B25A81CC820320061C011 /* IDBConnectionProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBConnectionProxy.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 517FBA17151AA71B00B57959 /* DOMWindowExtension.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMWindowExtension.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 517FBA18151AA71B00B57959 /* DOMWindowExtension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMWindowExtension.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5185FCB61BB4C7610012898F /* DOMRequestState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMRequestState.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -17223,6 +17227,8 @@
</span><span class="cx">                 510310421BA8C64C003329C0 /* client */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                517B25A71CC820320061C011 /* IDBConnectionProxy.cpp */,
+                                517B25A81CC820320061C011 /* IDBConnectionProxy.h */,
</ins><span class="cx">                                 5185FCBC1BB5CB770012898F /* IDBConnectionToServer.cpp */,
</span><span class="cx">                                 510A58FD1BB07A9600C19282 /* IDBConnectionToServer.h */,
</span><span class="cx">                                 5185FCBD1BB5CB770012898F /* IDBConnectionToServerDelegate.h */,
</span><span class="lines">@@ -28396,6 +28402,7 @@
</span><span class="cx">                                 2D232C001A326F02006BF2DB /* TUCallSPI.h in Headers */,
</span><span class="cx">                                 C375D7FE16639519006184AB /* TypeAhead.h in Headers */,
</span><span class="cx">                                 E46A2B1C17CA65B9000DBCD8 /* TypedElementDescendantIterator.h in Headers */,
</span><ins>+                                517B25AA1CC82B2A0061C011 /* IDBConnectionProxy.h in Headers */,
</ins><span class="cx">                                 93309E1A099E64920056E581 /* TypingCommand.h in Headers */,
</span><span class="cx">                                 85031B4E0A44EFC700F992E0 /* UIEvent.h in Headers */,
</span><span class="cx">                                 85031B4F0A44EFC700F992E0 /* UIEventWithKeyState.h in Headers */,
</span><span class="lines">@@ -30557,6 +30564,7 @@
</span><span class="cx">                                 4147E2B81C89912F00A7E715 /* FetchBodyOwner.cpp in Sources */,
</span><span class="cx">                                 5E2C436B1BCF071E0001E2BC /* JSRTCTrackEvent.cpp in Sources */,
</span><span class="cx">                                 BCEC01C20C274DDD009F4EC9 /* JSScreen.cpp in Sources */,
</span><ins>+                                517B25A91CC82B2A0061C011 /* IDBConnectionProxy.cpp in Sources */,
</ins><span class="cx">                                 FDA15ECD12B03F61003A583A /* JSScriptProcessorNode.cpp in Sources */,
</span><span class="cx">                                 9FA37EFA1172FDA600C4CD55 /* JSScriptProfile.cpp in Sources */,
</span><span class="cx">                                 9FA37EFC1172FDA600C4CD55 /* JSScriptProfileNode.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (199796 => 199797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2016-04-20 23:28:29 UTC (rev 199796)
+++ trunk/Source/WebCore/dom/Document.cpp        2016-04-20 23:43:34 UTC (rev 199797)
</span><span class="lines">@@ -201,6 +201,11 @@
</span><span class="cx"> #include &quot;RenderFullScreen.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(INDEXED_DATABASE)
+#include &quot;IDBConnectionProxy.h&quot;
+#include &quot;IDBOpenDBRequest.h&quot;
+#endif
+
</ins><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> #include &quot;CSSFontSelector.h&quot;
</span><span class="cx"> #include &quot;DeviceMotionClientIOS.h&quot;
</span><span class="lines">@@ -3103,6 +3108,21 @@
</span><span class="cx">     frame()-&gt;script().disableEval(errorMessage);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if ENABLE(INDEXED_DATABASE)
+IDBClient::IDBConnectionProxy* Document::idbConnectionProxy()
+{
+    if (!m_idbConnectionProxy) {
+        Page* currentPage = page();
+        if (!currentPage)
+            return nullptr;
+
+        m_idbConnectionProxy = std::make_unique&lt;IDBClient::IDBConnectionProxy&gt;(currentPage-&gt;idbConnection());
+    }
+
+    return m_idbConnectionProxy.get();
+}
+#endif // ENABLE(INDEXED_DATABASE)
+
</ins><span class="cx"> bool Document::canNavigate(Frame* targetFrame)
</span><span class="cx"> {
</span><span class="cx">     if (!m_frame)
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.h (199796 => 199797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.h        2016-04-20 23:28:29 UTC (rev 199796)
+++ trunk/Source/WebCore/dom/Document.h        2016-04-20 23:43:34 UTC (rev 199797)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><span class="cx">  *           (C) 2001 Dirk Mueller (mueller@kde.org)
</span><span class="cx">  *           (C) 2006 Alexey Proskuryakov (ap@webkit.org)
</span><del>- * Copyright (C) 2004-2010, 2012-2013, 2015 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2010, 2012-2013, 2015, 2016 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
</span><span class="cx">  * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
</span><span class="cx">  * Copyright (C) 2011 Google Inc. All rights reserved.
</span><span class="lines">@@ -25,8 +25,7 @@
</span><span class="cx">  *
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef Document_h
-#define Document_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #include &quot;CollectionType.h&quot;
</span><span class="cx"> #include &quot;Color.h&quot;
</span><span class="lines">@@ -661,6 +660,10 @@
</span><span class="cx"> 
</span><span class="cx">     void disableEval(const String&amp; errorMessage) final;
</span><span class="cx"> 
</span><ins>+#if ENABLE(INDEXED_DATABASE)
+    IDBClient::IDBConnectionProxy* idbConnectionProxy() final;
+#endif
+
</ins><span class="cx">     bool canNavigate(Frame* targetFrame);
</span><span class="cx">     Frame* findUnsafeParentScrollPropagationBoundary();
</span><span class="cx"> 
</span><span class="lines">@@ -1776,6 +1779,10 @@
</span><span class="cx"> #if ENABLE(MEDIA_STREAM)
</span><span class="cx">     bool m_hasHadActiveMediaStreamTrack { false };
</span><span class="cx"> #endif
</span><ins>+
+#if ENABLE(INDEXED_DATABASE)
+    std::unique_ptr&lt;IDBClient::IDBConnectionProxy&gt; m_idbConnectionProxy;
+#endif
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> inline void Document::notifyRemovePendingSheetIfNeeded()
</span><span class="lines">@@ -1818,5 +1825,3 @@
</span><span class="cx">     static bool isType(const WebCore::ScriptExecutionContext&amp; context) { return context.isDocument(); }
</span><span class="cx">     static bool isType(const WebCore::Node&amp; node) { return node.isDocumentNode(); }
</span><span class="cx"> SPECIALIZE_TYPE_TRAITS_END()
</span><del>-
-#endif // Document_h
</del></span></pre></div>
<a id="trunkSourceWebCoredomScriptExecutionContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ScriptExecutionContext.h (199796 => 199797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ScriptExecutionContext.h        2016-04-20 23:28:29 UTC (rev 199796)
+++ trunk/Source/WebCore/dom/ScriptExecutionContext.h        2016-04-20 23:43:34 UTC (rev 199797)
</span><span class="lines">@@ -55,6 +55,10 @@
</span><span class="cx"> class SecurityOrigin;
</span><span class="cx"> class URL;
</span><span class="cx"> 
</span><ins>+namespace IDBClient {
+class IDBConnectionProxy;
+}
+
</ins><span class="cx"> class ScriptExecutionContext : public SecurityContext {
</span><span class="cx"> public:
</span><span class="cx">     ScriptExecutionContext();
</span><span class="lines">@@ -73,6 +77,10 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void disableEval(const String&amp; errorMessage) = 0;
</span><span class="cx"> 
</span><ins>+#if ENABLE(INDEXED_DATABASE)
+    virtual IDBClient::IDBConnectionProxy* idbConnectionProxy() = 0;
+#endif
+
</ins><span class="cx">     bool sanitizeScriptError(String&amp; errorMessage, int&amp; lineNumber, int&amp; columnNumber, String&amp; sourceURL, CachedScript* = nullptr);
</span><span class="cx">     void reportException(const String&amp; errorMessage, int lineNumber, int columnNumber, const String&amp; sourceURL, RefPtr&lt;Inspector::ScriptCallStack&gt;&amp;&amp;, CachedScript* = nullptr);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorIndexedDBAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp (199796 => 199797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp        2016-04-20 23:28:29 UTC (rev 199796)
+++ trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp        2016-04-20 23:43:34 UTC (rev 199797)
</span><span class="lines">@@ -206,7 +206,7 @@
</span><span class="cx"> void ExecutableWithDatabase::start(IDBFactory* idbFactory, SecurityOrigin*, const String&amp; databaseName)
</span><span class="cx"> {
</span><span class="cx">     Ref&lt;OpenDatabaseCallback&gt; callback = OpenDatabaseCallback::create(this);
</span><del>-    ExceptionCode ec = 0;
</del><ins>+    ExceptionCodeWithMessage ec;
</ins><span class="cx"> 
</span><span class="cx">     if (!context()) {
</span><span class="cx">         requestCallback().sendFailure(&quot;Could not open database.&quot;);
</span><span class="lines">@@ -214,7 +214,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;IDBOpenDBRequest&gt; idbOpenDBRequest = idbFactory-&gt;open(*context(), databaseName, ec);
</span><del>-    if (ec) {
</del><ins>+    if (ec.code) {
</ins><span class="cx">         requestCallback().sendFailure(&quot;Could not open database.&quot;);
</span><span class="cx">         return;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerGlobalScopecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/WorkerGlobalScope.cpp (199796 => 199797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/WorkerGlobalScope.cpp        2016-04-20 23:28:29 UTC (rev 199796)
+++ trunk/Source/WebCore/workers/WorkerGlobalScope.cpp        2016-04-20 23:43:34 UTC (rev 199797)
</span><span class="lines">@@ -112,6 +112,15 @@
</span><span class="cx">     m_script-&gt;disableEval(errorMessage);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if ENABLE(INDEXED_DATABASE)
+IDBClient::IDBConnectionProxy* WorkerGlobalScope::idbConnectionProxy()
+{
+    // FIXME: Implement
+
+    return nullptr;
+}
+#endif // ENABLE(INDEXED_DATABASE)
+
</ins><span class="cx"> WorkerLocation* WorkerGlobalScope::location() const
</span><span class="cx"> {
</span><span class="cx">     if (!m_location)
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerGlobalScopeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/WorkerGlobalScope.h (199796 => 199797)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/WorkerGlobalScope.h        2016-04-20 23:28:29 UTC (rev 199796)
+++ trunk/Source/WebCore/workers/WorkerGlobalScope.h        2016-04-20 23:43:34 UTC (rev 199797)
</span><span class="lines">@@ -70,6 +70,10 @@
</span><span class="cx"> 
</span><span class="cx">     void disableEval(const String&amp; errorMessage) override;
</span><span class="cx"> 
</span><ins>+#if ENABLE(INDEXED_DATABASE)
+    IDBClient::IDBConnectionProxy* idbConnectionProxy() final;
+#endif
+
</ins><span class="cx">     bool shouldBypassMainWorldContentSecurityPolicy() const final { return m_shouldBypassMainWorldContentSecurityPolicy; }
</span><span class="cx"> 
</span><span class="cx">     WorkerScriptController* script() { return m_script.get(); }
</span></span></pre>
</div>
</div>

</body>
</html>