<!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>[162619] 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/162619">162619</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2014-01-23 10:03:19 -0800 (Thu, 23 Jan 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Make IDBGetResult work with IDBKeyData instead of IDBKey.
https://bugs.webkit.org/show_bug.cgi?id=127493

Reviewed by Eric Carlson.

Also break it into its own header to work better with IPC messages.

* Modules/indexeddb/IDBGetResult.h: Added.
(WebCore::IDBGetResult::IDBGetResult):

* Modules/indexeddb/IDBServerConnection.h:

* Modules/indexeddb/IDBTransactionBackendOperations.cpp:
(WebCore::GetOperation::perform):

* WebCore.xcodeproj/project.pbxproj:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBServerConnectionh">trunk/Source/WebCore/Modules/indexeddb/IDBServerConnection.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBTransactionBackendOperationscpp">trunk/Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.cpp</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBGetResulth">trunk/Source/WebCore/Modules/indexeddb/IDBGetResult.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (162618 => 162619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-01-23 17:53:14 UTC (rev 162618)
+++ trunk/Source/WebCore/ChangeLog        2014-01-23 18:03:19 UTC (rev 162619)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2014-01-23  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        Make IDBGetResult work with IDBKeyData instead of IDBKey.
+        https://bugs.webkit.org/show_bug.cgi?id=127493
+
+        Reviewed by Eric Carlson.
+
+        Also break it into its own header to work better with IPC messages.
+
+        * Modules/indexeddb/IDBGetResult.h: Added.
+        (WebCore::IDBGetResult::IDBGetResult):
+
+        * Modules/indexeddb/IDBServerConnection.h:
+
+        * Modules/indexeddb/IDBTransactionBackendOperations.cpp:
+        (WebCore::GetOperation::perform):
+
+        * WebCore.xcodeproj/project.pbxproj:
+
</ins><span class="cx"> 2014-01-23  Mátyás Mustoha  &lt;mmatyas@inf.u-szeged.hu&gt;
</span><span class="cx"> 
</span><span class="cx">         [curl] Add storage limit to cache manager
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBGetResulth"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/indexeddb/IDBGetResult.h (0 => 162619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBGetResult.h                                (rev 0)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBGetResult.h        2014-01-23 18:03:19 UTC (rev 162619)
</span><span class="lines">@@ -0,0 +1,68 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef IDBGetResult_h
+#define IDBGetResult_h
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include &quot;IDBKey.h&quot;
+#include &quot;IDBKeyData.h&quot;
+#include &quot;IDBKeyPath.h&quot;
+#include &quot;SharedBuffer.h&quot;
+
+namespace WebCore {
+
+struct IDBGetResult {
+    IDBGetResult()
+    {
+    }
+
+    IDBGetResult(PassRefPtr&lt;SharedBuffer&gt; buffer)
+        : valueBuffer(buffer)
+    {
+    }
+
+    IDBGetResult(PassRefPtr&lt;IDBKey&gt; key)
+        : keyData(key.get())
+    {
+    }
+
+    IDBGetResult(PassRefPtr&lt;SharedBuffer&gt; buffer, PassRefPtr&lt;IDBKey&gt; key, const IDBKeyPath&amp; path)
+        : valueBuffer(buffer)
+        , keyData(key.get())
+        , keyPath(path)
+    {
+    }
+
+    RefPtr&lt;SharedBuffer&gt; valueBuffer;
+    IDBKeyData keyData;
+    IDBKeyPath keyPath;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
+#endif // IDBGetResult_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBServerConnectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBServerConnection.h (162618 => 162619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBServerConnection.h        2014-01-23 17:53:14 UTC (rev 162618)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBServerConnection.h        2014-01-23 18:03:19 UTC (rev 162619)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;IDBCursorBackendOperations.h&quot;
</span><span class="cx"> #include &quot;IDBDatabaseMetadata.h&quot;
</span><ins>+#include &quot;IDBGetResult.h&quot;
</ins><span class="cx"> #include &quot;IDBTransactionBackendOperations.h&quot;
</span><span class="cx"> #include &quot;IndexedDB.h&quot;
</span><span class="cx"> #include &lt;functional&gt;
</span><span class="lines">@@ -46,33 +47,6 @@
</span><span class="cx"> struct IDBIndexMetadata;
</span><span class="cx"> struct IDBObjectStoreMetadata;
</span><span class="cx"> 
</span><del>-struct IDBGetResult {
-    IDBGetResult()
-    {
-    }
-
-    IDBGetResult(PassRefPtr&lt;SharedBuffer&gt; buffer)
-        : valueBuffer(buffer)
-    {
-    }
-
-    IDBGetResult(PassRefPtr&lt;IDBKey&gt; idbKey)
-        : key(idbKey)
-    {
-    }
-
-    IDBGetResult(PassRefPtr&lt;SharedBuffer&gt; buffer, PassRefPtr&lt;IDBKey&gt; idbKey, const IDBKeyPath&amp; path)
-        : valueBuffer(buffer)
-        , key(idbKey)
-        , keyPath(path)
-    {
-    }
-
-    RefPtr&lt;SharedBuffer&gt; valueBuffer;
-    RefPtr&lt;IDBKey&gt; key;
-    IDBKeyPath keyPath;
-};
-
</del><span class="cx"> // This interface provides a single asynchronous layer between the web-facing frontend
</span><span class="cx"> // and the I/O performing backend of IndexedDatabase.
</span><span class="cx"> // If an operation's completion needs to be confirmed that must be done through use of a callback function.
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBTransactionBackendOperationscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.cpp (162618 => 162619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.cpp        2014-01-23 17:53:14 UTC (rev 162618)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.cpp        2014-01-23 18:03:19 UTC (rev 162619)
</span><span class="lines">@@ -101,13 +101,13 @@
</span><span class="cx">             m_callbacks-&gt;onError(error);
</span><span class="cx">         else {
</span><span class="cx">             if (!result.valueBuffer) {
</span><del>-                if (!result.key)
</del><ins>+                if (result.keyData.isNull)
</ins><span class="cx">                     m_callbacks-&gt;onSuccess();
</span><span class="cx">                 else
</span><del>-                    m_callbacks-&gt;onSuccess(result.key.get());
</del><ins>+                    m_callbacks-&gt;onSuccess(result.keyData.maybeCreateIDBKey());
</ins><span class="cx">             } else {
</span><del>-                if (result.key)
-                    m_callbacks-&gt;onSuccess(result.valueBuffer, result.key, result.keyPath);
</del><ins>+                if (!result.keyData.isNull)
+                    m_callbacks-&gt;onSuccess(result.valueBuffer, result.keyData.maybeCreateIDBKey(), result.keyPath);
</ins><span class="cx">                 else
</span><span class="cx">                     m_callbacks-&gt;onSuccess(result.valueBuffer.get());
</span><span class="cx">             }
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (162618 => 162619)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-01-23 17:53:14 UTC (rev 162618)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-01-23 18:03:19 UTC (rev 162619)
</span><span class="lines">@@ -1798,6 +1798,7 @@
</span><span class="cx">                 511EF2D117F0FDF100E4FA16 /* JSIDBObjectStoreCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 511EF2CE17F0FDF100E4FA16 /* JSIDBObjectStoreCustom.cpp */; };
</span><span class="cx">                 511F23190DC160DA004F0032 /* StorageThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 511F23150DC160DA004F0032 /* StorageThread.cpp */; };
</span><span class="cx">                 511F231A0DC160DA004F0032 /* StorageThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 511F23160DC160DA004F0032 /* StorageThread.h */; };
</span><ins>+                5123AF1D18918AE40031CDC9 /* IDBGetResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 5123AF1C18918AE40031CDC9 /* IDBGetResult.h */; };
</ins><span class="cx">                 5126E6BB0A2E3B12005C29FA /* IconDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5126E6B90A2E3B12005C29FA /* IconDatabase.cpp */; };
</span><span class="cx">                 5126E6BC0A2E3B12005C29FA /* IconDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = 5126E6BA0A2E3B12005C29FA /* IconDatabase.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 512DD8E30D91E2B4000F89EE /* SharedBufferCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 512DD8E20D91E2B4000F89EE /* SharedBufferCF.cpp */; };
</span><span class="lines">@@ -8752,6 +8753,7 @@
</span><span class="cx">                 511EF2CE17F0FDF100E4FA16 /* JSIDBObjectStoreCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSIDBObjectStoreCustom.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 511F23150DC160DA004F0032 /* StorageThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StorageThread.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 511F23160DC160DA004F0032 /* StorageThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StorageThread.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                5123AF1C18918AE40031CDC9 /* IDBGetResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBGetResult.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 5126E6B90A2E3B12005C29FA /* IconDatabase.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = IconDatabase.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5126E6BA0A2E3B12005C29FA /* IconDatabase.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = IconDatabase.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 512DD8E20D91E2B4000F89EE /* SharedBufferCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SharedBufferCF.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -17701,6 +17703,7 @@
</span><span class="cx">                                 51D7198A181106DF0016DC51 /* IDBFactory.idl */,
</span><span class="cx">                                 51D7198B181106DF0016DC51 /* IDBFactoryBackendInterface.cpp */,
</span><span class="cx">                                 51D7198C181106E00016DC51 /* IDBFactoryBackendInterface.h */,
</span><ins>+                                5123AF1C18918AE40031CDC9 /* IDBGetResult.h */,
</ins><span class="cx">                                 51D7198D181106E00016DC51 /* IDBHistograms.h */,
</span><span class="cx">                                 51D7198E181106E00016DC51 /* IDBIndex.cpp */,
</span><span class="cx">                                 51D7198F181106E00016DC51 /* IDBIndex.h */,
</span><span class="lines">@@ -24876,6 +24879,7 @@
</span><span class="cx">                                 E44613AD0CD6331000FADA75 /* MediaError.h in Headers */,
</span><span class="cx">                                 4E1959220A39DABA00220FE5 /* MediaFeatureNames.h in Headers */,
</span><span class="cx">                                 07A6D1EC1491137700051D0C /* MediaFragmentURIParser.h in Headers */,
</span><ins>+                                5123AF1D18918AE40031CDC9 /* IDBGetResult.h in Headers */,
</ins><span class="cx">                                 E125F82C1822CFEC00D84CD9 /* CryptoAlgorithmSHA1.h in Headers */,
</span><span class="cx">                                 A8EA800E0A19516E00A8EF5F /* MediaList.h in Headers */,
</span><span class="cx">                                 E44613E40CD681A200FADA75 /* MediaPlayer.h in Headers */,
</span></span></pre>
</div>
</div>

</body>
</html>