<!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>[199072] trunk/Source</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/199072">199072</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2016-04-05 14:27:05 -0700 (Tue, 05 Apr 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Modern IDB: Replace use of SerializedScriptValue with IDBValue.
https://bugs.webkit.org/show_bug.cgi?id=156242
Reviewed by Alex Christensen.
Source/WebCore:
No new tests (No change in behavior).
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::putOrAddOnServer):
* Modules/indexeddb/IDBValue.cpp:
(WebCore::IDBValue::IDBValue):
(WebCore::IDBValue::isolatedCopy):
* Modules/indexeddb/IDBValue.h:
(WebCore::IDBValue::data):
(WebCore::IDBValue::encode):
(WebCore::IDBValue::decode):
* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::putOrAdd):
* Modules/indexeddb/client/IDBConnectionToServer.h:
* Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::putOrAdd):
* Modules/indexeddb/server/IDBServer.h:
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::putOrAdd):
(WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
* Modules/indexeddb/server/UniqueIDBDatabase.h:
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::putOrAdd):
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
* Modules/indexeddb/shared/InProcessIDBServer.cpp:
(WebCore::InProcessIDBServer::putOrAdd):
* Modules/indexeddb/shared/InProcessIDBServer.h:
* WebCore.xcodeproj/project.pbxproj:
* platform/CrossThreadCopier.cpp:
(WebCore::IDBValue>::copy):
* platform/CrossThreadCopier.h:
* platform/ThreadSafeDataBuffer.h:
(WebCore::ThreadSafeDataBuffer::encode):
(WebCore::ThreadSafeDataBuffer::decode):
Source/WebKit2:
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::putOrAdd):
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::putOrAdd):
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBTransactioncpp">trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBValuecpp">trunk/Source/WebCore/Modules/indexeddb/IDBValue.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBValueh">trunk/Source/WebCore/Modules/indexeddb/IDBValue.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServercpp">trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServerh">trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServerDelegateh">trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverIDBServercpp">trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverIDBServerh">trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabasecpp">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseh">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseTransactioncpp">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseTransactionh">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedInProcessIDBServercpp">trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedInProcessIDBServerh">trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreplatformCrossThreadCopiercpp">trunk/Source/WebCore/platform/CrossThreadCopier.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformCrossThreadCopierh">trunk/Source/WebCore/platform/CrossThreadCopier.h</a></li>
<li><a href="#trunkSourceWebCoreplatformThreadSafeDataBufferh">trunk/Source/WebCore/platform/ThreadSafeDataBuffer.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2DatabaseProcessIndexedDBWebIDBConnectionToClientcpp">trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2DatabaseProcessIndexedDBWebIDBConnectionToClienth">trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h</a></li>
<li><a href="#trunkSourceWebKit2DatabaseProcessIndexedDBWebIDBConnectionToClientmessagesin">trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in</a></li>
<li><a href="#trunkSourceWebKit2WebProcessDatabasesIndexedDBWebIDBConnectionToServercpp">trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessDatabasesIndexedDBWebIDBConnectionToServerh">trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebCore/ChangeLog        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -1,3 +1,55 @@
</span><ins>+2016-04-05 Brady Eidson <beidson@apple.com>
+
+ Modern IDB: Replace use of SerializedScriptValue with IDBValue.
+ https://bugs.webkit.org/show_bug.cgi?id=156242
+
+ Reviewed by Alex Christensen.
+
+ No new tests (No change in behavior).
+
+ * Modules/indexeddb/IDBTransaction.cpp:
+ (WebCore::IDBTransaction::putOrAddOnServer):
+
+ * Modules/indexeddb/IDBValue.cpp:
+ (WebCore::IDBValue::IDBValue):
+ (WebCore::IDBValue::isolatedCopy):
+ * Modules/indexeddb/IDBValue.h:
+ (WebCore::IDBValue::data):
+ (WebCore::IDBValue::encode):
+ (WebCore::IDBValue::decode):
+
+ * Modules/indexeddb/client/IDBConnectionToServer.cpp:
+ (WebCore::IDBClient::IDBConnectionToServer::putOrAdd):
+ * Modules/indexeddb/client/IDBConnectionToServer.h:
+ * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
+
+ * Modules/indexeddb/server/IDBServer.cpp:
+ (WebCore::IDBServer::IDBServer::putOrAdd):
+ * Modules/indexeddb/server/IDBServer.h:
+
+ * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
+ (WebCore::IDBServer::UniqueIDBDatabase::putOrAdd):
+ (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
+ * Modules/indexeddb/server/UniqueIDBDatabase.h:
+
+ * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
+ (WebCore::IDBServer::UniqueIDBDatabaseTransaction::putOrAdd):
+ * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
+
+ * Modules/indexeddb/shared/InProcessIDBServer.cpp:
+ (WebCore::InProcessIDBServer::putOrAdd):
+ * Modules/indexeddb/shared/InProcessIDBServer.h:
+
+ * WebCore.xcodeproj/project.pbxproj:
+
+ * platform/CrossThreadCopier.cpp:
+ (WebCore::IDBValue>::copy):
+ * platform/CrossThreadCopier.h:
+
+ * platform/ThreadSafeDataBuffer.h:
+ (WebCore::ThreadSafeDataBuffer::encode):
+ (WebCore::ThreadSafeDataBuffer::decode):
+
</ins><span class="cx"> 2016-04-05 Said Abou-Hallawa <sabouhallawa@apple.com>
</span><span class="cx">
</span><span class="cx"> Avoid context save/restore in GraphicsContext::drawNativeImage
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBTransactioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx"> #include "IDBOpenDBRequest.h"
</span><span class="cx"> #include "IDBRequest.h"
</span><span class="cx"> #include "IDBResultData.h"
</span><ins>+#include "IDBValue.h"
</ins><span class="cx"> #include "JSDOMWindowBase.h"
</span><span class="cx"> #include "Logging.h"
</span><span class="cx"> #include "ScriptExecutionContext.h"
</span><span class="lines">@@ -869,6 +870,11 @@
</span><span class="cx"> ASSERT(!isReadOnly());
</span><span class="cx"> ASSERT(value);
</span><span class="cx">
</span><ins>+ if (!value->hasBlobURLs()) {
+ serverConnection().putOrAdd(operation, key.get(), *value, overwriteMode);
+ return;
+ }
+
</ins><span class="cx"> RefPtr<IDBTransaction> protector(this);
</span><span class="cx"> RefPtr<IDBClient::TransactionOperation> operationRef(&operation);
</span><span class="cx"> value->writeBlobsToDiskForIndexedDB([protector, this, operationRef, key, value, overwriteMode](const IDBValue&) {
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBValue.cpp (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBValue.cpp        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBValue.cpp        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -28,12 +28,26 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx">
</span><ins>+#include "SerializedScriptValue.h"
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> IDBValue::IDBValue()
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+IDBValue::IDBValue(const SerializedScriptValue& scriptValue)
+ : m_data(ThreadSafeDataBuffer::copyVector(scriptValue.data()))
+{
+}
+
+IDBValue IDBValue::isolatedCopy() const
+{
+ IDBValue result;
+ result.m_data = m_data;
+ return result;
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif // ENABLE(INDEXED_DATABASE)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBValue.h (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBValue.h        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBValue.h        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -26,13 +26,44 @@
</span><span class="cx"> #pragma once
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx">
</span><ins>+#include "ThreadSafeDataBuffer.h"
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><ins>+class SerializedScriptValue;
+
</ins><span class="cx"> class IDBValue {
</span><span class="cx"> public:
</span><del>- IDBValue();
</del><ins>+ WEBCORE_EXPORT IDBValue();
+ IDBValue(const SerializedScriptValue&);
+
+ IDBValue isolatedCopy() const;
+
+ const ThreadSafeDataBuffer& data() const { return m_data; }
+
+ template<class Encoder> void encode(Encoder&) const;
+ template<class Decoder> static bool decode(Decoder&, IDBValue&);
+
+private:
+ ThreadSafeDataBuffer m_data;
</ins><span class="cx"> };
</span><span class="cx">
</span><ins>+
+template<class Encoder>
+void IDBValue::encode(Encoder& encoder) const
+{
+ encoder << m_data;
+}
+
+template<class Decoder>
+bool IDBValue::decode(Decoder& decoder, IDBValue& result)
+{
+ if (!decoder.decode(result.m_data))
+ return false;
+
+ return true;
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif // ENABLE(INDEXED_DATABASE)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -171,7 +171,7 @@
</span><span class="cx"> completeOperation(resultData);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void IDBConnectionToServer::putOrAdd(TransactionOperation& operation, IDBKey* key, SerializedScriptValue& value, const IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</del><ins>+void IDBConnectionToServer::putOrAdd(TransactionOperation& operation, IDBKey* key, const IDBValue& value, const IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</ins><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBConnectionToServer::putOrAdd");
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx"> class IDBOpenDBRequest;
</span><span class="cx"> class IDBResultData;
</span><span class="cx"> class IDBTransaction;
</span><ins>+class IDBValue;
</ins><span class="cx">
</span><span class="cx"> namespace IDBClient {
</span><span class="cx">
</span><span class="lines">@@ -77,7 +78,7 @@
</span><span class="cx"> void deleteIndex(TransactionOperation&, uint64_t objectStoreIdentifier, const String& indexName);
</span><span class="cx"> WEBCORE_EXPORT void didDeleteIndex(const IDBResultData&);
</span><span class="cx">
</span><del>- void putOrAdd(TransactionOperation&, IDBKey*, SerializedScriptValue&, const IndexedDB::ObjectStoreOverwriteMode);
</del><ins>+ void putOrAdd(TransactionOperation&, IDBKey*, const IDBValue&, const IndexedDB::ObjectStoreOverwriteMode);
</ins><span class="cx"> WEBCORE_EXPORT void didPutOrAdd(const IDBResultData&);
</span><span class="cx">
</span><span class="cx"> void getRecord(TransactionOperation&, const IDBKeyRangeData&);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServerDelegateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx"> class IDBRequestData;
</span><span class="cx"> class IDBResourceIdentifier;
</span><span class="cx"> class IDBTransactionInfo;
</span><del>-class SerializedScriptValue;
</del><ins>+class IDBValue;
</ins><span class="cx">
</span><span class="cx"> namespace IndexedDB {
</span><span class="cx"> enum class ObjectStoreOverwriteMode;
</span><span class="lines">@@ -65,7 +65,7 @@
</span><span class="cx"> virtual void clearObjectStore(const IDBRequestData&, uint64_t objectStoreIdentifier) = 0;
</span><span class="cx"> virtual void createIndex(const IDBRequestData&, const IDBIndexInfo&) = 0;
</span><span class="cx"> virtual void deleteIndex(const IDBRequestData&, uint64_t objectStoreIdentifier, const String& indexName) = 0;
</span><del>- virtual void putOrAdd(const IDBRequestData&, IDBKey*, SerializedScriptValue&, const IndexedDB::ObjectStoreOverwriteMode) = 0;
</del><ins>+ virtual void putOrAdd(const IDBRequestData&, IDBKey*, const IDBValue&, const IndexedDB::ObjectStoreOverwriteMode) = 0;
</ins><span class="cx"> virtual void getRecord(const IDBRequestData&, const IDBKeyRangeData&) = 0;
</span><span class="cx"> virtual void getCount(const IDBRequestData&, const IDBKeyRangeData&) = 0;
</span><span class="cx"> virtual void deleteRecord(const IDBRequestData&, const IDBKeyRangeData&) = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -238,7 +238,7 @@
</span><span class="cx"> transaction->deleteIndex(requestData, objectStoreIdentifier, indexName);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void IDBServer::putOrAdd(const IDBRequestData& requestData, const IDBKeyData& keyData, const ThreadSafeDataBuffer& valueData, IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</del><ins>+void IDBServer::putOrAdd(const IDBRequestData& requestData, const IDBKeyData& keyData, const IDBValue& value, IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</ins><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBServer::putOrAdd");
</span><span class="cx">
</span><span class="lines">@@ -246,7 +246,7 @@
</span><span class="cx"> if (!transaction)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- transaction->putOrAdd(requestData, keyData, valueData, overwriteMode);
</del><ins>+ transaction->putOrAdd(requestData, keyData, value, overwriteMode);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void IDBServer::getRecord(const IDBRequestData& requestData, const IDBKeyRangeData& keyRangeData)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx"> class CrossThreadTask;
</span><span class="cx"> class IDBCursorInfo;
</span><span class="cx"> class IDBRequestData;
</span><ins>+class IDBValue;
</ins><span class="cx">
</span><span class="cx"> namespace IDBServer {
</span><span class="cx">
</span><span class="lines">@@ -67,7 +68,7 @@
</span><span class="cx"> WEBCORE_EXPORT void clearObjectStore(const IDBRequestData&, uint64_t objectStoreIdentifier);
</span><span class="cx"> WEBCORE_EXPORT void createIndex(const IDBRequestData&, const IDBIndexInfo&);
</span><span class="cx"> WEBCORE_EXPORT void deleteIndex(const IDBRequestData&, uint64_t objectStoreIdentifier, const String& indexName);
</span><del>- WEBCORE_EXPORT void putOrAdd(const IDBRequestData&, const IDBKeyData&, const ThreadSafeDataBuffer& valueData, IndexedDB::ObjectStoreOverwriteMode);
</del><ins>+ WEBCORE_EXPORT void putOrAdd(const IDBRequestData&, const IDBKeyData&, const IDBValue&, IndexedDB::ObjectStoreOverwriteMode);
</ins><span class="cx"> WEBCORE_EXPORT void getRecord(const IDBRequestData&, const IDBKeyRangeData&);
</span><span class="cx"> WEBCORE_EXPORT void getCount(const IDBRequestData&, const IDBKeyRangeData&);
</span><span class="cx"> WEBCORE_EXPORT void deleteRecord(const IDBRequestData&, const IDBKeyRangeData&);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #include "IDBResultData.h"
</span><span class="cx"> #include "IDBServer.h"
</span><span class="cx"> #include "IDBTransactionInfo.h"
</span><ins>+#include "IDBValue.h"
</ins><span class="cx"> #include "Logging.h"
</span><span class="cx"> #include "ScopeGuard.h"
</span><span class="cx"> #include "UniqueIDBDatabaseConnection.h"
</span><span class="lines">@@ -683,13 +684,13 @@
</span><span class="cx"> performErrorCallback(callbackIdentifier, error);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void UniqueIDBDatabase::putOrAdd(const IDBRequestData& requestData, const IDBKeyData& keyData, const ThreadSafeDataBuffer& valueData, IndexedDB::ObjectStoreOverwriteMode overwriteMode, KeyDataCallback callback)
</del><ins>+void UniqueIDBDatabase::putOrAdd(const IDBRequestData& requestData, const IDBKeyData& keyData, const IDBValue& value, IndexedDB::ObjectStoreOverwriteMode overwriteMode, KeyDataCallback callback)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(isMainThread());
</span><span class="cx"> LOG(IndexedDB, "(main) UniqueIDBDatabase::putOrAdd");
</span><span class="cx">
</span><span class="cx"> uint64_t callbackID = storeCallback(callback);
</span><del>- m_server.postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::performPutOrAdd, callbackID, requestData.transactionIdentifier(), requestData.objectStoreIdentifier(), keyData, valueData, overwriteMode));
</del><ins>+ m_server.postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::performPutOrAdd, callbackID, requestData.transactionIdentifier(), requestData.objectStoreIdentifier(), keyData, value, overwriteMode));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> VM& UniqueIDBDatabase::databaseThreadVM()
</span><span class="lines">@@ -709,7 +710,7 @@
</span><span class="cx"> return *globalObject.get()->globalExec();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void UniqueIDBDatabase::performPutOrAdd(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData& keyData, const ThreadSafeDataBuffer& originalRecordValue, IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</del><ins>+void UniqueIDBDatabase::performPutOrAdd(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData& keyData, const IDBValue& originalRecordValue, IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(!isMainThread());
</span><span class="cx"> LOG(IndexedDB, "(db) UniqueIDBDatabase::performPutOrAdd");
</span><span class="lines">@@ -764,7 +765,7 @@
</span><span class="cx"> if (usedKeyIsGenerated && !objectStoreInfo->keyPath().isNull()) {
</span><span class="cx"> JSLockHolder locker(databaseThreadVM());
</span><span class="cx">
</span><del>- JSValue value = deserializeIDBValueDataToJSValue(databaseThreadExecState(), originalRecordValue);
</del><ins>+ JSValue value = deserializeIDBValueDataToJSValue(databaseThreadExecState(), originalRecordValue.data());
</ins><span class="cx"> if (value.isUndefined()) {
</span><span class="cx"> m_server.postDatabaseTaskReply(createCrossThreadTask(*this, &UniqueIDBDatabase::didPerformPutOrAdd, callbackIdentifier, IDBError(IDBDatabaseException::ConstraintError, ASCIILiteral("Unable to deserialize record value for record key injection")), usedKey));
</span><span class="cx"> return;
</span><span class="lines">@@ -794,7 +795,7 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- error = m_backingStore->addRecord(transactionIdentifier, *objectStoreInfo, usedKey, injectedRecordValue.data() ? injectedRecordValue : originalRecordValue);
</del><ins>+ error = m_backingStore->addRecord(transactionIdentifier, *objectStoreInfo, usedKey, injectedRecordValue.data() ? injectedRecordValue : originalRecordValue.data());
</ins><span class="cx"> if (!error.isNull()) {
</span><span class="cx"> m_server.postDatabaseTaskReply(createCrossThreadTask(*this, &UniqueIDBDatabase::didPerformPutOrAdd, callbackIdentifier, error, usedKey));
</span><span class="cx"> return;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -85,7 +85,7 @@
</span><span class="cx"> void clearObjectStore(UniqueIDBDatabaseTransaction&, uint64_t objectStoreIdentifier, ErrorCallback);
</span><span class="cx"> void createIndex(UniqueIDBDatabaseTransaction&, const IDBIndexInfo&, ErrorCallback);
</span><span class="cx"> void deleteIndex(UniqueIDBDatabaseTransaction&, uint64_t objectStoreIdentifier, const String& indexName, ErrorCallback);
</span><del>- void putOrAdd(const IDBRequestData&, const IDBKeyData&, const ThreadSafeDataBuffer& valueData, IndexedDB::ObjectStoreOverwriteMode, KeyDataCallback);
</del><ins>+ void putOrAdd(const IDBRequestData&, const IDBKeyData&, const IDBValue&, IndexedDB::ObjectStoreOverwriteMode, KeyDataCallback);
</ins><span class="cx"> void getRecord(const IDBRequestData&, const IDBKeyRangeData&, GetResultCallback);
</span><span class="cx"> void getCount(const IDBRequestData&, const IDBKeyRangeData&, CountCallback);
</span><span class="cx"> void deleteRecord(const IDBRequestData&, const IDBKeyRangeData&, ErrorCallback);
</span><span class="lines">@@ -134,7 +134,7 @@
</span><span class="cx"> void performClearObjectStore(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier);
</span><span class="cx"> void performCreateIndex(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, const IDBIndexInfo&);
</span><span class="cx"> void performDeleteIndex(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier);
</span><del>- void performPutOrAdd(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&, const ThreadSafeDataBuffer& valueData, IndexedDB::ObjectStoreOverwriteMode);
</del><ins>+ void performPutOrAdd(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&, const IDBValue&, IndexedDB::ObjectStoreOverwriteMode);
</ins><span class="cx"> void performGetRecord(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyRangeData&);
</span><span class="cx"> void performGetIndexRecord(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, IndexedDB::IndexRecordType, const IDBKeyRangeData&);
</span><span class="cx"> void performGetCount(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier, uint64_t objectStoreIdentifier, uint64_t indexIdentifier, const IDBKeyRangeData&);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseTransactioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -187,7 +187,7 @@
</span><span class="cx"> });
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void UniqueIDBDatabaseTransaction::putOrAdd(const IDBRequestData& requestData, const IDBKeyData& keyData, const ThreadSafeDataBuffer& valueData, IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</del><ins>+void UniqueIDBDatabaseTransaction::putOrAdd(const IDBRequestData& requestData, const IDBKeyData& keyData, const IDBValue& value, IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</ins><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "UniqueIDBDatabaseTransaction::putOrAdd");
</span><span class="cx">
</span><span class="lines">@@ -195,7 +195,7 @@
</span><span class="cx"> ASSERT(m_transactionInfo.identifier() == requestData.transactionIdentifier());
</span><span class="cx">
</span><span class="cx"> RefPtr<UniqueIDBDatabaseTransaction> self(this);
</span><del>- m_databaseConnection->database().putOrAdd(requestData, keyData, valueData, overwriteMode, [this, self, requestData](const IDBError& error, const IDBKeyData& key) {
</del><ins>+ m_databaseConnection->database().putOrAdd(requestData, keyData, value, overwriteMode, [this, self, requestData](const IDBError& error, const IDBKeyData& key) {
</ins><span class="cx"> LOG(IndexedDB, "UniqueIDBDatabaseTransaction::putOrAdd (callback)");
</span><span class="cx">
</span><span class="cx"> if (error.isNull())
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseTransactionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -42,7 +42,7 @@
</span><span class="cx"> class IDBKeyData;
</span><span class="cx"> class IDBObjectStoreInfo;
</span><span class="cx"> class IDBRequestData;
</span><del>-class ThreadSafeDataBuffer;
</del><ins>+class IDBValue;
</ins><span class="cx">
</span><span class="cx"> struct IDBKeyRangeData;
</span><span class="cx">
</span><span class="lines">@@ -72,7 +72,7 @@
</span><span class="cx"> void clearObjectStore(const IDBRequestData&, uint64_t objectStoreIdentifier);
</span><span class="cx"> void createIndex(const IDBRequestData&, const IDBIndexInfo&);
</span><span class="cx"> void deleteIndex(const IDBRequestData&, uint64_t objectStoreIdentifier, const String& indexName);
</span><del>- void putOrAdd(const IDBRequestData&, const IDBKeyData&, const ThreadSafeDataBuffer& valueData, IndexedDB::ObjectStoreOverwriteMode);
</del><ins>+ void putOrAdd(const IDBRequestData&, const IDBKeyData&, const IDBValue&, IndexedDB::ObjectStoreOverwriteMode);
</ins><span class="cx"> void getRecord(const IDBRequestData&, const IDBKeyRangeData&);
</span><span class="cx"> void getCount(const IDBRequestData&, const IDBKeyRangeData&);
</span><span class="cx"> void deleteRecord(const IDBRequestData&, const IDBKeyRangeData&);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedInProcessIDBServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> #include "IDBOpenDBRequest.h"
</span><span class="cx"> #include "IDBRequestData.h"
</span><span class="cx"> #include "IDBResultData.h"
</span><ins>+#include "IDBValue.h"
</ins><span class="cx"> #include "Logging.h"
</span><span class="cx"> #include <wtf/RunLoop.h>
</span><span class="cx">
</span><span class="lines">@@ -287,14 +288,13 @@
</span><span class="cx"> });
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void InProcessIDBServer::putOrAdd(const IDBRequestData& requestData, IDBKey* key, SerializedScriptValue& value, const IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</del><ins>+void InProcessIDBServer::putOrAdd(const IDBRequestData& requestData, IDBKey* key, const IDBValue& value, const IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</ins><span class="cx"> {
</span><span class="cx"> RefPtr<InProcessIDBServer> self(this);
</span><span class="cx"> IDBKeyData keyData(key);
</span><del>- auto valueData = ThreadSafeDataBuffer::copyVector(value.data());
</del><span class="cx">
</span><del>- RunLoop::current().dispatch([this, self, requestData, keyData, valueData, overwriteMode] {
- m_server->putOrAdd(requestData, keyData, valueData, overwriteMode);
</del><ins>+ RunLoop::current().dispatch([this, self, requestData, keyData, value, overwriteMode] {
+ m_server->putOrAdd(requestData, keyData, value, overwriteMode);
</ins><span class="cx"> });
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedInProcessIDBServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -65,7 +65,7 @@
</span><span class="cx"> void clearObjectStore(const IDBRequestData&, uint64_t objectStoreIdentifier) final;
</span><span class="cx"> void createIndex(const IDBRequestData&, const IDBIndexInfo&) final;
</span><span class="cx"> void deleteIndex(const IDBRequestData&, uint64_t objectStoreIdentifier, const String& indexName) final;
</span><del>- void putOrAdd(const IDBRequestData&, IDBKey*, SerializedScriptValue&, const IndexedDB::ObjectStoreOverwriteMode) final;
</del><ins>+ void putOrAdd(const IDBRequestData&, IDBKey*, const IDBValue&, const IndexedDB::ObjectStoreOverwriteMode) final;
</ins><span class="cx"> void getRecord(const IDBRequestData&, const IDBKeyRangeData&) final;
</span><span class="cx"> void getCount(const IDBRequestData&, const IDBKeyRangeData&) final;
</span><span class="cx"> void deleteRecord(const IDBRequestData&, const IDBKeyRangeData&) final;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -2045,7 +2045,7 @@
</span><span class="cx">                 5160712F1BD8307800DBC4F2 /* IDBObjectStoreInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 5160712D1BD8307200DBC4F2 /* IDBObjectStoreInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 516071321BD8308B00DBC4F2 /* TransactionOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 5160712B1BD8305300DBC4F2 /* TransactionOperation.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 5160F4980B0AA75F00C1D2AF /* HistoryItemMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5160F4970B0AA75F00C1D2AF /* HistoryItemMac.mm */; };
</span><del>-                516103AF1CADBA770016B4C7 /* IDBValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 516103AE1CADB9A30016B4C7 /* IDBValue.h */; };
</del><ins>+                516103AF1CADBA770016B4C7 /* IDBValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 516103AE1CADB9A30016B4C7 /* IDBValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 516103B01CADBA7A0016B4C7 /* IDBValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 516103AD1CADB9A30016B4C7 /* IDBValue.cpp */; };
</span><span class="cx">                 5162C7F411F77EFB00612EFE /* SchemeRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5162C7F211F77EFA00612EFE /* SchemeRegistry.cpp */; };
</span><span class="cx">                 5162C7F511F77EFB00612EFE /* SchemeRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 5162C7F311F77EFB00612EFE /* SchemeRegistry.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformCrossThreadCopiercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/CrossThreadCopier.cpp (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/CrossThreadCopier.cpp        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebCore/platform/CrossThreadCopier.cpp        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -54,6 +54,7 @@
</span><span class="cx"> #include "IDBObjectStoreInfo.h"
</span><span class="cx"> #include "IDBResourceIdentifier.h"
</span><span class="cx"> #include "IDBTransactionInfo.h"
</span><ins>+#include "IDBValue.h"
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -165,6 +166,11 @@
</span><span class="cx"> return info.isolatedCopy();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+CrossThreadCopierBase<false, false, IDBValue>::Type CrossThreadCopierBase<false, false, IDBValue>::copy(const IDBValue& value)
+{
+ return value.isolatedCopy();
+}
+
</ins><span class="cx"> #endif // ENABLE(INDEXED_DATABASE)
</span><span class="cx">
</span><span class="cx"> // Test CrossThreadCopier using COMPILE_ASSERT.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformCrossThreadCopierh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/CrossThreadCopier.h (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/CrossThreadCopier.h        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebCore/platform/CrossThreadCopier.h        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -227,6 +227,12 @@
</span><span class="cx"> static Type copy(const IDBCursorInfo&);
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+ class IDBValue;
+ template<> struct WEBCORE_EXPORT CrossThreadCopierBase<false, false, IDBValue> {
+ typedef IDBValue Type;
+ static Type copy(const IDBValue&);
+ };
+
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> template<typename T>
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformThreadSafeDataBufferh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ThreadSafeDataBuffer.h (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ThreadSafeDataBuffer.h        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebCore/platform/ThreadSafeDataBuffer.h        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -71,6 +71,9 @@
</span><span class="cx"> return m_impl ? &m_impl->m_data : nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ template<class Encoder> void encode(Encoder&) const;
+ template<class Decoder> static bool decode(Decoder&, ThreadSafeDataBuffer&);
+
</ins><span class="cx"> private:
</span><span class="cx"> explicit ThreadSafeDataBuffer(Vector<uint8_t>& data, ThreadSafeDataBufferImpl::AdoptVectorTag tag)
</span><span class="cx"> {
</span><span class="lines">@@ -85,6 +88,34 @@
</span><span class="cx"> RefPtr<ThreadSafeDataBufferImpl> m_impl;
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+template<class Encoder>
+void ThreadSafeDataBuffer::encode(Encoder& encoder) const
+{
+ bool hasData = m_impl;
+ encoder << hasData;
+
+ if (hasData)
+ encoder << m_impl->m_data;
+}
+
+template<class Decoder>
+bool ThreadSafeDataBuffer::decode(Decoder& decoder, ThreadSafeDataBuffer& result)
+{
+ bool hasData;
+ if (!decoder.decode(hasData))
+ return false;
+
+ if (hasData) {
+ Vector<uint8_t> data;
+ if (!decoder.decode(data))
+ return false;
+
+ result = ThreadSafeDataBuffer::adoptVector(data);
+ }
+
+ return true;
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif // ThreadSafeDataBuffer_h
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebKit2/ChangeLog        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2016-04-05 Brady Eidson <beidson@apple.com>
+
+ Modern IDB: Replace use of SerializedScriptValue with IDBValue.
+ https://bugs.webkit.org/show_bug.cgi?id=156242
+
+ Reviewed by Alex Christensen.
+
+ * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
+ (WebKit::WebIDBConnectionToClient::putOrAdd):
+ * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
+ * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
+
+ * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
+ (WebKit::WebIDBConnectionToServer::putOrAdd):
+ * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
+
</ins><span class="cx"> 2016-04-05 Antoine Quint <graouts@apple.com>
</span><span class="cx">
</span><span class="cx"> [WebGL2] Turn the ENABLE_WEBGL2 flag on
</span></span></pre></div>
<a id="trunkSourceWebKit2DatabaseProcessIndexedDBWebIDBConnectionToClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> #include "WebIDBConnectionToServerMessages.h"
</span><span class="cx"> #include <WebCore/IDBError.h>
</span><span class="cx"> #include <WebCore/IDBResultData.h>
</span><ins>+#include <WebCore/IDBValue.h>
</ins><span class="cx"> #include <WebCore/ThreadSafeDataBuffer.h>
</span><span class="cx"> #include <WebCore/UniqueIDBDatabaseConnection.h>
</span><span class="cx">
</span><span class="lines">@@ -214,7 +215,7 @@
</span><span class="cx"> DatabaseProcess::singleton().idbServer().deleteIndex(request, objectStoreIdentifier, name);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebIDBConnectionToClient::putOrAdd(const IDBRequestData& request, const IDBKeyData& key, const IPC::DataReference& data, unsigned overwriteMode)
</del><ins>+void WebIDBConnectionToClient::putOrAdd(const IDBRequestData& request, const IDBKeyData& key, const IDBValue& value, unsigned overwriteMode)
</ins><span class="cx"> {
</span><span class="cx"> if (overwriteMode != static_cast<unsigned>(IndexedDB::ObjectStoreOverwriteMode::NoOverwrite)
</span><span class="cx"> && overwriteMode != static_cast<unsigned>(IndexedDB::ObjectStoreOverwriteMode::Overwrite)
</span><span class="lines">@@ -225,9 +226,8 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> IndexedDB::ObjectStoreOverwriteMode mode = static_cast<IndexedDB::ObjectStoreOverwriteMode>(overwriteMode);
</span><del>- auto buffer = ThreadSafeDataBuffer::copyVector(data.vector());
</del><span class="cx">
</span><del>- DatabaseProcess::singleton().idbServer().putOrAdd(request, key, buffer, mode);
</del><ins>+ DatabaseProcess::singleton().idbServer().putOrAdd(request, key, value, mode);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebIDBConnectionToClient::getRecord(const IDBRequestData& request, const IDBKeyRangeData& range)
</span></span></pre></div>
<a id="trunkSourceWebKit2DatabaseProcessIndexedDBWebIDBConnectionToClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx"> class IDBObjectStoreInfo;
</span><span class="cx"> class IDBRequestData;
</span><span class="cx"> class IDBTransactionInfo;
</span><ins>+class IDBValue;
</ins><span class="cx"> class SerializedScriptValue;
</span><span class="cx"> struct IDBKeyRangeData;
</span><span class="cx"> }
</span><span class="lines">@@ -90,7 +91,7 @@
</span><span class="cx"> void clearObjectStore(const WebCore::IDBRequestData&, uint64_t objectStoreIdentifier);
</span><span class="cx"> void createIndex(const WebCore::IDBRequestData&, const WebCore::IDBIndexInfo&);
</span><span class="cx"> void deleteIndex(const WebCore::IDBRequestData&, uint64_t objectStoreIdentifier, const String& indexName);
</span><del>- void putOrAdd(const WebCore::IDBRequestData&, const WebCore::IDBKeyData&, const IPC::DataReference& value, unsigned overwriteMode);
</del><ins>+ void putOrAdd(const WebCore::IDBRequestData&, const WebCore::IDBKeyData&, const WebCore::IDBValue&, unsigned overwriteMode);
</ins><span class="cx"> void getRecord(const WebCore::IDBRequestData&, const WebCore::IDBKeyRangeData&);
</span><span class="cx"> void getCount(const WebCore::IDBRequestData&, const WebCore::IDBKeyRangeData&);
</span><span class="cx"> void deleteRecord(const WebCore::IDBRequestData&, const WebCore::IDBKeyRangeData&);
</span></span></pre></div>
<a id="trunkSourceWebKit2DatabaseProcessIndexedDBWebIDBConnectionToClientmessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx"> ClearObjectStore(WebCore::IDBRequestData requestData, uint64_t objectStoreIdentifier);
</span><span class="cx"> CreateIndex(WebCore::IDBRequestData requestData, WebCore::IDBIndexInfo info);
</span><span class="cx"> DeleteIndex(WebCore::IDBRequestData requestData, uint64_t objectStoreIdentifier, String indexName);
</span><del>- PutOrAdd(WebCore::IDBRequestData requestData, WebCore::IDBKeyData key, IPC::DataReference value, unsigned overwriteMode);
</del><ins>+ PutOrAdd(WebCore::IDBRequestData requestData, WebCore::IDBKeyData key, WebCore::IDBValue value, unsigned overwriteMode);
</ins><span class="cx"> GetRecord(WebCore::IDBRequestData requestData, struct WebCore::IDBKeyRangeData range);
</span><span class="cx"> GetCount(WebCore::IDBRequestData requestData, struct WebCore::IDBKeyRangeData range);
</span><span class="cx"> DeleteRecord(WebCore::IDBRequestData requestData, struct WebCore::IDBKeyRangeData range);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessDatabasesIndexedDBWebIDBConnectionToServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -44,6 +44,7 @@
</span><span class="cx"> #include <WebCore/IDBResourceIdentifier.h>
</span><span class="cx"> #include <WebCore/IDBResultData.h>
</span><span class="cx"> #include <WebCore/IDBTransactionInfo.h>
</span><ins>+#include <WebCore/IDBValue.h>
</ins><span class="cx">
</span><span class="cx"> using namespace WebCore;
</span><span class="cx">
</span><span class="lines">@@ -128,11 +129,10 @@
</span><span class="cx"> send(Messages::WebIDBConnectionToClient::DeleteIndex(requestData, objectStoreIdentifier, indexName));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void WebIDBConnectionToServer::putOrAdd(const IDBRequestData& requestData, IDBKey* key, SerializedScriptValue& value, const IndexedDB::ObjectStoreOverwriteMode mode)
</del><ins>+void WebIDBConnectionToServer::putOrAdd(const IDBRequestData& requestData, IDBKey* key, const IDBValue& value, const IndexedDB::ObjectStoreOverwriteMode mode)
</ins><span class="cx"> {
</span><span class="cx"> IDBKeyData keyData(key);
</span><del>- IPC::DataReference valueData(value.data());
- send(Messages::WebIDBConnectionToClient::PutOrAdd(requestData, keyData, valueData, static_cast<unsigned>(mode)));
</del><ins>+ send(Messages::WebIDBConnectionToClient::PutOrAdd(requestData, keyData, value, static_cast<unsigned>(mode)));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebIDBConnectionToServer::getRecord(const IDBRequestData& requestData, const IDBKeyRangeData& range)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessDatabasesIndexedDBWebIDBConnectionToServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h (199071 => 199072)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h        2016-04-05 20:24:01 UTC (rev 199071)
+++ trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h        2016-04-05 21:27:05 UTC (rev 199072)
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx"> void clearObjectStore(const WebCore::IDBRequestData&, uint64_t objectStoreIdentifier) final;
</span><span class="cx"> void createIndex(const WebCore::IDBRequestData&, const WebCore::IDBIndexInfo&) final;
</span><span class="cx"> void deleteIndex(const WebCore::IDBRequestData&, uint64_t objectStoreIdentifier, const String& indexName) final;
</span><del>- void putOrAdd(const WebCore::IDBRequestData&, WebCore::IDBKey*, WebCore::SerializedScriptValue&, const WebCore::IndexedDB::ObjectStoreOverwriteMode) final;
</del><ins>+ void putOrAdd(const WebCore::IDBRequestData&, WebCore::IDBKey*, const WebCore::IDBValue&, const WebCore::IndexedDB::ObjectStoreOverwriteMode) final;
</ins><span class="cx"> void getRecord(const WebCore::IDBRequestData&, const WebCore::IDBKeyRangeData&) final;
</span><span class="cx"> void getCount(const WebCore::IDBRequestData&, const WebCore::IDBKeyRangeData&) final;
</span><span class="cx"> void deleteRecord(const WebCore::IDBRequestData&, const WebCore::IDBKeyRangeData&) final;
</span></span></pre>
</div>
</div>
</body>
</html>