<!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>[160657] trunk/Source/WebKit2</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/160657">160657</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2013-12-16 12:47:00 -0800 (Mon, 16 Dec 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>UserData should encode and decode API::Data objects
https://bugs.webkit.org/show_bug.cgi?id=125799

Reviewed by Beth Dakin.

* Shared/APIData.cpp: Added.
(API::Data::encode):
(API::Data::decode):
* Shared/APIData.h:
* Shared/UserData.cpp:
(WebKit::UserData::encode):
(WebKit::UserData::decode):
* WebKit2.xcodeproj/project.pbxproj:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedAPIDatah">trunk/Source/WebKit2/Shared/APIData.h</a></li>
<li><a href="#trunkSourceWebKit2SharedUserDatacpp">trunk/Source/WebKit2/Shared/UserData.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2SharedAPIDatacpp">trunk/Source/WebKit2/Shared/APIData.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (160656 => 160657)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2013-12-16 20:46:39 UTC (rev 160656)
+++ trunk/Source/WebKit2/ChangeLog        2013-12-16 20:47:00 UTC (rev 160657)
</span><span class="lines">@@ -1,5 +1,21 @@
</span><span class="cx"> 2013-12-16  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        UserData should encode and decode API::Data objects
+        https://bugs.webkit.org/show_bug.cgi?id=125799
+
+        Reviewed by Beth Dakin.
+
+        * Shared/APIData.cpp: Added.
+        (API::Data::encode):
+        (API::Data::decode):
+        * Shared/APIData.h:
+        * Shared/UserData.cpp:
+        (WebKit::UserData::encode):
+        (WebKit::UserData::decode):
+        * WebKit2.xcodeproj/project.pbxproj:
+
+2013-12-16  Anders Carlsson  &lt;andersca@apple.com&gt;
+
</ins><span class="cx">         Rename WebData to API::Data
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=125797
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedAPIDatacpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/Shared/APIData.cpp (0 => 160657)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/APIData.cpp                                (rev 0)
+++ trunk/Source/WebKit2/Shared/APIData.cpp        2013-12-16 20:47:00 UTC (rev 160657)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;APIData.h&quot;
+
+#include &quot;ArgumentDecoder.h&quot;
+#include &quot;ArgumentEncoder.h&quot;
+
+namespace API {
+
+void Data::encode(IPC::ArgumentEncoder&amp; encoder) const
+{
+    encoder &lt;&lt; dataReference();
+}
+
+bool Data::decode(IPC::ArgumentDecoder&amp; decoder, RefPtr&lt;API::Object&gt;&amp; result)
+{
+    IPC::DataReference dataReference;
+    if (!decoder.decode(dataReference))
+        return false;
+    
+    result = create(dataReference.data(), dataReference.size());
+    return true;
+}
+
+} // namespace API
</ins></span></pre></div>
<a id="trunkSourceWebKit2SharedAPIDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/APIData.h (160656 => 160657)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/APIData.h        2013-12-16 20:46:39 UTC (rev 160656)
+++ trunk/Source/WebKit2/Shared/APIData.h        2013-12-16 20:47:00 UTC (rev 160657)
</span><span class="lines">@@ -31,6 +31,11 @@
</span><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> 
</span><ins>+namespace IPC {
+class ArgumentDecoder;
+class ArgumentEncoder;
+}
+
</ins><span class="cx"> namespace API {
</span><span class="cx"> 
</span><span class="cx"> class Data : public ObjectImpl&lt;API::Object::Type::Data&gt; {
</span><span class="lines">@@ -69,6 +74,9 @@
</span><span class="cx"> 
</span><span class="cx">     IPC::DataReference dataReference() const { return IPC::DataReference(m_bytes, m_size); }
</span><span class="cx"> 
</span><ins>+    void encode(IPC::ArgumentEncoder&amp;) const;
+    static bool decode(IPC::ArgumentDecoder&amp;, RefPtr&lt;API::Object&gt;&amp;);
+
</ins><span class="cx"> private:
</span><span class="cx">     Data(const unsigned char* bytes, size_t size, FreeDataFunction freeDataFunction, const void* context)
</span><span class="cx">         : m_bytes(bytes)
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedUserDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/UserData.cpp (160656 => 160657)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/UserData.cpp        2013-12-16 20:46:39 UTC (rev 160656)
+++ trunk/Source/WebKit2/Shared/UserData.cpp        2013-12-16 20:47:00 UTC (rev 160657)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #include &quot;UserData.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;APIArray.h&quot;
</span><ins>+#include &quot;APIData.h&quot;
</ins><span class="cx"> #include &quot;APIFrameHandle.h&quot;
</span><span class="cx"> #include &quot;APIGeometry.h&quot;
</span><span class="cx"> #include &quot;APINumber.h&quot;
</span><span class="lines">@@ -118,6 +119,10 @@
</span><span class="cx">         static_cast&lt;const API::Boolean&amp;&gt;(object).encode(encoder);
</span><span class="cx">         break;
</span><span class="cx"> 
</span><ins>+    case API::Object::Type::Data:
+        static_cast&lt;const API::Data&amp;&gt;(object).encode(encoder);
+        break;
+    
</ins><span class="cx">     case API::Object::Type::Dictionary: {
</span><span class="cx">         auto&amp; dictionary = static_cast&lt;const ImmutableDictionary&amp;&gt;(object);
</span><span class="cx">         auto&amp; map = dictionary.map();
</span><span class="lines">@@ -203,6 +208,11 @@
</span><span class="cx">             return false;
</span><span class="cx">         break;
</span><span class="cx"> 
</span><ins>+    case API::Object::Type::Data:
+        if (!API::Data::decode(decoder, result))
+            return false;
+        break;
+
</ins><span class="cx">     case API::Object::Type::Dictionary: {
</span><span class="cx">         uint64_t size;
</span><span class="cx">         if (!decoder.decode(size))
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (160656 => 160657)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2013-12-16 20:46:39 UTC (rev 160656)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2013-12-16 20:47:00 UTC (rev 160657)
</span><span class="lines">@@ -224,6 +224,7 @@
</span><span class="cx">                 1AA9BAE1184FFAC7003B6BC6 /* WeakObjCPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AA9BAE0184FFAC7003B6BC6 /* WeakObjCPtr.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 1AAB0379185A7C6A00EDF501 /* MessageSender.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAB0377185A7C6A00EDF501 /* MessageSender.cpp */; };
</span><span class="cx">                 1AAB037A185A7C6A00EDF501 /* MessageSender.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAB0378185A7C6A00EDF501 /* MessageSender.h */; };
</span><ins>+                1AAB037C185F99D800EDF501 /* APIData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAB037B185F99D800EDF501 /* APIData.cpp */; };
</ins><span class="cx">                 1AAB4A8D1296F0A20023952F /* SandboxExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAB4A8C1296F0A20023952F /* SandboxExtension.h */; };
</span><span class="cx">                 1AAB4AAA1296F1540023952F /* SandboxExtensionMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AAB4AA91296F1540023952F /* SandboxExtensionMac.mm */; };
</span><span class="cx">                 1AABFE3A1829C1ED005B070E /* WKRemoteObjectInterfaceInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AABFE391829C1ED005B070E /* WKRemoteObjectInterfaceInternal.h */; };
</span><span class="lines">@@ -1773,6 +1774,7 @@
</span><span class="cx">                 1AA9BAE0184FFAC7003B6BC6 /* WeakObjCPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakObjCPtr.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1AAB0377185A7C6A00EDF501 /* MessageSender.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MessageSender.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1AAB0378185A7C6A00EDF501 /* MessageSender.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MessageSender.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                1AAB037B185F99D800EDF501 /* APIData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = APIData.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 1AAB4A8C1296F0A20023952F /* SandboxExtension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SandboxExtension.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1AAB4AA91296F1540023952F /* SandboxExtensionMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SandboxExtensionMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1AABFE391829C1ED005B070E /* WKRemoteObjectInterfaceInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKRemoteObjectInterfaceInternal.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -3468,6 +3470,7 @@
</span><span class="cx">                                 BC64696D11DBE603006455B0 /* APIArray.cpp */,
</span><span class="cx">                                 BC64696E11DBE603006455B0 /* APIArray.h */,
</span><span class="cx">                                 1A3DD205125E5A2F004515E6 /* APIClient.h */,
</span><ins>+                                1AAB037B185F99D800EDF501 /* APIData.cpp */,
</ins><span class="cx">                                 51578B821209ECEF00A37C4A /* APIData.h */,
</span><span class="cx">                                 1AC1336F18566C7C00F3EC05 /* APIFrameHandle.cpp */,
</span><span class="cx">                                 1AC1337018566C7C00F3EC05 /* APIFrameHandle.h */,
</span><span class="lines">@@ -3478,6 +3481,7 @@
</span><span class="cx">                                 BCF04C8C11FF9B7D00F86A58 /* APIObject.h */,
</span><span class="cx">                                 1AC1336D18565D2B00F3EC05 /* APIPageHandle.cpp */,
</span><span class="cx">                                 1AC1336B18565C7A00F3EC05 /* APIPageHandle.h */,
</span><ins>+                                BCF04C8E11FF9F6E00F86A58 /* APIString.h */,
</ins><span class="cx">                                 A7D792D51767CB6E00881CBE /* ActivityAssertion.cpp */,
</span><span class="cx">                                 A7D792D41767CB0900881CBE /* ActivityAssertion.h */,
</span><span class="cx">                                 515E7725183DD6F60007203F /* AsyncRequest.cpp */,
</span><span class="lines">@@ -3605,7 +3609,6 @@
</span><span class="cx">                                 51217463164C21370037A5C1 /* WebResourceBuffer.h */,
</span><span class="cx">                                 F634445512A885C8000612D8 /* WebSecurityOrigin.h */,
</span><span class="cx">                                 A72D5D7F1236CBA800A88B15 /* WebSerializedScriptValue.h */,
</span><del>-                                BCF04C8E11FF9F6E00F86A58 /* APIString.h */,
</del><span class="cx">                                 C0337DD7127A51B6008FF4F4 /* WebTouchEvent.cpp */,
</span><span class="cx">                                 BCDB86C01200FB97007254BE /* WebURL.h */,
</span><span class="cx">                                 BCE2315C122C30CA00D5C35A /* WebURLRequest.cpp */,
</span><span class="lines">@@ -7134,6 +7137,7 @@
</span><span class="cx">                                 CD5C66A0134B9D38004FE2A8 /* InjectedBundlePageFullScreenClient.cpp in Sources */,
</span><span class="cx">                                 755422CB180650020046F6A8 /* WebOriginDataManager.cpp in Sources */,
</span><span class="cx">                                 BCA8C6A811E3BA5F00812FB7 /* InjectedBundlePageLoaderClient.cpp in Sources */,
</span><ins>+                                1AAB037C185F99D800EDF501 /* APIData.cpp in Sources */,
</ins><span class="cx">                                 BC8147AA12F64CDA007B2C32 /* InjectedBundlePagePolicyClient.cpp in Sources */,
</span><span class="cx">                                 659C551E130006410025C0C2 /* InjectedBundlePageResourceLoadClient.cpp in Sources */,
</span><span class="cx">                                 BCA8C6AF11E3C08700812FB7 /* InjectedBundlePageUIClient.cpp in Sources */,
</span></span></pre>
</div>
</div>

</body>
</html>