<!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>[199835] 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/199835">199835</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2016-04-21 14:08:20 -0700 (Thu, 21 Apr 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Modern IDB (Workers): More IDBConnectionProxy refactoring.
https://bugs.webkit.org/show_bug.cgi?id=156855
Reviewed by Darin Adler.
Source/WebCore:
No new tests (Covered by changes to existing tests).
* Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
(WebCore::DOMWindowIndexedDatabase::indexedDB):
Hang on to the IDBConnectionProxy passed in at creation time, as it should never change:
* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::create):
(WebCore::IDBFactory::IDBFactory):
(WebCore::IDBFactory::openInternal):
(WebCore::IDBFactory::deleteDatabase):
* Modules/indexeddb/IDBFactory.h:
Hang on to the IDBConnectionProxy passed in at creation time, as it should never change:
* Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp:
(WebCore::WorkerGlobalScopeIndexedDatabase::WorkerGlobalScopeIndexedDatabase):
(WebCore::WorkerGlobalScopeIndexedDatabase::from):
(WebCore::WorkerGlobalScopeIndexedDatabase::indexedDB):
* Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h:
Make IDBConnectionProxy ThreadSafeRefCounted:
* Modules/indexeddb/client/IDBConnectionProxy.cpp:
(WebCore::IDBClient::IDBConnectionProxy::create):
* Modules/indexeddb/client/IDBConnectionProxy.h:
* dom/Document.cpp:
(WebCore::Document::idbConnectionProxy):
* dom/Document.h:
LayoutTests:
* storage/indexeddb/modern/workers-enable-expected.txt: Revert some of the PASS expectations to FAIL, just for now.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernworkersenableexpectedtxt">trunk/LayoutTests/storage/indexeddb/modern/workers-enable-expected.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="#trunkSourceWebCoreModulesindexeddbWorkerGlobalScopeIndexedDatabasecpp">trunk/Source/WebCore/Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbWorkerGlobalScopeIndexedDatabaseh">trunk/Source/WebCore/Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h</a></li>
<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>
<li><a href="#trunkSourceWebCoredomDocumentcpp">trunk/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumenth">trunk/Source/WebCore/dom/Document.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (199834 => 199835)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-04-21 21:00:02 UTC (rev 199834)
+++ trunk/LayoutTests/ChangeLog        2016-04-21 21:08:20 UTC (rev 199835)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2016-04-21 Brady Eidson <beidson@apple.com>
+
+ Modern IDB (Workers): More IDBConnectionProxy refactoring.
+ https://bugs.webkit.org/show_bug.cgi?id=156855
+
+ Reviewed by Darin Adler.
+
+ * storage/indexeddb/modern/workers-enable-expected.txt: Revert some of the PASS expectations to FAIL, just for now.
+
</ins><span class="cx"> 2016-04-21 Ryan Haddad <ryanhaddad@apple.com>
</span><span class="cx">
</span><span class="cx"> Skip <area ping> tests on ios-simulator
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernworkersenableexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/storage/indexeddb/modern/workers-enable-expected.txt (199834 => 199835)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/workers-enable-expected.txt        2016-04-21 21:00:02 UTC (rev 199834)
+++ trunk/LayoutTests/storage/indexeddb/modern/workers-enable-expected.txt        2016-04-21 21:08:20 UTC (rev 199835)
</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>-PASS [Worker] self.indexedDB is non-null.
-PASS [Worker] self.indexedDB instanceof IDBFactory is true
</del><ins>+FAIL [Worker] self.indexedDB should be non-null. Was null
+FAIL [Worker] self.indexedDB instanceof IDBFactory should be true. Was false.
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx">
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (199834 => 199835)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-04-21 21:00:02 UTC (rev 199834)
+++ trunk/Source/WebCore/ChangeLog        2016-04-21 21:08:20 UTC (rev 199835)
</span><span class="lines">@@ -1,3 +1,39 @@
</span><ins>+2016-04-21 Brady Eidson <beidson@apple.com>
+
+ Modern IDB (Workers): More IDBConnectionProxy refactoring.
+ https://bugs.webkit.org/show_bug.cgi?id=156855
+
+ Reviewed by Darin Adler.
+
+ No new tests (Covered by changes to existing tests).
+
+ * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
+ (WebCore::DOMWindowIndexedDatabase::indexedDB):
+
+ Hang on to the IDBConnectionProxy passed in at creation time, as it should never change:
+ * Modules/indexeddb/IDBFactory.cpp:
+ (WebCore::IDBFactory::create):
+ (WebCore::IDBFactory::IDBFactory):
+ (WebCore::IDBFactory::openInternal):
+ (WebCore::IDBFactory::deleteDatabase):
+ * Modules/indexeddb/IDBFactory.h:
+
+ Hang on to the IDBConnectionProxy passed in at creation time, as it should never change:
+ * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp:
+ (WebCore::WorkerGlobalScopeIndexedDatabase::WorkerGlobalScopeIndexedDatabase):
+ (WebCore::WorkerGlobalScopeIndexedDatabase::from):
+ (WebCore::WorkerGlobalScopeIndexedDatabase::indexedDB):
+ * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h:
+
+ Make IDBConnectionProxy ThreadSafeRefCounted:
+ * Modules/indexeddb/client/IDBConnectionProxy.cpp:
+ (WebCore::IDBClient::IDBConnectionProxy::create):
+ * Modules/indexeddb/client/IDBConnectionProxy.h:
+
+ * dom/Document.cpp:
+ (WebCore::Document::idbConnectionProxy):
+ * dom/Document.h:
+
</ins><span class="cx"> 2016-04-21 Keith Miller <keith_miller@apple.com>
</span><span class="cx">
</span><span class="cx"> WebScriptObject description swizzler should work in a multi-threaded world
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbDOMWindowIndexedDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.cpp (199834 => 199835)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.cpp        2016-04-21 21:00:02 UTC (rev 199834)
+++ trunk/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.cpp        2016-04-21 21:08:20 UTC (rev 199835)
</span><span class="lines">@@ -111,9 +111,14 @@
</span><span class="cx"> if (!m_window->isCurrentlyDisplayedInFrame())
</span><span class="cx"> return nullptr;
</span><span class="cx">
</span><del>- if (!m_idbFactory)
- m_idbFactory = IDBFactory::create();
</del><ins>+ if (!m_idbFactory) {
+ auto* connectionProxy = document->idbConnectionProxy();
+ if (!connectionProxy)
+ return nullptr;
</ins><span class="cx">
</span><ins>+ m_idbFactory = IDBFactory::create(*connectionProxy);
+ }
+
</ins><span class="cx"> return m_idbFactory.get();
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBFactorycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBFactory.cpp (199834 => 199835)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBFactory.cpp        2016-04-21 21:00:02 UTC (rev 199834)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBFactory.cpp        2016-04-21 21:08:20 UTC (rev 199835)
</span><span class="lines">@@ -63,12 +63,13 @@
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-Ref<IDBFactory> IDBFactory::create()
</del><ins>+Ref<IDBFactory> IDBFactory::create(IDBClient::IDBConnectionProxy& connectionProxy)
</ins><span class="cx"> {
</span><del>- return adoptRef(*new IDBFactory);
</del><ins>+ return adoptRef(*new IDBFactory(connectionProxy));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-IDBFactory::IDBFactory()
</del><ins>+IDBFactory::IDBFactory(IDBClient::IDBConnectionProxy& connectionProxy)
+ : m_connectionProxy(connectionProxy)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -119,14 +120,7 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- auto* connectionProxy = context.idbConnectionProxy();
- if (!connectionProxy) {
- ec.code = SECURITY_ERR;
- ec.message = ASCIILiteral("IDBFactory.open() called at an invalid time");
- return nullptr;
- }
-
- return connectionProxy->openDatabase(context, databaseIdentifier, version);
</del><ins>+ return m_connectionProxy->openDatabase(context, databaseIdentifier, version);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> RefPtr<IDBOpenDBRequest> IDBFactory::deleteDatabase(ScriptExecutionContext& context, const String& name, ExceptionCodeWithMessage& ec)
</span><span class="lines">@@ -153,14 +147,7 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- auto* connectionProxy = context.idbConnectionProxy();
- if (!connectionProxy) {
- ec.code = SECURITY_ERR;
- ec.message = ASCIILiteral("IDBFactory.deleteDatabase() called at an invalid time");
- return nullptr;
- }
-
- return connectionProxy->deleteDatabase(context, databaseIdentifier);
</del><ins>+ return m_connectionProxy->deleteDatabase(context, databaseIdentifier);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> short IDBFactory::cmp(ScriptExecutionContext& context, JSValue firstValue, JSValue secondValue, ExceptionCodeWithMessage& ec)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBFactoryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBFactory.h (199834 => 199835)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBFactory.h        2016-04-21 21:00:02 UTC (rev 199834)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBFactory.h        2016-04-21 21:08:20 UTC (rev 199835)
</span><span class="lines">@@ -43,14 +43,14 @@
</span><span class="cx"> struct ExceptionCodeWithMessage;
</span><span class="cx">
</span><span class="cx"> namespace IDBClient {
</span><del>-class IDBConnectionToServer;
</del><ins>+class IDBConnectionProxy;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> typedef int ExceptionCode;
</span><span class="cx">
</span><span class="cx"> class IDBFactory : public ThreadSafeRefCounted<IDBFactory> {
</span><span class="cx"> public:
</span><del>- static Ref<IDBFactory> create();
</del><ins>+ static Ref<IDBFactory> create(IDBClient::IDBConnectionProxy&);
</ins><span class="cx"> ~IDBFactory();
</span><span class="cx">
</span><span class="cx"> RefPtr<IDBOpenDBRequest> open(ScriptExecutionContext&, const String& name, ExceptionCodeWithMessage&);
</span><span class="lines">@@ -60,9 +60,11 @@
</span><span class="cx"> short cmp(ScriptExecutionContext&, JSC::JSValue first, JSC::JSValue second, ExceptionCodeWithMessage&);
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- explicit IDBFactory();
</del><ins>+ explicit IDBFactory(IDBClient::IDBConnectionProxy&);
</ins><span class="cx">
</span><span class="cx"> RefPtr<IDBOpenDBRequest> openInternal(ScriptExecutionContext&, const String& name, unsigned long long version, ExceptionCodeWithMessage&);
</span><ins>+
+ Ref<IDBClient::IDBConnectionProxy> m_connectionProxy;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbWorkerGlobalScopeIndexedDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp (199834 => 199835)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp        2016-04-21 21:00:02 UTC (rev 199834)
+++ trunk/Source/WebCore/Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp        2016-04-21 21:08:20 UTC (rev 199835)
</span><span class="lines">@@ -31,14 +31,17 @@
</span><span class="cx">
</span><span class="cx"> #include "WorkerGlobalScopeIndexedDatabase.h"
</span><span class="cx">
</span><ins>+#include "IDBConnectionProxy.h"
</ins><span class="cx"> #include "IDBFactory.h"
</span><ins>+#include "IDBOpenDBRequest.h"
</ins><span class="cx"> #include "ScriptExecutionContext.h"
</span><span class="cx"> #include "SecurityOrigin.h"
</span><span class="cx"> #include "WorkerGlobalScope.h"
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-WorkerGlobalScopeIndexedDatabase::WorkerGlobalScopeIndexedDatabase(WorkerGlobalScope&)
</del><ins>+WorkerGlobalScopeIndexedDatabase::WorkerGlobalScopeIndexedDatabase(WorkerGlobalScope&, IDBClient::IDBConnectionProxy& connectionProxy)
+ : m_connectionProxy(connectionProxy)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -55,7 +58,11 @@
</span><span class="cx"> {
</span><span class="cx"> WorkerGlobalScopeIndexedDatabase* supplement = static_cast<WorkerGlobalScopeIndexedDatabase*>(Supplement<WorkerGlobalScope>::from(&scope, supplementName()));
</span><span class="cx"> if (!supplement) {
</span><del>- auto newSupplement = std::make_unique<WorkerGlobalScopeIndexedDatabase>(scope);
</del><ins>+ auto* connectionProxy = scope.idbConnectionProxy();
+ if (!connectionProxy)
+ return nullptr;
+
+ auto newSupplement = std::make_unique<WorkerGlobalScopeIndexedDatabase>(scope, *connectionProxy);
</ins><span class="cx"> supplement = newSupplement.get();
</span><span class="cx"> provideTo(&scope, supplementName(), WTFMove(newSupplement));
</span><span class="cx"> }
</span><span class="lines">@@ -64,13 +71,14 @@
</span><span class="cx">
</span><span class="cx"> IDBFactory* WorkerGlobalScopeIndexedDatabase::indexedDB(WorkerGlobalScope& scope)
</span><span class="cx"> {
</span><del>- return from(scope)->indexedDB();
</del><ins>+ auto* scopeIDB = from(scope);
+ return scopeIDB ? scopeIDB->indexedDB() : nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> IDBFactory* WorkerGlobalScopeIndexedDatabase::indexedDB()
</span><span class="cx"> {
</span><span class="cx"> if (!m_idbFactory)
</span><del>- m_idbFactory = IDBFactory::create();
</del><ins>+ m_idbFactory = IDBFactory::create(m_connectionProxy.get());
</ins><span class="cx">
</span><span class="cx"> return m_idbFactory.get();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbWorkerGlobalScopeIndexedDatabaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h (199834 => 199835)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h        2016-04-21 21:00:02 UTC (rev 199834)
+++ trunk/Source/WebCore/Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h        2016-04-21 21:08:20 UTC (rev 199835)
</span><span class="lines">@@ -36,19 +36,25 @@
</span><span class="cx"> class IDBFactory;
</span><span class="cx"> class WorkerGlobalScope;
</span><span class="cx">
</span><ins>+namespace IDBClient {
+class IDBConnectionProxy;
+}
+
</ins><span class="cx"> class WorkerGlobalScopeIndexedDatabase : public Supplement<WorkerGlobalScope> {
</span><span class="cx"> public:
</span><del>- explicit WorkerGlobalScopeIndexedDatabase(WorkerGlobalScope&);
</del><ins>+ explicit WorkerGlobalScopeIndexedDatabase(WorkerGlobalScope&, IDBClient::IDBConnectionProxy&);
</ins><span class="cx"> virtual ~WorkerGlobalScopeIndexedDatabase();
</span><span class="cx">
</span><del>- static WorkerGlobalScopeIndexedDatabase* from(WorkerGlobalScope&);
</del><span class="cx"> static IDBFactory* indexedDB(WorkerGlobalScope&);
</span><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> IDBFactory* indexedDB();
</span><ins>+
</ins><span class="cx"> static const char* supplementName();
</span><ins>+ static WorkerGlobalScopeIndexedDatabase* from(WorkerGlobalScope&);
</ins><span class="cx">
</span><span class="cx"> RefPtr<IDBFactory> m_idbFactory;
</span><ins>+ Ref<IDBClient::IDBConnectionProxy> m_connectionProxy;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp (199834 => 199835)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp        2016-04-21 21:00:02 UTC (rev 199834)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp        2016-04-21 21:08:20 UTC (rev 199835)
</span><span class="lines">@@ -34,6 +34,11 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> namespace IDBClient {
</span><span class="cx">
</span><ins>+Ref<IDBConnectionProxy> IDBConnectionProxy::create(IDBConnectionToServer& connection)
+{
+ return adoptRef(*new IDBConnectionProxy(connection));
+}
+
</ins><span class="cx"> IDBConnectionProxy::IDBConnectionProxy(IDBConnectionToServer& connection)
</span><span class="cx"> : m_connectionToServer(connection)
</span><span class="cx"> , m_serverConnectionIdentifier(connection.identifier())
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.h (199834 => 199835)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.h        2016-04-21 21:00:02 UTC (rev 199834)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.h        2016-04-21 21:08:20 UTC (rev 199835)
</span><span class="lines">@@ -37,10 +37,9 @@
</span><span class="cx">
</span><span class="cx"> namespace IDBClient {
</span><span class="cx">
</span><del>-class IDBConnectionProxy {
- WTF_MAKE_NONCOPYABLE(IDBConnectionProxy);
</del><ins>+class IDBConnectionProxy : public ThreadSafeRefCounted<IDBConnectionProxy> {
</ins><span class="cx"> public:
</span><del>- IDBConnectionProxy(IDBConnectionToServer&);
</del><ins>+ static Ref<IDBConnectionProxy> create(IDBConnectionToServer&);
</ins><span class="cx">
</span><span class="cx"> RefPtr<IDBOpenDBRequest> openDatabase(ScriptExecutionContext&, const IDBDatabaseIdentifier&, uint64_t version);
</span><span class="cx"> RefPtr<IDBOpenDBRequest> deleteDatabase(ScriptExecutionContext&, const IDBDatabaseIdentifier&);
</span><span class="lines">@@ -53,6 +52,8 @@
</span><span class="cx"> IDBConnectionToServer& connectionToServer();
</span><span class="cx">
</span><span class="cx"> private:
</span><ins>+ IDBConnectionProxy(IDBConnectionToServer&);
+
</ins><span class="cx"> Ref<IDBConnectionToServer> m_connectionToServer;
</span><span class="cx"> uint64_t m_serverConnectionIdentifier;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (199834 => 199835)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2016-04-21 21:00:02 UTC (rev 199834)
+++ trunk/Source/WebCore/dom/Document.cpp        2016-04-21 21:08:20 UTC (rev 199835)
</span><span class="lines">@@ -3116,7 +3116,7 @@
</span><span class="cx"> if (!currentPage)
</span><span class="cx"> return nullptr;
</span><span class="cx">
</span><del>- m_idbConnectionProxy = std::make_unique<IDBClient::IDBConnectionProxy>(currentPage->idbConnection());
</del><ins>+ m_idbConnectionProxy = IDBClient::IDBConnectionProxy::create(currentPage->idbConnection());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> return m_idbConnectionProxy.get();
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.h (199834 => 199835)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.h        2016-04-21 21:00:02 UTC (rev 199834)
+++ trunk/Source/WebCore/dom/Document.h        2016-04-21 21:08:20 UTC (rev 199835)
</span><span class="lines">@@ -1781,7 +1781,7 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><del>- std::unique_ptr<IDBClient::IDBConnectionProxy> m_idbConnectionProxy;
</del><ins>+ RefPtr<IDBClient::IDBConnectionProxy> m_idbConnectionProxy;
</ins><span class="cx"> #endif
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>