<!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>[199843] trunk/Source/WebCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/199843">199843</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2016-04-21 16:25:10 -0700 (Thu, 21 Apr 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Modern IDB (Workers): Move IDBConnectionProxy into IDBRequest and IDBDatabase.
https://bugs.webkit.org/show_bug.cgi?id=156868
Reviewed by Tim Horton.
No new tests (No behavior change).
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::create):
(WebCore::IDBDatabase::IDBDatabase):
(WebCore::IDBDatabase::~IDBDatabase):
(WebCore::IDBDatabase::transaction):
(WebCore::IDBDatabase::maybeCloseInServer):
* Modules/indexeddb/IDBDatabase.h:
(WebCore::IDBDatabase::connectionProxy):
(WebCore::IDBDatabase::serverConnection):
* Modules/indexeddb/IDBOpenDBRequest.cpp:
(WebCore::IDBOpenDBRequest::createDeleteRequest):
(WebCore::IDBOpenDBRequest::createOpenRequest):
(WebCore::IDBOpenDBRequest::IDBOpenDBRequest):
(WebCore::IDBOpenDBRequest::onSuccess):
(WebCore::IDBOpenDBRequest::onUpgradeNeeded):
(WebCore::IDBOpenDBRequest::requestCompleted):
(WebCore::IDBOpenDBRequest::maybeCreateDeleteRequest): Deleted.
(WebCore::IDBOpenDBRequest::maybeCreateOpenRequest): Deleted.
* Modules/indexeddb/IDBOpenDBRequest.h:
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::IDBRequest):
(WebCore::IDBRequest::connectionToServer): Deleted.
* Modules/indexeddb/IDBRequest.h:
(WebCore::IDBRequest::connectionProxy):
* Modules/indexeddb/IDBTransaction.h:
* Modules/indexeddb/client/IDBConnectionProxy.cpp:
(WebCore::IDBClient::IDBConnectionProxy::openDatabase):
(WebCore::IDBClient::IDBConnectionProxy::deleteDatabase):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBDatabasecpp">trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBDatabaseh">trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBOpenDBRequestcpp">trunk/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBOpenDBRequesth">trunk/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBRequestcpp">trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBRequesth">trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBTransactionh">trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBConnectionProxycpp">trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (199842 => 199843)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-04-21 23:06:41 UTC (rev 199842)
+++ trunk/Source/WebCore/ChangeLog        2016-04-21 23:25:10 UTC (rev 199843)
</span><span class="lines">@@ -1,3 +1,45 @@
</span><ins>+2016-04-21 Brady Eidson <beidson@apple.com>
+
+ Modern IDB (Workers): Move IDBConnectionProxy into IDBRequest and IDBDatabase.
+ https://bugs.webkit.org/show_bug.cgi?id=156868
+
+ Reviewed by Tim Horton.
+
+ No new tests (No behavior change).
+
+ * Modules/indexeddb/IDBDatabase.cpp:
+ (WebCore::IDBDatabase::create):
+ (WebCore::IDBDatabase::IDBDatabase):
+ (WebCore::IDBDatabase::~IDBDatabase):
+ (WebCore::IDBDatabase::transaction):
+ (WebCore::IDBDatabase::maybeCloseInServer):
+ * Modules/indexeddb/IDBDatabase.h:
+ (WebCore::IDBDatabase::connectionProxy):
+ (WebCore::IDBDatabase::serverConnection):
+
+ * Modules/indexeddb/IDBOpenDBRequest.cpp:
+ (WebCore::IDBOpenDBRequest::createDeleteRequest):
+ (WebCore::IDBOpenDBRequest::createOpenRequest):
+ (WebCore::IDBOpenDBRequest::IDBOpenDBRequest):
+ (WebCore::IDBOpenDBRequest::onSuccess):
+ (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
+ (WebCore::IDBOpenDBRequest::requestCompleted):
+ (WebCore::IDBOpenDBRequest::maybeCreateDeleteRequest): Deleted.
+ (WebCore::IDBOpenDBRequest::maybeCreateOpenRequest): Deleted.
+ * Modules/indexeddb/IDBOpenDBRequest.h:
+
+ * Modules/indexeddb/IDBRequest.cpp:
+ (WebCore::IDBRequest::IDBRequest):
+ (WebCore::IDBRequest::connectionToServer): Deleted.
+ * Modules/indexeddb/IDBRequest.h:
+ (WebCore::IDBRequest::connectionProxy):
+
+ * Modules/indexeddb/IDBTransaction.h:
+
+ * Modules/indexeddb/client/IDBConnectionProxy.cpp:
+ (WebCore::IDBClient::IDBConnectionProxy::openDatabase):
+ (WebCore::IDBClient::IDBConnectionProxy::deleteDatabase):
+
</ins><span class="cx"> 2016-04-21 Jiewen Tan <jiewen_tan@apple.com>
</span><span class="cx">
</span><span class="cx"> [iOS] DumpRenderTree crashed in com.apple.WebCore: WebCore::ResourceLoadNotifier::didFailToLoad
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp (199842 => 199843)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp        2016-04-21 23:06:41 UTC (rev 199842)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp        2016-04-21 23:25:10 UTC (rev 199843)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx">
</span><span class="cx"> #include "DOMStringList.h"
</span><span class="cx"> #include "EventQueue.h"
</span><ins>+#include "IDBConnectionProxy.h"
</ins><span class="cx"> #include "IDBConnectionToServer.h"
</span><span class="cx"> #include "IDBDatabaseException.h"
</span><span class="cx"> #include "IDBObjectStore.h"
</span><span class="lines">@@ -42,26 +43,26 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-Ref<IDBDatabase> IDBDatabase::create(ScriptExecutionContext& context, IDBClient::IDBConnectionToServer& connection, const IDBResultData& resultData)
</del><ins>+Ref<IDBDatabase> IDBDatabase::create(ScriptExecutionContext& context, IDBClient::IDBConnectionProxy& connectionProxy, const IDBResultData& resultData)
</ins><span class="cx"> {
</span><del>- return adoptRef(*new IDBDatabase(context, connection, resultData));
</del><ins>+ return adoptRef(*new IDBDatabase(context, connectionProxy, resultData));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-IDBDatabase::IDBDatabase(ScriptExecutionContext& context, IDBClient::IDBConnectionToServer& connection, const IDBResultData& resultData)
</del><ins>+IDBDatabase::IDBDatabase(ScriptExecutionContext& context, IDBClient::IDBConnectionProxy& connectionProxy, const IDBResultData& resultData)
</ins><span class="cx"> : WebCore::ActiveDOMObject(&context)
</span><del>- , m_serverConnection(connection)
</del><ins>+ , m_connectionProxy(connectionProxy)
</ins><span class="cx"> , m_info(resultData.databaseInfo())
</span><span class="cx"> , m_databaseConnectionIdentifier(resultData.databaseConnectionIdentifier())
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBDatabase::IDBDatabase - Creating database %s with version %" PRIu64 " connection %" PRIu64, m_info.name().utf8().data(), m_info.version(), m_databaseConnectionIdentifier);
</span><span class="cx"> suspendIfNeeded();
</span><span class="cx"> relaxAdoptionRequirement();
</span><del>- m_serverConnection->registerDatabaseConnection(*this);
</del><ins>+ m_connectionProxy->connectionToServer().registerDatabaseConnection(*this);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> IDBDatabase::~IDBDatabase()
</span><span class="cx"> {
</span><del>- m_serverConnection->unregisterDatabaseConnection(*this);
</del><ins>+ m_connectionProxy->connectionToServer().unregisterDatabaseConnection(*this);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool IDBDatabase::hasPendingActivity() const
</span><span class="lines">@@ -180,7 +181,7 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- auto info = IDBTransactionInfo::clientTransaction(m_serverConnection.get(), objectStores, mode);
</del><ins>+ auto info = IDBTransactionInfo::clientTransaction(m_connectionProxy->connectionToServer(), objectStores, mode);
</ins><span class="cx"> auto transaction = IDBTransaction::create(*this, info);
</span><span class="cx">
</span><span class="cx"> LOG(IndexedDB, "IDBDatabase::transaction - Added active transaction %s", info.identifier().loggingString().utf8().data());
</span><span class="lines">@@ -244,7 +245,7 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> m_closedInServer = true;
</span><del>- m_serverConnection->databaseConnectionClosed(*this);
</del><ins>+ m_connectionProxy->connectionToServer().databaseConnectionClosed(*this);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> const char* IDBDatabase::activeDOMObjectName() const
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBDatabaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h (199842 => 199843)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h        2016-04-21 23:06:41 UTC (rev 199842)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h        2016-04-21 23:25:10 UTC (rev 199843)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #include "Dictionary.h"
</span><span class="cx"> #include "EventTarget.h"
</span><span class="cx"> #include "ExceptionCode.h"
</span><ins>+#include "IDBConnectionProxy.h"
</ins><span class="cx"> #include "IDBConnectionToServer.h"
</span><span class="cx"> #include "IDBDatabaseInfo.h"
</span><span class="cx">
</span><span class="lines">@@ -44,7 +45,7 @@
</span><span class="cx">
</span><span class="cx"> class IDBDatabase : public RefCounted<IDBDatabase>, public EventTargetWithInlineData, public ActiveDOMObject {
</span><span class="cx"> public:
</span><del>- static Ref<IDBDatabase> create(ScriptExecutionContext&, IDBClient::IDBConnectionToServer&, const IDBResultData&);
</del><ins>+ static Ref<IDBDatabase> create(ScriptExecutionContext&, IDBClient::IDBConnectionProxy&, const IDBResultData&);
</ins><span class="cx">
</span><span class="cx"> virtual ~IDBDatabase();
</span><span class="cx">
</span><span class="lines">@@ -86,8 +87,11 @@
</span><span class="cx">
</span><span class="cx"> void fireVersionChangeEvent(const IDBResourceIdentifier& requestIdentifier, uint64_t requestedVersion);
</span><span class="cx">
</span><del>- IDBClient::IDBConnectionToServer& serverConnection() { return m_serverConnection.get(); }
</del><ins>+ IDBClient::IDBConnectionProxy& connectionProxy() { return m_connectionProxy.get(); }
</ins><span class="cx">
</span><ins>+ // FIXME: Remove the need for this accessor.
+ IDBClient::IDBConnectionToServer& serverConnection() { return m_connectionProxy->connectionToServer(); }
+
</ins><span class="cx"> void didCreateIndexInfo(const IDBIndexInfo&);
</span><span class="cx"> void didDeleteIndexInfo(const IDBIndexInfo&);
</span><span class="cx">
</span><span class="lines">@@ -98,13 +102,13 @@
</span><span class="cx"> bool hasPendingActivity() const final;
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- IDBDatabase(ScriptExecutionContext&, IDBClient::IDBConnectionToServer&, const IDBResultData&);
</del><ins>+ IDBDatabase(ScriptExecutionContext&, IDBClient::IDBConnectionProxy&, const IDBResultData&);
</ins><span class="cx">
</span><span class="cx"> void didCommitOrAbortTransaction(IDBTransaction&);
</span><span class="cx">
</span><span class="cx"> void maybeCloseInServer();
</span><span class="cx">
</span><del>- Ref<IDBClient::IDBConnectionToServer> m_serverConnection;
</del><ins>+ Ref<IDBClient::IDBConnectionProxy> m_connectionProxy;
</ins><span class="cx"> IDBDatabaseInfo m_info;
</span><span class="cx"> uint64_t m_databaseConnectionIdentifier { 0 };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBOpenDBRequestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp (199842 => 199843)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp        2016-04-21 23:06:41 UTC (rev 199842)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp        2016-04-21 23:25:10 UTC (rev 199843)
</span><span class="lines">@@ -42,28 +42,18 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-RefPtr<IDBOpenDBRequest> IDBOpenDBRequest::maybeCreateDeleteRequest(ScriptExecutionContext& context, const IDBDatabaseIdentifier& databaseIdentifier)
</del><ins>+Ref<IDBOpenDBRequest> IDBOpenDBRequest::createDeleteRequest(ScriptExecutionContext& context, IDBClient::IDBConnectionProxy& connectionProxy, const IDBDatabaseIdentifier& databaseIdentifier)
</ins><span class="cx"> {
</span><del>- ASSERT(databaseIdentifier.isValid());
- auto* proxy = context.idbConnectionProxy();
- if (!proxy)
- return nullptr;
-
- return adoptRef(new IDBOpenDBRequest(context, proxy->serverConnectionIdentifier(), databaseIdentifier, 0, IndexedDB::RequestType::Delete));
</del><ins>+ return adoptRef(*new IDBOpenDBRequest(context, connectionProxy, databaseIdentifier, 0, IndexedDB::RequestType::Delete));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-RefPtr<IDBOpenDBRequest> IDBOpenDBRequest::maybeCreateOpenRequest(ScriptExecutionContext& context, const IDBDatabaseIdentifier& databaseIdentifier, uint64_t version)
</del><ins>+Ref<IDBOpenDBRequest> IDBOpenDBRequest::createOpenRequest(ScriptExecutionContext& context, IDBClient::IDBConnectionProxy& connectionProxy, const IDBDatabaseIdentifier& databaseIdentifier, uint64_t version)
</ins><span class="cx"> {
</span><del>- ASSERT(databaseIdentifier.isValid());
- auto* proxy = context.idbConnectionProxy();
- if (!proxy)
- return nullptr;
-
- return adoptRef(new IDBOpenDBRequest(context, proxy->serverConnectionIdentifier(), databaseIdentifier, version, IndexedDB::RequestType::Open));
</del><ins>+ return adoptRef(*new IDBOpenDBRequest(context, connectionProxy, databaseIdentifier, version, IndexedDB::RequestType::Open));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-IDBOpenDBRequest::IDBOpenDBRequest(ScriptExecutionContext& context, uint64_t serverConnectionIdentifier, const IDBDatabaseIdentifier& databaseIdentifier, uint64_t version, IndexedDB::RequestType requestType)
- : IDBRequest(context, serverConnectionIdentifier)
</del><ins>+IDBOpenDBRequest::IDBOpenDBRequest(ScriptExecutionContext& context, IDBClient::IDBConnectionProxy& connectionProxy, const IDBDatabaseIdentifier& databaseIdentifier, uint64_t version, IndexedDB::RequestType requestType)
+ : IDBRequest(context, connectionProxy)
</ins><span class="cx"> , m_databaseIdentifier(databaseIdentifier)
</span><span class="cx"> , m_version(version)
</span><span class="cx"> {
</span><span class="lines">@@ -128,11 +118,7 @@
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBOpenDBRequest::onSuccess()");
</span><span class="cx">
</span><del>- auto* connection = connectionToServer();
- if (!connection)
- return;
-
- setResult(IDBDatabase::create(*scriptExecutionContext(), *connection, resultData));
</del><ins>+ setResult(IDBDatabase::create(*scriptExecutionContext(), connectionProxy(), resultData));
</ins><span class="cx"> m_isDone = true;
</span><span class="cx">
</span><span class="cx"> enqueueEvent(IDBRequestCompletionEvent::create(eventNames().successEvent, false, false, *this));
</span><span class="lines">@@ -140,11 +126,7 @@
</span><span class="cx">
</span><span class="cx"> void IDBOpenDBRequest::onUpgradeNeeded(const IDBResultData& resultData)
</span><span class="cx"> {
</span><del>- auto* connection = connectionToServer();
- if (!connection)
- return;
-
- Ref<IDBDatabase> database = IDBDatabase::create(*scriptExecutionContext(), *connection, resultData);
</del><ins>+ Ref<IDBDatabase> database = IDBDatabase::create(*scriptExecutionContext(), connectionProxy(), resultData);
</ins><span class="cx"> Ref<IDBTransaction> transaction = database->startVersionChangeTransaction(resultData.transactionInfo(), *this);
</span><span class="cx">
</span><span class="cx"> ASSERT(transaction->info().mode() == IndexedDB::TransactionMode::VersionChange);
</span><span class="lines">@@ -179,20 +161,16 @@
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBOpenDBRequest::requestCompleted");
</span><span class="cx">
</span><del>- auto* connection = connectionToServer();
- if (!connection)
- return;
-
</del><span class="cx"> // If an Open request was completed after the page has navigated, leaving this request
</span><span class="cx"> // with a stopped script execution context, we need to message back to the server so it
</span><span class="cx"> // doesn't hang waiting on a database connection or transaction that will never exist.
</span><span class="cx"> if (m_contextStopped) {
</span><span class="cx"> switch (data.type()) {
</span><span class="cx"> case IDBResultType::OpenDatabaseSuccess:
</span><del>- connection->abortOpenAndUpgradeNeeded(data.databaseConnectionIdentifier(), IDBResourceIdentifier::emptyValue());
</del><ins>+ connectionProxy().connectionToServer().abortOpenAndUpgradeNeeded(data.databaseConnectionIdentifier(), IDBResourceIdentifier::emptyValue());
</ins><span class="cx"> break;
</span><span class="cx"> case IDBResultType::OpenDatabaseUpgradeNeeded:
</span><del>- connection->abortOpenAndUpgradeNeeded(data.databaseConnectionIdentifier(), data.transactionInfo().identifier());
</del><ins>+ connectionProxy().connectionToServer().abortOpenAndUpgradeNeeded(data.databaseConnectionIdentifier(), data.transactionInfo().identifier());
</ins><span class="cx"> break;
</span><span class="cx"> default:
</span><span class="cx"> break;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBOpenDBRequesth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.h (199842 => 199843)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.h        2016-04-21 23:06:41 UTC (rev 199842)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.h        2016-04-21 23:25:10 UTC (rev 199843)
</span><span class="lines">@@ -36,8 +36,8 @@
</span><span class="cx">
</span><span class="cx"> class IDBOpenDBRequest final : public IDBRequest {
</span><span class="cx"> public:
</span><del>- static RefPtr<IDBOpenDBRequest> maybeCreateDeleteRequest(ScriptExecutionContext&, const IDBDatabaseIdentifier&);
- static RefPtr<IDBOpenDBRequest> maybeCreateOpenRequest(ScriptExecutionContext&, const IDBDatabaseIdentifier&, uint64_t version);
</del><ins>+ static Ref<IDBOpenDBRequest> createDeleteRequest(ScriptExecutionContext&, IDBClient::IDBConnectionProxy&, const IDBDatabaseIdentifier&);
+ static Ref<IDBOpenDBRequest> createOpenRequest(ScriptExecutionContext&, IDBClient::IDBConnectionProxy&, const IDBDatabaseIdentifier&, uint64_t version);
</ins><span class="cx">
</span><span class="cx"> virtual ~IDBOpenDBRequest();
</span><span class="cx">
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx"> void fireErrorAfterVersionChangeCompletion();
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- IDBOpenDBRequest(ScriptExecutionContext&, uint64_t serverConnectionIdentifier, const IDBDatabaseIdentifier&, uint64_t version, IndexedDB::RequestType);
</del><ins>+ IDBOpenDBRequest(ScriptExecutionContext&, IDBClient::IDBConnectionProxy&, const IDBDatabaseIdentifier&, uint64_t version, IndexedDB::RequestType);
</ins><span class="cx">
</span><span class="cx"> bool dispatchEvent(Event&) final;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBRequestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp (199842 => 199843)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp        2016-04-21 23:06:41 UTC (rev 199842)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp        2016-04-21 23:25:10 UTC (rev 199843)
</span><span class="lines">@@ -69,9 +69,10 @@
</span><span class="cx"> return adoptRef(*new IDBRequest(context, index, requestedRecordType, transaction));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-IDBRequest::IDBRequest(ScriptExecutionContext& context, uint64_t connectionIdentifier)
</del><ins>+IDBRequest::IDBRequest(ScriptExecutionContext& context, IDBClient::IDBConnectionProxy& connectionProxy)
</ins><span class="cx"> : ActiveDOMObject(&context)
</span><del>- , m_resourceIdentifier(connectionIdentifier)
</del><ins>+ , m_resourceIdentifier(connectionProxy.serverConnectionIdentifier())
+ , m_connectionProxy(connectionProxy)
</ins><span class="cx"> {
</span><span class="cx"> suspendIfNeeded();
</span><span class="cx"> }
</span><span class="lines">@@ -81,6 +82,7 @@
</span><span class="cx"> , m_transaction(&transaction)
</span><span class="cx"> , m_resourceIdentifier(transaction.serverConnection())
</span><span class="cx"> , m_objectStoreSource(&objectStore)
</span><ins>+ , m_connectionProxy(transaction.database().connectionProxy())
</ins><span class="cx"> {
</span><span class="cx"> suspendIfNeeded();
</span><span class="cx"> }
</span><span class="lines">@@ -92,6 +94,7 @@
</span><span class="cx"> , m_objectStoreSource(cursor.objectStore())
</span><span class="cx"> , m_indexSource(cursor.index())
</span><span class="cx"> , m_pendingCursor(&cursor)
</span><ins>+ , m_connectionProxy(transaction.database().connectionProxy())
</ins><span class="cx"> {
</span><span class="cx"> suspendIfNeeded();
</span><span class="cx">
</span><span class="lines">@@ -103,6 +106,7 @@
</span><span class="cx"> , m_transaction(&transaction)
</span><span class="cx"> , m_resourceIdentifier(transaction.serverConnection())
</span><span class="cx"> , m_indexSource(&index)
</span><ins>+ , m_connectionProxy(transaction.database().connectionProxy())
</ins><span class="cx"> {
</span><span class="cx"> suspendIfNeeded();
</span><span class="cx"> }
</span><span class="lines">@@ -407,17 +411,6 @@
</span><span class="cx"> m_databaseResult = WTFMove(database);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-// FIXME: Temporarily required during bringup of IDB-in-Workers.
-// Once all IDB object reliance on the IDBConnectionToServer has been shifted to reliance on
-// IDBConnectionProxy, remove this.
-IDBClient::IDBConnectionToServer* IDBRequest::connectionToServer()
-{
- ASSERT(isMainThread());
- auto* context = scriptExecutionContext();
- auto* proxy = context ? context->idbConnectionProxy() : nullptr;
- return proxy ? &proxy->connectionToServer() : nullptr;
-}
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif // ENABLE(INDEXED_DATABASE)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBRequesth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h (199842 => 199843)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h        2016-04-21 23:06:41 UTC (rev 199842)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h        2016-04-21 23:25:10 UTC (rev 199843)
</span><span class="lines">@@ -48,6 +48,7 @@
</span><span class="cx"> class ThreadSafeDataBuffer;
</span><span class="cx">
</span><span class="cx"> namespace IDBClient {
</span><ins>+class IDBConnectionProxy;
</ins><span class="cx"> class IDBConnectionToServer;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -104,17 +105,14 @@
</span><span class="cx"> bool hasPendingActivity() const final;
</span><span class="cx">
</span><span class="cx"> protected:
</span><del>- IDBRequest(ScriptExecutionContext&, uint64_t connectionIdentifier);
</del><ins>+ IDBRequest(ScriptExecutionContext&, IDBClient::IDBConnectionProxy&);
</ins><span class="cx">
</span><span class="cx"> void enqueueEvent(Ref<Event>&&);
</span><span class="cx"> bool dispatchEvent(Event&) override;
</span><span class="cx">
</span><span class="cx"> void setResult(Ref<IDBDatabase>&&);
</span><span class="cx">
</span><del>- // FIXME: Temporarily required during bringup of IDB-in-Workers.
- // Once all IDB object reliance on the IDBConnectionToServer has been shifted to reliance on
- // IDBConnectionProxy, remove this.
- IDBClient::IDBConnectionToServer* connectionToServer();
</del><ins>+ IDBClient::IDBConnectionProxy& connectionProxy() { return m_connectionProxy.get(); }
</ins><span class="cx">
</span><span class="cx"> // FIXME: Protected data members aren't great for maintainability.
</span><span class="cx"> // Consider adding protected helper functions and making these private.
</span><span class="lines">@@ -170,6 +168,8 @@
</span><span class="cx"> RefPtr<IDBCursor> m_pendingCursor;
</span><span class="cx">
</span><span class="cx"> std::unique_ptr<ScopeGuard> m_cursorRequestNotifier;
</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="trunkSourceWebCoreModulesindexeddbIDBTransactionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.h (199842 => 199843)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.h        2016-04-21 23:06:41 UTC (rev 199842)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.h        2016-04-21 23:25:10 UTC (rev 199843)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #include "ActiveDOMObject.h"
</span><span class="cx"> #include "EventTarget.h"
</span><span class="cx"> #include "IDBError.h"
</span><ins>+#include "IDBOpenDBRequest.h"
</ins><span class="cx"> #include "IDBTransactionInfo.h"
</span><span class="cx"> #include "IndexedDB.h"
</span><span class="cx"> #include "Timer.h"
</span><span class="lines">@@ -48,7 +49,6 @@
</span><span class="cx"> class IDBKeyData;
</span><span class="cx"> class IDBObjectStore;
</span><span class="cx"> class IDBObjectStoreInfo;
</span><del>-class IDBOpenDBRequest;
</del><span class="cx"> class IDBResultData;
</span><span class="cx"> class SerializedScriptValue;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp (199842 => 199843)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp        2016-04-21 23:06:41 UTC (rev 199842)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp        2016-04-21 23:25:10 UTC (rev 199843)
</span><span class="lines">@@ -57,32 +57,24 @@
</span><span class="cx">
</span><span class="cx"> RefPtr<IDBOpenDBRequest> IDBConnectionProxy::openDatabase(ScriptExecutionContext& context, const IDBDatabaseIdentifier& databaseIdentifier, uint64_t version)
</span><span class="cx"> {
</span><del>- // 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.
</del><ins>+ // FIXME: Handle Workers
</ins><span class="cx"> if (!isMainThread())
</span><span class="cx"> return nullptr;
</span><span class="cx">
</span><del>- auto request = IDBOpenDBRequest::maybeCreateOpenRequest(context, databaseIdentifier, version);
- if (!request)
- return nullptr;
-
- m_connectionToServer->openDatabase(*request);
- return request;
</del><ins>+ auto request = IDBOpenDBRequest::createOpenRequest(context, *this, databaseIdentifier, version);
+ m_connectionToServer->openDatabase(request.get());
+ return WTFMove(request);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> RefPtr<IDBOpenDBRequest> IDBConnectionProxy::deleteDatabase(ScriptExecutionContext& context, const IDBDatabaseIdentifier& databaseIdentifier)
</span><span class="cx"> {
</span><del>- // 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.
</del><ins>+ // FIXME: Handle Workers
</ins><span class="cx"> if (!isMainThread())
</span><span class="cx"> return nullptr;
</span><span class="cx">
</span><del>- auto request = IDBOpenDBRequest::maybeCreateDeleteRequest(context, databaseIdentifier);
- if (!request)
- return nullptr;
-
- m_connectionToServer->deleteDatabase(*request);
- return request;
</del><ins>+ auto request = IDBOpenDBRequest::createDeleteRequest(context, *this, databaseIdentifier);
+ m_connectionToServer->deleteDatabase(request.get());
+ return WTFMove(request);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namesapce IDBClient
</span></span></pre>
</div>
</div>
</body>
</html>