<!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>[200249] 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/200249">200249</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2016-04-29 10:05:46 -0700 (Fri, 29 Apr 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add a default &quot;.isolatedCopy()&quot; specialization to CrossThreadCopier, and other small cleanup.
https://bugs.webkit.org/show_bug.cgi?id=157185

Reviewed by Anders Carlsson.

Source/WebCore:

No new tests (Code cleanup, no change in behavior).

* platform/CrossThreadCopier.cpp:
(WebCore::IndexedDB::TransactionMode&gt;::copy): Deleted.
(WebCore::IndexedDB::CursorDirection&gt;::copy): Deleted.
(WebCore::IndexedDB::CursorType&gt;::copy): Deleted.
(WebCore::IDBGetResult&gt;::copy): Deleted.
(WebCore::IDBKeyData&gt;::copy): Deleted.
(WebCore::IDBKeyRangeData&gt;::copy): Deleted.
(WebCore::IDBDatabaseInfo&gt;::copy): Deleted.
(WebCore::IDBDatabaseIdentifier&gt;::copy): Deleted.
(WebCore::IDBTransactionInfo&gt;::copy): Deleted.
(WebCore::IDBResourceIdentifier&gt;::copy): Deleted.
(WebCore::IDBError&gt;::copy): Deleted.
(WebCore::IDBObjectStoreInfo&gt;::copy): Deleted.
(WebCore::IDBIndexInfo&gt;::copy): Deleted.
(WebCore::IDBCursorInfo&gt;::copy): Deleted.
(WebCore::IDBValue&gt;::copy): Deleted.

* platform/CrossThreadCopier.h:
(WebCore::AllowCrossThreadAccessWrapper::AllowCrossThreadAccessWrapper): Deleted dead code.
(WebCore::AllowCrossThreadAccessWrapper::value): Deleted dead code.
(WebCore::AllowCrossThreadAccess): Deleted dead code.
(WebCore::AllowAccessLaterWrapper::AllowAccessLaterWrapper): Deleted dead code.
(WebCore::AllowAccessLaterWrapper::value): Deleted dead code.
(WebCore::AllowAccessLater): Deleted dead code.

Source/WebKit2:

* Shared/WebCrossThreadCopier.cpp:
(WebCore::Vector&lt;char&gt;&gt;::copy): reserveInitialCapacity() before creating the copy.
(WebCore::Vector&lt;int64_t&gt;&gt;::copy): Ditto.
(WebCore::Vector&lt;uint8_t&gt;&gt;::copy): Ditto.
(WebCore::Vector&lt;Vector&lt;IDBKeyData&gt;&gt;&gt;::copy): Deleted dead code.
* Shared/WebCrossThreadCopier.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</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="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedWebCrossThreadCopiercpp">trunk/Source/WebKit2/Shared/WebCrossThreadCopier.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedWebCrossThreadCopierh">trunk/Source/WebKit2/Shared/WebCrossThreadCopier.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (200248 => 200249)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-04-29 16:54:36 UTC (rev 200248)
+++ trunk/Source/WebCore/ChangeLog        2016-04-29 17:05:46 UTC (rev 200249)
</span><span class="lines">@@ -1,3 +1,37 @@
</span><ins>+2016-04-29  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        Add a default &quot;.isolatedCopy()&quot; specialization to CrossThreadCopier, and other small cleanup.
+        https://bugs.webkit.org/show_bug.cgi?id=157185
+
+        Reviewed by Anders Carlsson.
+
+        No new tests (Code cleanup, no change in behavior).
+
+        * platform/CrossThreadCopier.cpp:
+        (WebCore::IndexedDB::TransactionMode&gt;::copy): Deleted.
+        (WebCore::IndexedDB::CursorDirection&gt;::copy): Deleted.
+        (WebCore::IndexedDB::CursorType&gt;::copy): Deleted.
+        (WebCore::IDBGetResult&gt;::copy): Deleted.
+        (WebCore::IDBKeyData&gt;::copy): Deleted.
+        (WebCore::IDBKeyRangeData&gt;::copy): Deleted.
+        (WebCore::IDBDatabaseInfo&gt;::copy): Deleted.
+        (WebCore::IDBDatabaseIdentifier&gt;::copy): Deleted.
+        (WebCore::IDBTransactionInfo&gt;::copy): Deleted.
+        (WebCore::IDBResourceIdentifier&gt;::copy): Deleted.
+        (WebCore::IDBError&gt;::copy): Deleted.
+        (WebCore::IDBObjectStoreInfo&gt;::copy): Deleted.
+        (WebCore::IDBIndexInfo&gt;::copy): Deleted.
+        (WebCore::IDBCursorInfo&gt;::copy): Deleted.
+        (WebCore::IDBValue&gt;::copy): Deleted.
+
+        * platform/CrossThreadCopier.h:
+        (WebCore::AllowCrossThreadAccessWrapper::AllowCrossThreadAccessWrapper): Deleted dead code.
+        (WebCore::AllowCrossThreadAccessWrapper::value): Deleted dead code.
+        (WebCore::AllowCrossThreadAccess): Deleted dead code.
+        (WebCore::AllowAccessLaterWrapper::AllowAccessLaterWrapper): Deleted dead code.
+        (WebCore::AllowAccessLaterWrapper::value): Deleted dead code.
+        (WebCore::AllowAccessLater): Deleted dead code.
+
</ins><span class="cx"> 2016-04-29  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Wheel Event Not Fired For `body,html { height:100% }`
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformCrossThreadCopiercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/CrossThreadCopier.cpp (200248 => 200249)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/CrossThreadCopier.cpp        2016-04-29 16:54:36 UTC (rev 200248)
+++ trunk/Source/WebCore/platform/CrossThreadCopier.cpp        2016-04-29 17:05:46 UTC (rev 200249)
</span><span class="lines">@@ -43,21 +43,6 @@
</span><span class="cx"> #include &lt;wtf/Assertions.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><del>-#if ENABLE(INDEXED_DATABASE)
-#include &quot;IDBCursorInfo.h&quot;
-#include &quot;IDBDatabaseIdentifier.h&quot;
-#include &quot;IDBDatabaseInfo.h&quot;
-#include &quot;IDBError.h&quot;
-#include &quot;IDBGetResult.h&quot;
-#include &quot;IDBIndexInfo.h&quot;
-#include &quot;IDBKeyData.h&quot;
-#include &quot;IDBKeyRangeData.h&quot;
-#include &quot;IDBObjectStoreInfo.h&quot;
-#include &quot;IDBResourceIdentifier.h&quot;
-#include &quot;IDBTransactionInfo.h&quot;
-#include &quot;IDBValue.h&quot;
-#endif
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> CrossThreadCopierBase&lt;false, false, URL&gt;::Type CrossThreadCopierBase&lt;false, false, URL&gt;::copy(const URL&amp; url)
</span><span class="lines">@@ -110,85 +95,6 @@
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if ENABLE(INDEXED_DATABASE)
-
-IndexedDB::TransactionMode CrossThreadCopierBase&lt;false, false, IndexedDB::TransactionMode&gt;::copy(const IndexedDB::TransactionMode&amp; mode)
-{
-    return mode;
-}
-
-IndexedDB::CursorDirection CrossThreadCopierBase&lt;false, false, IndexedDB::CursorDirection&gt;::copy(const IndexedDB::CursorDirection&amp; direction)
-{
-    return direction;
-}
-
-IndexedDB::CursorType CrossThreadCopierBase&lt;false, false, IndexedDB::CursorType&gt;::copy(const IndexedDB::CursorType&amp; type)
-{
-    return type;
-}
-
-CrossThreadCopierBase&lt;false, false, IDBGetResult&gt;::Type CrossThreadCopierBase&lt;false, false, IDBGetResult&gt;::copy(const IDBGetResult&amp; result)
-{
-    return result.isolatedCopy();
-}
-
-CrossThreadCopierBase&lt;false, false, IDBKeyData&gt;::Type CrossThreadCopierBase&lt;false, false, IDBKeyData&gt;::copy(const IDBKeyData&amp; keyData)
-{
-    return keyData.isolatedCopy();
-}
-
-CrossThreadCopierBase&lt;false, false, IDBKeyRangeData&gt;::Type CrossThreadCopierBase&lt;false, false, IDBKeyRangeData&gt;::copy(const IDBKeyRangeData&amp; keyRangeData)
-{
-    return keyRangeData.isolatedCopy();
-}
-
-CrossThreadCopierBase&lt;false, false, IDBDatabaseInfo&gt;::Type CrossThreadCopierBase&lt;false, false, IDBDatabaseInfo&gt;::copy(const IDBDatabaseInfo&amp; info)
-{
-    return info.isolatedCopy();
-}
-
-CrossThreadCopierBase&lt;false, false, IDBDatabaseIdentifier&gt;::Type CrossThreadCopierBase&lt;false, false, IDBDatabaseIdentifier&gt;::copy(const IDBDatabaseIdentifier&amp; identifier)
-{
-    return identifier.isolatedCopy();
-}
-
-CrossThreadCopierBase&lt;false, false, IDBTransactionInfo&gt;::Type CrossThreadCopierBase&lt;false, false, IDBTransactionInfo&gt;::copy(const IDBTransactionInfo&amp; info)
-{
-    return info.isolatedCopy();
-}
-
-CrossThreadCopierBase&lt;false, false, IDBResourceIdentifier&gt;::Type CrossThreadCopierBase&lt;false, false, IDBResourceIdentifier&gt;::copy(const IDBResourceIdentifier&amp; identifier)
-{
-    return identifier.isolatedCopy();
-}
-
-CrossThreadCopierBase&lt;false, false, IDBError&gt;::Type CrossThreadCopierBase&lt;false, false, IDBError&gt;::copy(const IDBError&amp; error)
-{
-    return error.isolatedCopy();
-}
-
-CrossThreadCopierBase&lt;false, false, IDBObjectStoreInfo&gt;::Type CrossThreadCopierBase&lt;false, false, IDBObjectStoreInfo&gt;::copy(const IDBObjectStoreInfo&amp; info)
-{
-    return info.isolatedCopy();
-}
-
-CrossThreadCopierBase&lt;false, false, IDBIndexInfo&gt;::Type CrossThreadCopierBase&lt;false, false, IDBIndexInfo&gt;::copy(const IDBIndexInfo&amp; info)
-{
-    return info.isolatedCopy();
-}
-
-CrossThreadCopierBase&lt;false, false, IDBCursorInfo&gt;::Type CrossThreadCopierBase&lt;false, false, IDBCursorInfo&gt;::copy(const IDBCursorInfo&amp; info)
-{
-    return info.isolatedCopy();
-}
-
-CrossThreadCopierBase&lt;false, false, IDBValue&gt;::Type CrossThreadCopierBase&lt;false, false, IDBValue&gt;::copy(const IDBValue&amp; value)
-{
-    return value.isolatedCopy();
-}
-
-#endif // ENABLE(INDEXED_DATABASE)
-
</del><span class="cx"> // Test CrossThreadCopier using COMPILE_ASSERT.
</span><span class="cx"> 
</span><span class="cx"> // Verify that ThreadSafeRefCounted objects get handled correctly.
</span><span class="lines">@@ -211,32 +117,25 @@
</span><span class="cx">                   &gt;::value),
</span><span class="cx">                RawPointerTest);
</span><span class="cx"> 
</span><ins>+// Add specializations for RefCounted types which will let us verify that no other template matches.
+template&lt;typename T&gt; struct CrossThreadCopierBase&lt;false, false, RefPtr&lt;T&gt;&gt; {
+    typedef int Type;
+};
</ins><span class="cx"> 
</span><del>-// Add a generic specialization which will let's us verify that no other template matches.
-template&lt;typename T&gt; struct CrossThreadCopierBase&lt;false, false, T&gt; {
</del><ins>+template&lt;typename T&gt; struct CrossThreadCopierBase&lt;false, false, PassRefPtr&lt;T&gt;&gt; {
</ins><span class="cx">     typedef int Type;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-// Verify that RefCounted objects only match our generic template which exposes Type as int.
</del><ins>+template&lt;typename T&gt; struct CrossThreadCopierBase&lt;false, false, T*&gt; {
+    typedef int Type;
+};
+
+// Verify that RefCounted objects only match the above templates which expose Type as int.
</ins><span class="cx"> class CopierRefCountedTest : public RefCounted&lt;CopierRefCountedTest&gt; {
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-COMPILE_ASSERT((std::is_same&lt;
-                  int,
-                  CrossThreadCopier&lt;PassRefPtr&lt;CopierRefCountedTest&gt;&gt;::Type
-                  &gt;::value),
-               PassRefPtrRefCountedTest);
</del><ins>+static_assert((std::is_same&lt;int, CrossThreadCopier&lt;PassRefPtr&lt;CopierRefCountedTest&gt;&gt;::Type&gt;::value), &quot;CrossThreadCopier specialization improperly applied to PassRefPtr&lt;&gt; of a RefCounted (but not ThreadSafeRefCounted) type&quot;);
+static_assert((std::is_same&lt;int, CrossThreadCopier&lt;RefPtr&lt;CopierRefCountedTest&gt;&gt;::Type&gt;::value), &quot;CrossThreadCopier specialization improperly applied to RefPtr&lt;&gt; of a RefCounted (but not ThreadSafeRefCounted) type&quot;);
+static_assert((std::is_same&lt;int, CrossThreadCopier&lt;CopierRefCountedTest*&gt;::Type&gt;::value), &quot;CrossThreadCopier specialization improperly applied to raw pointer of a RefCounted (but not ThreadSafeRefCounted) type&quot;);
</ins><span class="cx"> 
</span><del>-COMPILE_ASSERT((std::is_same&lt;
-                  int,
-                  CrossThreadCopier&lt;RefPtr&lt;CopierRefCountedTest&gt;&gt;::Type
-                  &gt;::value),
-               RefPtrRefCountedTest);
-
-COMPILE_ASSERT((std::is_same&lt;
-                  int,
-                  CrossThreadCopier&lt;CopierRefCountedTest*&gt;::Type
-                  &gt;::value),
-               RawPointerRefCountedTest);
-
</del><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformCrossThreadCopierh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/CrossThreadCopier.h (200248 => 200249)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/CrossThreadCopier.h        2016-04-29 16:54:36 UTC (rev 200248)
+++ trunk/Source/WebCore/platform/CrossThreadCopier.h        2016-04-29 17:05:46 UTC (rev 200249)
</span><span class="lines">@@ -100,6 +100,14 @@
</span><span class="cx"> template&lt;&gt; struct CrossThreadCopierBase&lt;false, false, IntSize&gt; : public CrossThreadCopierPassThrough&lt;IntSize&gt; {
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+// Classes that have an isolatedCopy() method get a default specialization.
+template&lt;class T&gt; struct CrossThreadCopierBase&lt;false, false, T&gt; {
+    static T copy(const T&amp; value)
+    {
+        return value.isolatedCopy();
+    }
+};
+
</ins><span class="cx"> // Custom copy methods.
</span><span class="cx"> template&lt;typename T&gt; struct CrossThreadCopierBase&lt;false, true, T&gt; {
</span><span class="cx">     typedef typename CrossThreadCopierBaseHelper::RemovePointer&lt;T&gt;::Type RefCountedType;
</span><span class="lines">@@ -157,139 +165,8 @@
</span><span class="cx">     static Type copy(const Vector&lt;String&gt;&amp;);
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-#if ENABLE(INDEXED_DATABASE)
-namespace IndexedDB {
-enum class TransactionMode;
-enum class CursorDirection;
-enum class CursorType;
-}
-template&lt;&gt; struct CrossThreadCopierBase&lt;false, false, IndexedDB::TransactionMode&gt; {
-    WEBCORE_EXPORT static IndexedDB::TransactionMode copy(const IndexedDB::TransactionMode&amp;);
-};
-template&lt;&gt; struct CrossThreadCopierBase&lt;false, false, IndexedDB::CursorDirection&gt; {
-    WEBCORE_EXPORT static IndexedDB::CursorDirection copy(const IndexedDB::CursorDirection&amp;);
-};
-template&lt;&gt; struct CrossThreadCopierBase&lt;false, false, IndexedDB::CursorType&gt; {
-    WEBCORE_EXPORT static IndexedDB::CursorType copy(const IndexedDB::CursorType&amp;);
-};
-
-class IDBGetResult;
-template&lt;&gt; struct WEBCORE_EXPORT CrossThreadCopierBase&lt;false, false, IDBGetResult&gt; {
-    typedef IDBGetResult Type;
-    static Type copy(const IDBGetResult&amp;);
-};
-
-class IDBKeyData;
-template&lt;&gt; struct WEBCORE_EXPORT CrossThreadCopierBase&lt;false, false, IDBKeyData&gt; {
-    typedef IDBKeyData Type;
-    static Type copy(const IDBKeyData&amp;);
-};
-
-struct IDBKeyRangeData;
-template&lt;&gt; struct WEBCORE_EXPORT CrossThreadCopierBase&lt;false, false, IDBKeyRangeData&gt; {
-    typedef IDBKeyRangeData Type;
-    static Type copy(const IDBKeyRangeData&amp;);
-};
-
-class IDBDatabaseInfo;
-template&lt;&gt; struct WEBCORE_EXPORT CrossThreadCopierBase&lt;false, false, IDBDatabaseInfo&gt; {
-    typedef IDBDatabaseInfo Type;
-    static Type copy(const IDBDatabaseInfo&amp;);
-};
-
-class IDBDatabaseIdentifier;
-template&lt;&gt; struct WEBCORE_EXPORT CrossThreadCopierBase&lt;false, false, IDBDatabaseIdentifier&gt; {
-    typedef IDBDatabaseIdentifier Type;
-    static Type copy(const IDBDatabaseIdentifier&amp;);
-};
-
-class IDBError;
-template&lt;&gt; struct WEBCORE_EXPORT CrossThreadCopierBase&lt;false, false, IDBError&gt; {
-    typedef IDBError Type;
-    static Type copy(const IDBError&amp;);
-};
-
-class IDBResourceIdentifier;
-template&lt;&gt; struct WEBCORE_EXPORT CrossThreadCopierBase&lt;false, false, IDBResourceIdentifier&gt; {
-    typedef IDBResourceIdentifier Type;
-    static Type copy(const IDBResourceIdentifier&amp;);
-};
-
-class IDBTransactionInfo;
-template&lt;&gt; struct WEBCORE_EXPORT CrossThreadCopierBase&lt;false, false, IDBTransactionInfo&gt; {
-    typedef IDBTransactionInfo Type;
-    static Type copy(const IDBTransactionInfo&amp;);
-};
-
-class IDBObjectStoreInfo;
-template&lt;&gt; struct WEBCORE_EXPORT CrossThreadCopierBase&lt;false, false, IDBObjectStoreInfo&gt; {
-    typedef IDBObjectStoreInfo Type;
-    static Type copy(const IDBObjectStoreInfo&amp;);
-};
-
-class IDBIndexInfo;
-template&lt;&gt; struct WEBCORE_EXPORT CrossThreadCopierBase&lt;false, false, IDBIndexInfo&gt; {
-    typedef IDBIndexInfo Type;
-    static Type copy(const IDBIndexInfo&amp;);
-};
-
-class IDBCursorInfo;
-template&lt;&gt; struct WEBCORE_EXPORT CrossThreadCopierBase&lt;false, false, IDBCursorInfo&gt; {
-    typedef IDBCursorInfo Type;
-    static Type copy(const IDBCursorInfo&amp;);
-};
-
-class IDBValue;
-template&lt;&gt; struct WEBCORE_EXPORT CrossThreadCopierBase&lt;false, false, IDBValue&gt; {
-    typedef IDBValue Type;
-    static Type copy(const IDBValue&amp;);
-};
-
-#endif
-
</del><span class="cx"> template&lt;typename T&gt;
</span><span class="cx"> struct CrossThreadCopier : public CrossThreadCopierBase&lt;CrossThreadCopierBaseHelper::IsEnumOrConvertibleToInteger&lt;T&gt;::value, CrossThreadCopierBaseHelper::IsThreadSafeRefCountedPointer&lt;T&gt;::value, T&gt; {
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-template&lt;typename T&gt; struct AllowCrossThreadAccessWrapper {
-public:
-    explicit AllowCrossThreadAccessWrapper(T* value)
-        : m_value(value) { }
-    T* value() const { return m_value; }
-private:
-    T* m_value;
-};
-
-template&lt;typename T&gt; struct CrossThreadCopierBase&lt;false, false, AllowCrossThreadAccessWrapper&lt;T&gt;&gt; {
-    typedef T* Type;
-    static Type copy(const AllowCrossThreadAccessWrapper&lt;T&gt;&amp; wrapper) { return wrapper.value(); }
-};
-
-template&lt;typename T&gt; AllowCrossThreadAccessWrapper&lt;T&gt; AllowCrossThreadAccess(T* value) 
-{
-    return AllowCrossThreadAccessWrapper&lt;T&gt;(value);
-}
-
-// FIXME: Move to a different header file. AllowAccessLater is for cross-thread access
-// that is not cross-thread (tasks posted to a queue guaranteed to run on the same thread).
-template&lt;typename T&gt; struct AllowAccessLaterWrapper {
-public:
-    explicit AllowAccessLaterWrapper(T* value)
-        : m_value(value) { }
-    T* value() const { return m_value; }
-private:
-    T* m_value;
-};
-
-template&lt;typename T&gt; struct CrossThreadCopierBase&lt;false, false, AllowAccessLaterWrapper&lt;T&gt;&gt; {
-    typedef T* Type;
-    static Type copy(const AllowAccessLaterWrapper&lt;T&gt;&amp; wrapper) { return wrapper.value(); }
-};
-
-template&lt;typename T&gt; AllowAccessLaterWrapper&lt;T&gt; AllowAccessLater(T* value)
-{
-    return AllowAccessLaterWrapper&lt;T&gt;(value);
-}
-
-
</del><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (200248 => 200249)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-04-29 16:54:36 UTC (rev 200248)
+++ trunk/Source/WebKit2/ChangeLog        2016-04-29 17:05:46 UTC (rev 200249)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2016-04-29  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        Add a default &quot;.isolatedCopy()&quot; specialization to CrossThreadCopier, and other small cleanup.
+        https://bugs.webkit.org/show_bug.cgi?id=157185
+
+        Reviewed by Anders Carlsson.
+
+        * Shared/WebCrossThreadCopier.cpp:
+        (WebCore::Vector&lt;char&gt;&gt;::copy): reserveInitialCapacity() before creating the copy.
+        (WebCore::Vector&lt;int64_t&gt;&gt;::copy): Ditto.
+        (WebCore::Vector&lt;uint8_t&gt;&gt;::copy): Ditto.
+        (WebCore::Vector&lt;Vector&lt;IDBKeyData&gt;&gt;&gt;::copy): Deleted dead code.
+        * Shared/WebCrossThreadCopier.h:
+
</ins><span class="cx"> 2016-04-29  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r200217.
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebCrossThreadCopiercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebCrossThreadCopier.cpp (200248 => 200249)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebCrossThreadCopier.cpp        2016-04-29 16:54:36 UTC (rev 200248)
+++ trunk/Source/WebKit2/Shared/WebCrossThreadCopier.cpp        2016-04-29 17:05:46 UTC (rev 200249)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> Vector&lt;char&gt; CrossThreadCopierBase&lt;false, false, Vector&lt;char&gt;&gt;::copy(const Vector&lt;char&gt;&amp; vector)
</span><span class="cx"> {
</span><span class="cx">     Vector&lt;char&gt; result;
</span><ins>+    result.reserveInitialCapacity(vector.size());
</ins><span class="cx">     result.appendVector(vector);
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="lines">@@ -43,6 +44,7 @@
</span><span class="cx"> Vector&lt;int64_t&gt; CrossThreadCopierBase&lt;false, false, Vector&lt;int64_t&gt;&gt;::copy(const Vector&lt;int64_t&gt;&amp; vector)
</span><span class="cx"> {
</span><span class="cx">     Vector&lt;int64_t&gt; result;
</span><ins>+    result.reserveInitialCapacity(vector.size());
</ins><span class="cx">     result.appendVector(vector);
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="lines">@@ -50,23 +52,11 @@
</span><span class="cx"> Vector&lt;uint8_t&gt; CrossThreadCopierBase&lt;false, false, Vector&lt;uint8_t&gt;&gt;::copy(const Vector&lt;uint8_t&gt;&amp; vector)
</span><span class="cx"> {
</span><span class="cx">     Vector&lt;uint8_t&gt; result;
</span><ins>+    result.reserveInitialCapacity(vector.size());
</ins><span class="cx">     result.appendVector(vector);
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Vector&lt;Vector&lt;IDBKeyData&gt;&gt; CrossThreadCopierBase&lt;false, false, Vector&lt;Vector&lt;IDBKeyData&gt;&gt;&gt;::copy(const Vector&lt;Vector&lt;IDBKeyData&gt;&gt;&amp; vector)
-{
-    Vector&lt;Vector&lt;IDBKeyData&gt;&gt; result;
-
-    for (const auto&amp; keys : vector) {
-        result.append(Vector&lt;IDBKeyData&gt;());
-        for (const auto&amp; key : keys)
-            result.last().append(WebCore::CrossThreadCopier&lt;IDBKeyData&gt;::copy(key));
-    }
-
-    return result;
-}
-
</del><span class="cx"> ASCIILiteral CrossThreadCopierBase&lt;false, false, ASCIILiteral&gt;::copy(const ASCIILiteral&amp; literal)
</span><span class="cx"> {
</span><span class="cx">     return literal;
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebCrossThreadCopierh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebCrossThreadCopier.h (200248 => 200249)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebCrossThreadCopier.h        2016-04-29 16:54:36 UTC (rev 200248)
+++ trunk/Source/WebKit2/Shared/WebCrossThreadCopier.h        2016-04-29 17:05:46 UTC (rev 200249)
</span><span class="lines">@@ -64,10 +64,6 @@
</span><span class="cx">     static Vector&lt;uint8_t&gt; copy(const Vector&lt;uint8_t&gt;&amp;);
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-template&lt;&gt; struct CrossThreadCopierBase&lt;false, false, Vector&lt;Vector&lt;IDBKeyData&gt;&gt;&gt; {
-    static Vector&lt;Vector&lt;IDBKeyData&gt;&gt; copy(const Vector&lt;Vector&lt;IDBKeyData&gt;&gt;&amp;);
-};
-
</del><span class="cx"> template&lt;&gt; struct CrossThreadCopierBase&lt;false, false, WTF::ASCIILiteral&gt; {
</span><span class="cx">     static WTF::ASCIILiteral copy(const WTF::ASCIILiteral&amp;);
</span><span class="cx"> };
</span></span></pre>
</div>
</div>

</body>
</html>