Title: [201504] trunk/Source
Revision
201504
Author
beid...@apple.com
Date
2016-05-30 20:35:44 -0700 (Mon, 30 May 2016)

Log Message

Move CrossThreadCopier/CrossThreadTask to WTF.
https://bugs.webkit.org/show_bug.cgi?id=158207

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (Refactor, no behavior change).

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:

* Modules/indexeddb/IDBActiveDOMObject.h:
* Modules/indexeddb/IDBValue.cpp:
* Modules/indexeddb/client/IDBConnectionProxy.h:
* Modules/indexeddb/server/IDBServer.cpp:
* Modules/indexeddb/server/IDBServer.h:
* Modules/indexeddb/server/UniqueIDBDatabase.h:
* dom/ScriptExecutionContext.h:
* fileapi/ThreadableBlobRegistry.cpp:

* platform/WebCoreCrossThreadCopier.cpp: Added.
(WTF::WebCore::SessionID>::copy):
(WTF::WebCore::ThreadSafeDataBuffer>::copy):
* platform/WebCoreCrossThreadCopier.h: Added.

* platform/network/cf/ResourceError.h:
(WebCore::ResourceError::isolatedCopy):

* platform/network/cf/ResourceRequest.h:
(WebCore::ResourceRequest::isolatedCopy):

* platform/network/cf/ResourceResponse.h:
(WebCore::ResourceResponse::isolatedCopy):

Source/WebKit2:

* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:

* DatabaseProcess/DatabaseProcess.cpp:
* DatabaseProcess/DatabaseProcess.h:

* Shared/WebCrossThreadCopier.cpp: Removed.
* Shared/WebCrossThreadCopier.h: Removed.

Source/WTF:

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:

* wtf/CrossThreadCopier.cpp: Renamed from Source/WebCore/platform/CrossThreadCopier.cpp.
* wtf/CrossThreadCopier.h: Renamed from Source/WebCore/platform/CrossThreadCopier.h.
(WTF::CrossThreadCopierPassThrough::copy):

* wtf/CrossThreadTask.h: Renamed from Source/WebCore/platform/CrossThreadTask.h.
(WTF::CrossThreadTask::CrossThreadTask):
(WTF::CrossThreadTask::performTask):
(WTF::createCrossThreadTask):

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (201503 => 201504)


--- trunk/Source/WTF/ChangeLog	2016-05-31 03:25:40 UTC (rev 201503)
+++ trunk/Source/WTF/ChangeLog	2016-05-31 03:35:44 UTC (rev 201504)
@@ -1,3 +1,22 @@
+2016-05-30  Brady Eidson  <beid...@apple.com>
+
+        Move CrossThreadCopier/CrossThreadTask to WTF.
+        https://bugs.webkit.org/show_bug.cgi?id=158207
+
+        Reviewed by Alex Christensen.
+
+        * WTF.xcodeproj/project.pbxproj:
+        * wtf/CMakeLists.txt:
+
+        * wtf/CrossThreadCopier.cpp: Renamed from Source/WebCore/platform/CrossThreadCopier.cpp.
+        * wtf/CrossThreadCopier.h: Renamed from Source/WebCore/platform/CrossThreadCopier.h.
+        (WTF::CrossThreadCopierPassThrough::copy):
+        
+        * wtf/CrossThreadTask.h: Renamed from Source/WebCore/platform/CrossThreadTask.h.
+        (WTF::CrossThreadTask::CrossThreadTask):
+        (WTF::CrossThreadTask::performTask):
+        (WTF::createCrossThreadTask):
+
 2016-05-28  Chris Dumez  <cdu...@apple.com>
 
         Templatize NoncopyableFunction class similarly to std::function

Modified: trunk/Source/WTF/WTF.xcodeproj/project.pbxproj (201503 => 201504)


--- trunk/Source/WTF/WTF.xcodeproj/project.pbxproj	2016-05-31 03:25:40 UTC (rev 201503)
+++ trunk/Source/WTF/WTF.xcodeproj/project.pbxproj	2016-05-31 03:35:44 UTC (rev 201504)
@@ -101,6 +101,9 @@
 		2CDED0F418115C85004DBA70 /* RunLoop.h in Headers */ = {isa = PBXBuildFile; fileRef = 2CDED0F218115C85004DBA70 /* RunLoop.h */; };
 		430B47891AAAAC1A001223DA /* StringCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 430B47871AAAAC1A001223DA /* StringCommon.h */; };
 		513E170B1CD7D5BF00E3650B /* LoggingAccumulator.h in Headers */ = {isa = PBXBuildFile; fileRef = 513E170A1CD7D5BF00E3650B /* LoggingAccumulator.h */; };
+		515F794E1CFC9F4A00CCED93 /* CrossThreadCopier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 515F794B1CFC9F4A00CCED93 /* CrossThreadCopier.cpp */; };
+		515F794F1CFC9F4A00CCED93 /* CrossThreadCopier.h in Headers */ = {isa = PBXBuildFile; fileRef = 515F794C1CFC9F4A00CCED93 /* CrossThreadCopier.h */; };
+		515F79501CFC9F4A00CCED93 /* CrossThreadTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 515F794D1CFC9F4A00CCED93 /* CrossThreadTask.h */; };
 		553071CA1C40427200384898 /* TinyLRUCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 553071C91C40427200384898 /* TinyLRUCache.h */; };
 		70A993FE1AD7151300FA615B /* SymbolRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 70A993FC1AD7151300FA615B /* SymbolRegistry.cpp */; };
 		70A993FF1AD7151300FA615B /* SymbolRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 70A993FD1AD7151300FA615B /* SymbolRegistry.h */; };
@@ -420,6 +423,9 @@
 		2CDED0F218115C85004DBA70 /* RunLoop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RunLoop.h; sourceTree = "<group>"; };
 		430B47871AAAAC1A001223DA /* StringCommon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringCommon.h; sourceTree = "<group>"; };
 		513E170A1CD7D5BF00E3650B /* LoggingAccumulator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoggingAccumulator.h; sourceTree = "<group>"; };
+		515F794B1CFC9F4A00CCED93 /* CrossThreadCopier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CrossThreadCopier.cpp; sourceTree = "<group>"; };
+		515F794C1CFC9F4A00CCED93 /* CrossThreadCopier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CrossThreadCopier.h; sourceTree = "<group>"; };
+		515F794D1CFC9F4A00CCED93 /* CrossThreadTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CrossThreadTask.h; sourceTree = "<group>"; };
 		553071C91C40427200384898 /* TinyLRUCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TinyLRUCache.h; sourceTree = "<group>"; };
 		5D247B6214689B8600E78B76 /* libWTF.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libWTF.a; sourceTree = BUILT_PRODUCTS_DIR; };
 		5D247B6E14689C4700E78B76 /* Base.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Base.xcconfig; sourceTree = "<group>"; };
@@ -797,6 +803,9 @@
 				0F8F2B90172E00F0007DBDA5 /* CompilationThread.h */,
 				A8A47270151A825A004123FF /* Compiler.h */,
 				0FDB698D1B7C643A000C1078 /* Condition.h */,
+				515F794B1CFC9F4A00CCED93 /* CrossThreadCopier.cpp */,
+				515F794C1CFC9F4A00CCED93 /* CrossThreadCopier.h */,
+				515F794D1CFC9F4A00CCED93 /* CrossThreadTask.h */,
 				A8A47273151A825A004123FF /* CryptographicallyRandomNumber.cpp */,
 				A8A47274151A825A004123FF /* CryptographicallyRandomNumber.h */,
 				E15556F318A0CC18006F48FB /* CryptographicUtilities.cpp */,
@@ -1247,6 +1256,7 @@
 				0FE1646B1B6FFC9600400E7C /* Lock.h in Headers */,
 				A8A473E3151A825B004123FF /* Locker.h in Headers */,
 				A8A473E6151A825B004123FF /* MainThread.h in Headers */,
+				515F794F1CFC9F4A00CCED93 /* CrossThreadCopier.h in Headers */,
 				1A233C7D17DAA6E300A93ACF /* MallocPtr.h in Headers */,
 				A8A473E8151A825B004123FF /* MathExtras.h in Headers */,
 				A8A473EA151A825B004123FF /* MD5.h in Headers */,
@@ -1294,6 +1304,7 @@
 				86F46F611A2840EE00CCBF22 /* RefCounter.h in Headers */,
 				A8A4741C151A825B004123FF /* RefPtr.h in Headers */,
 				A8A4741E151A825B004123FF /* RetainPtr.h in Headers */,
+				515F79501CFC9F4A00CCED93 /* CrossThreadTask.h in Headers */,
 				2CDED0F418115C85004DBA70 /* RunLoop.h in Headers */,
 				1469419216EAAF6D0024E146 /* RunLoopTimer.h in Headers */,
 				A5098B001C169E0700087797 /* SandboxSPI.h in Headers */,
@@ -1521,6 +1532,7 @@
 				A748745217A0BDAE00FA04CB /* SixCharacterHash.cpp in Sources */,
 				A8A47425151A825B004123FF /* SizeLimits.cpp in Sources */,
 				A8A47427151A825B004123FF /* StackBounds.cpp in Sources */,
+				515F794E1CFC9F4A00CCED93 /* CrossThreadCopier.cpp in Sources */,
 				FEDACD3D1630F83F00C69634 /* StackStats.cpp in Sources */,
 				A8A4743C151A825B004123FF /* StringBuilder.cpp in Sources */,
 				A5BA15FB182435A600A82E69 /* StringCF.cpp in Sources */,

Modified: trunk/Source/WTF/wtf/CMakeLists.txt (201503 => 201504)


--- trunk/Source/WTF/wtf/CMakeLists.txt	2016-05-31 03:25:40 UTC (rev 201503)
+++ trunk/Source/WTF/wtf/CMakeLists.txt	2016-05-31 03:35:44 UTC (rev 201504)
@@ -13,6 +13,8 @@
     CompilationThread.h
     Compiler.h
     Condition.h
+    CrossThreadCopier.h
+    CrossThreadTask.h
     CryptographicUtilities.h
     CryptographicallyRandomNumber.h
     CurrentTime.h
@@ -159,6 +161,7 @@
     Atomics.cpp
     BitVector.cpp
     CompilationThread.cpp
+    CrossThreadCopier.cpp
     CryptographicUtilities.cpp
     CryptographicallyRandomNumber.cpp
     CurrentTime.cpp

Copied: trunk/Source/WTF/wtf/CrossThreadCopier.cpp (from rev 201503, trunk/Source/WebCore/platform/CrossThreadCopier.cpp) (0 => 201504)


--- trunk/Source/WTF/wtf/CrossThreadCopier.cpp	                        (rev 0)
+++ trunk/Source/WTF/wtf/CrossThreadCopier.cpp	2016-05-31 03:35:44 UTC (rev 201504)
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ * Copyright (C) 2011-2016 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:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * 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.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * OWNER OR 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 "config.h"
+#include "CrossThreadCopier.h"
+
+namespace WTF {
+
+// Test CrossThreadCopier using COMPILE_ASSERT.
+
+// Verify that ThreadSafeRefCounted objects get handled correctly.
+class CopierThreadSafeRefCountedTest : public ThreadSafeRefCounted<CopierThreadSafeRefCountedTest> {
+};
+
+COMPILE_ASSERT((std::is_same<
+                    PassRefPtr<CopierThreadSafeRefCountedTest>,
+                    CrossThreadCopier<PassRefPtr<CopierThreadSafeRefCountedTest>>::Type
+                >::value),
+                PassRefPtrTest);
+COMPILE_ASSERT((std::is_same<
+                    PassRefPtr<CopierThreadSafeRefCountedTest>,
+                    CrossThreadCopier<RefPtr<CopierThreadSafeRefCountedTest>>::Type
+                >::value),
+                RefPtrTest);
+COMPILE_ASSERT((std::is_same<
+                    PassRefPtr<CopierThreadSafeRefCountedTest>,
+                    CrossThreadCopier<CopierThreadSafeRefCountedTest*>::Type
+                >::value),
+                RawPointerTest);
+
+// Add specializations for RefCounted types which will let us verify that no other template matches.
+template<typename T> struct CrossThreadCopierBase<false, false, RefPtr<T>> {
+    typedef int Type;
+};
+
+template<typename T> struct CrossThreadCopierBase<false, false, PassRefPtr<T>> {
+    typedef int Type;
+};
+
+template<typename T> struct CrossThreadCopierBase<false, false, T*> {
+    typedef int Type;
+};
+
+// Verify that RefCounted objects only match the above templates which expose Type as int.
+class CopierRefCountedTest : public RefCounted<CopierRefCountedTest> {
+};
+
+static_assert((std::is_same<int, CrossThreadCopier<PassRefPtr<CopierRefCountedTest>>::Type>::value), "CrossThreadCopier specialization improperly applied to PassRefPtr<> of a RefCounted (but not ThreadSafeRefCounted) type");
+static_assert((std::is_same<int, CrossThreadCopier<RefPtr<CopierRefCountedTest>>::Type>::value), "CrossThreadCopier specialization improperly applied to RefPtr<> of a RefCounted (but not ThreadSafeRefCounted) type");
+static_assert((std::is_same<int, CrossThreadCopier<CopierRefCountedTest*>::Type>::value), "CrossThreadCopier specialization improperly applied to raw pointer of a RefCounted (but not ThreadSafeRefCounted) type");
+
+} // namespace WTF

Copied: trunk/Source/WTF/wtf/CrossThreadCopier.h (from rev 201503, trunk/Source/WebCore/platform/CrossThreadCopier.h) (0 => 201504)


--- trunk/Source/WTF/wtf/CrossThreadCopier.h	                        (rev 0)
+++ trunk/Source/WTF/wtf/CrossThreadCopier.h	2016-05-31 03:35:44 UTC (rev 201504)
@@ -0,0 +1,139 @@
+/*
+ * Copyright (C) 2009, 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2014, 2015, 2016 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:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * 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.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * OWNER OR 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.
+ */
+
+#pragma once
+
+#include <wtf/Assertions.h>
+#include <wtf/Forward.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>
+#include <wtf/Threading.h>
+#include <wtf/text/WTFString.h>
+
+namespace WTF {
+
+struct CrossThreadCopierBaseHelper {
+    template<typename T> struct RemovePointer {
+        typedef T Type;
+    };
+    template<typename T> struct RemovePointer<T*> {
+        typedef T Type;
+    };
+
+    template<typename T> struct RemovePointer<RefPtr<T>> {
+        typedef T Type;
+    };
+
+    template<typename T> struct RemovePointer<PassRefPtr<T>> {
+        typedef T Type;
+    };
+
+    template<typename T> struct IsEnumOrConvertibleToInteger {
+        static const bool value = std::is_integral<T>::value || std::is_enum<T>::value || std::is_convertible<T, long double>::value;
+    };
+
+    template<typename T> struct IsThreadSafeRefCountedPointer {
+        static const bool value = std::is_convertible<typename RemovePointer<T>::Type*, ThreadSafeRefCounted<typename RemovePointer<T>::Type>*>::value;
+    };
+};
+
+template<typename T> struct CrossThreadCopierPassThrough {
+    typedef T Type;
+    static Type copy(const T& parameter)
+    {
+        return parameter;
+    }
+};
+
+template<bool isEnumOrConvertibleToInteger, bool isThreadSafeRefCounted, typename T> struct CrossThreadCopierBase;
+
+// Integers get passed through without any changes.
+template<typename T> struct CrossThreadCopierBase<true, false, T> : public CrossThreadCopierPassThrough<T> {
+};
+
+// Classes that have an isolatedCopy() method get a default specialization.
+template<class T> struct CrossThreadCopierBase<false, false, T> {
+    static T copy(const T& value)
+    {
+        return value.isolatedCopy();
+    }
+};
+
+// Custom copy methods.
+template<typename T> struct CrossThreadCopierBase<false, true, T> {
+    typedef typename CrossThreadCopierBaseHelper::RemovePointer<T>::Type RefCountedType;
+    static_assert(std::is_convertible<RefCountedType*, ThreadSafeRefCounted<RefCountedType>*>::value, "T is not convertible to ThreadSafeRefCounted!");
+
+    typedef PassRefPtr<RefCountedType> Type;
+    static Type copy(const T& refPtr)
+    {
+        return refPtr;
+    }
+};
+
+template<> struct CrossThreadCopierBase<false, false, std::chrono::system_clock::time_point> {
+    typedef std::chrono::system_clock::time_point Type;
+    static Type copy(const Type& source)
+    {
+        return source;
+    }
+};
+
+template<> struct CrossThreadCopierBase<false, false, WTF::ASCIILiteral> {
+    typedef WTF::ASCIILiteral Type;
+    static Type copy(const Type& source)
+    {
+        return source;
+    }
+};
+
+template<typename T>
+struct CrossThreadCopier : public CrossThreadCopierBase<CrossThreadCopierBaseHelper::IsEnumOrConvertibleToInteger<T>::value, CrossThreadCopierBaseHelper::IsThreadSafeRefCountedPointer<T>::value, T> {
+};
+
+// Default specialization for Vectors of CrossThreadCopyable classes.
+template<typename T> struct CrossThreadCopierBase<false, false, Vector<T>> {
+    typedef Vector<T> Type;
+    static Type copy(const Type& source)
+    {
+        Type destination;
+        destination.reserveInitialCapacity(source.size());
+        for (auto& object : source)
+            destination.uncheckedAppend(CrossThreadCopier<T>::copy(object));
+        return destination;
+    }
+};
+
+} // namespace WTF
+
+using WTF::CrossThreadCopierBaseHelper;
+using WTF::CrossThreadCopierBase;
+using WTF::CrossThreadCopier;

Copied: trunk/Source/WTF/wtf/CrossThreadTask.h (from rev 201503, trunk/Source/WebCore/platform/CrossThreadTask.h) (0 => 201504)


--- trunk/Source/WTF/wtf/CrossThreadTask.h	                        (rev 0)
+++ trunk/Source/WTF/wtf/CrossThreadTask.h	2016-05-31 03:35:44 UTC (rev 201504)
@@ -0,0 +1,253 @@
+/*
+ * Copyright (C) 2013, 2015, 2016 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.
+ */
+
+#pragma once
+
+#include <wtf/CrossThreadCopier.h>
+#include <wtf/NoncopyableFunction.h>
+
+namespace WTF {
+
+class CrossThreadTask {
+    WTF_MAKE_NONCOPYABLE(CrossThreadTask);
+public:
+    CrossThreadTask(NoncopyableFunction<void ()>&& taskFunction)
+        : m_taskFunction(WTFMove(taskFunction))
+    {
+        ASSERT(taskFunction);
+    }
+
+    void performTask()
+    {
+        m_taskFunction();
+    }
+
+protected:
+    CrossThreadTask() { }
+
+    NoncopyableFunction<void ()> m_taskFunction;
+};
+
+template <typename T, typename... Arguments>
+class CrossThreadTaskImpl final : public CrossThreadTask {
+public:
+    CrossThreadTaskImpl(T* callee, void (T::*method)(Arguments...), Arguments&&... arguments)
+    {
+        m_taskFunction = [callee, method, arguments...] {
+            (callee->*method)(arguments...);
+        };
+    }
+};
+
+template <typename... Arguments>
+class CrossThreadTaskStaticImpl final : public CrossThreadTask {
+public:
+    CrossThreadTaskStaticImpl(void (*method)(Arguments...), Arguments&&... arguments)
+    {
+        m_taskFunction = [method, arguments...] {
+            method(arguments...);
+        };
+    }
+};
+
+template<typename T>
+std::unique_ptr<CrossThreadTask> createCrossThreadTask(
+    T& callee,
+    void (T::*method)())
+{
+    return std::make_unique<CrossThreadTaskImpl<T>>(&callee, method);
+}
+
+template<typename T, typename P1, typename MP1>
+std::unique_ptr<CrossThreadTask> createCrossThreadTask(
+    T& callee,
+    void (T::*method)(MP1),
+    const P1& parameter1)
+{
+    return std::make_unique<CrossThreadTaskImpl<T, MP1>>(
+        &callee,
+        method,
+        WTF::CrossThreadCopier<P1>::copy(parameter1));
+}
+
+template<typename T, typename P1, typename MP1, typename P2, typename MP2>
+std::unique_ptr<CrossThreadTask> createCrossThreadTask(
+    T& callee,
+    void (T::*method)(MP1, MP2),
+    const P1& parameter1,
+    const P2& parameter2)
+{
+    return std::make_unique<CrossThreadTaskImpl<T, MP1, MP2>>(
+        &callee,
+        method,
+        WTF::CrossThreadCopier<P1>::copy(parameter1),
+        WTF::CrossThreadCopier<P2>::copy(parameter2));
+
+}
+
+template<typename T, typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3>
+std::unique_ptr<CrossThreadTask> createCrossThreadTask(
+    T& callee,
+    void (T::*method)(MP1, MP2, MP3),
+    const P1& parameter1,
+    const P2& parameter2,
+    const P3& parameter3)
+{
+    return std::make_unique<CrossThreadTaskImpl<T, MP1, MP2, MP3>>(
+        &callee,
+        method,
+        WTF::CrossThreadCopier<P1>::copy(parameter1),
+        WTF::CrossThreadCopier<P2>::copy(parameter2),
+        WTF::CrossThreadCopier<P3>::copy(parameter3));
+}
+
+template<typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3>
+std::unique_ptr<CrossThreadTask> createCrossThreadTask(
+    void (*method)(MP1, MP2, MP3),
+    const P1& parameter1,
+    const P2& parameter2,
+    const P3& parameter3)
+{
+    return std::make_unique<CrossThreadTaskStaticImpl<MP1, MP2, MP3>>(
+        method,
+        WTF::CrossThreadCopier<P1>::copy(parameter1),
+        WTF::CrossThreadCopier<P2>::copy(parameter2),
+        WTF::CrossThreadCopier<P3>::copy(parameter3));
+}
+
+template<typename T, typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3, typename P4, typename MP4>
+std::unique_ptr<CrossThreadTask> createCrossThreadTask(
+    T& callee,
+    void (T::*method)(MP1, MP2, MP3, MP4),
+    const P1& parameter1,
+    const P2& parameter2,
+    const P3& parameter3,
+    const P4& parameter4)
+{
+    return std::make_unique<CrossThreadTaskImpl<T, MP1, MP2, MP3, MP4>>(
+        &callee,
+        method,
+        WTF::CrossThreadCopier<P1>::copy(parameter1),
+        WTF::CrossThreadCopier<P2>::copy(parameter2),
+        WTF::CrossThreadCopier<P3>::copy(parameter3),
+        WTF::CrossThreadCopier<P4>::copy(parameter4));
+}
+
+template<typename T, typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3, typename P4, typename MP4, typename P5, typename MP5>
+std::unique_ptr<CrossThreadTask> createCrossThreadTask(
+    T& callee,
+    void (T::*method)(MP1, MP2, MP3, MP4, MP5),
+    const P1& parameter1,
+    const P2& parameter2,
+    const P3& parameter3,
+    const P4& parameter4,
+    const P5& parameter5)
+{
+    return std::make_unique<CrossThreadTaskImpl<T, MP1, MP2, MP3, MP4, MP5>>(
+        &callee,
+        method,
+        WTF::CrossThreadCopier<P1>::copy(parameter1),
+        WTF::CrossThreadCopier<P2>::copy(parameter2),
+        WTF::CrossThreadCopier<P3>::copy(parameter3),
+        WTF::CrossThreadCopier<P4>::copy(parameter4),
+        WTF::CrossThreadCopier<P5>::copy(parameter5));
+}
+
+template<typename T, typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3, typename P4, typename MP4, typename P5, typename MP5, typename P6, typename MP6>
+std::unique_ptr<CrossThreadTask> createCrossThreadTask(
+    T& callee,
+    void (T::*method)(MP1, MP2, MP3, MP4, MP5, MP6),
+    const P1& parameter1,
+    const P2& parameter2,
+    const P3& parameter3,
+    const P4& parameter4,
+    const P5& parameter5,
+    const P6& parameter6)
+{
+    return std::make_unique<CrossThreadTaskImpl<T, MP1, MP2, MP3, MP4, MP5, MP6>>(
+        &callee,
+        method,
+        WTF::CrossThreadCopier<P1>::copy(parameter1),
+        WTF::CrossThreadCopier<P2>::copy(parameter2),
+        WTF::CrossThreadCopier<P3>::copy(parameter3),
+        WTF::CrossThreadCopier<P4>::copy(parameter4),
+        WTF::CrossThreadCopier<P5>::copy(parameter5),
+        WTF::CrossThreadCopier<P6>::copy(parameter6));
+}
+
+template<typename T, typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3, typename P4, typename MP4, typename P5, typename MP5, typename P6, typename MP6, typename P7, typename MP7>
+std::unique_ptr<CrossThreadTask> createCrossThreadTask(
+    T& callee,
+    void (T::*method)(MP1, MP2, MP3, MP4, MP5, MP6, MP7),
+    const P1& parameter1,
+    const P2& parameter2,
+    const P3& parameter3,
+    const P4& parameter4,
+    const P5& parameter5,
+    const P6& parameter6,
+    const P7& parameter7)
+{
+    return std::make_unique<CrossThreadTaskImpl<T, MP1, MP2, MP3, MP4, MP5, MP6, MP7>>(
+        &callee,
+        method,
+        WTF::CrossThreadCopier<P1>::copy(parameter1),
+        WTF::CrossThreadCopier<P2>::copy(parameter2),
+        WTF::CrossThreadCopier<P3>::copy(parameter3),
+        WTF::CrossThreadCopier<P4>::copy(parameter4),
+        WTF::CrossThreadCopier<P5>::copy(parameter5),
+        WTF::CrossThreadCopier<P6>::copy(parameter6),
+        WTF::CrossThreadCopier<P7>::copy(parameter7));
+}
+
+template<typename T, typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3, typename P4, typename MP4, typename P5, typename MP5, typename P6, typename MP6, typename P7, typename MP7, typename P8, typename MP8>
+std::unique_ptr<CrossThreadTask> createCrossThreadTask(
+    T& callee,
+    void (T::*method)(MP1, MP2, MP3, MP4, MP5, MP6, MP7, MP8),
+    const P1& parameter1,
+    const P2& parameter2,
+    const P3& parameter3,
+    const P4& parameter4,
+    const P5& parameter5,
+    const P6& parameter6,
+    const P7& parameter7,
+    const P8& parameter8)
+{
+    return std::make_unique<CrossThreadTaskImpl<T, MP1, MP2, MP3, MP4, MP5, MP6, MP7, MP8>>(
+        &callee,
+        method,
+        WTF::CrossThreadCopier<P1>::copy(parameter1),
+        WTF::CrossThreadCopier<P2>::copy(parameter2),
+        WTF::CrossThreadCopier<P3>::copy(parameter3),
+        WTF::CrossThreadCopier<P4>::copy(parameter4),
+        WTF::CrossThreadCopier<P5>::copy(parameter5),
+        WTF::CrossThreadCopier<P6>::copy(parameter6),
+        WTF::CrossThreadCopier<P7>::copy(parameter7),
+        WTF::CrossThreadCopier<P8>::copy(parameter8));
+}
+
+} // namespace WTF
+
+using WTF::CrossThreadTask;
+using WTF::createCrossThreadTask;

Modified: trunk/Source/WebCore/CMakeLists.txt (201503 => 201504)


--- trunk/Source/WebCore/CMakeLists.txt	2016-05-31 03:25:40 UTC (rev 201503)
+++ trunk/Source/WebCore/CMakeLists.txt	2016-05-31 03:35:44 UTC (rev 201504)
@@ -2097,7 +2097,6 @@
     platform/ContentType.cpp
     platform/ContextMenu.cpp
     platform/ContextMenuItem.cpp
-    platform/CrossThreadCopier.cpp
     platform/Cursor.cpp
     platform/DateComponents.cpp
     platform/Decimal.cpp
@@ -2142,6 +2141,7 @@
     platform/URL.cpp
     platform/UUID.cpp
     platform/UserActivity.cpp
+    platform/WebCoreCrossThreadCopier.cpp
     platform/Widget.cpp
 
     platform/animation/Animation.cpp

Modified: trunk/Source/WebCore/ChangeLog (201503 => 201504)


--- trunk/Source/WebCore/ChangeLog	2016-05-31 03:25:40 UTC (rev 201503)
+++ trunk/Source/WebCore/ChangeLog	2016-05-31 03:35:44 UTC (rev 201504)
@@ -1,3 +1,38 @@
+2016-05-30  Brady Eidson  <beid...@apple.com>
+
+        Move CrossThreadCopier/CrossThreadTask to WTF.
+        https://bugs.webkit.org/show_bug.cgi?id=158207
+
+        Reviewed by Alex Christensen.
+
+        No new tests (Refactor, no behavior change).
+
+        * CMakeLists.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+
+        * Modules/indexeddb/IDBActiveDOMObject.h:
+        * Modules/indexeddb/IDBValue.cpp:
+        * Modules/indexeddb/client/IDBConnectionProxy.h:
+        * Modules/indexeddb/server/IDBServer.cpp:
+        * Modules/indexeddb/server/IDBServer.h:
+        * Modules/indexeddb/server/UniqueIDBDatabase.h:
+        * dom/ScriptExecutionContext.h:
+        * fileapi/ThreadableBlobRegistry.cpp:
+        
+        * platform/WebCoreCrossThreadCopier.cpp: Added.
+        (WTF::WebCore::SessionID>::copy):
+        (WTF::WebCore::ThreadSafeDataBuffer>::copy):
+        * platform/WebCoreCrossThreadCopier.h: Added.
+        
+        * platform/network/cf/ResourceError.h:
+        (WebCore::ResourceError::isolatedCopy):
+        
+        * platform/network/cf/ResourceRequest.h:
+        (WebCore::ResourceRequest::isolatedCopy):
+        
+        * platform/network/cf/ResourceResponse.h:
+        (WebCore::ResourceResponse::isolatedCopy):
+
 2016-05-30  Per Arne Vollan  <pvol...@apple.com>
 
         http/tests/websocket/tests/hybi/stop-on-resume-in-error-handler.html crashes on Windows almost all the time

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBActiveDOMObject.h (201503 => 201504)


--- trunk/Source/WebCore/Modules/indexeddb/IDBActiveDOMObject.h	2016-05-31 03:25:40 UTC (rev 201503)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBActiveDOMObject.h	2016-05-31 03:35:44 UTC (rev 201504)
@@ -26,8 +26,8 @@
 #pragma once
 
 #include "ActiveDOMObject.h"
-#include "CrossThreadCopier.h"
 #include "ScriptExecutionContext.h"
+#include <wtf/CrossThreadTask.h>
 #include <wtf/MainThread.h>
 #include <wtf/Threading.h>
 

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBValue.cpp (201503 => 201504)


--- trunk/Source/WebCore/Modules/indexeddb/IDBValue.cpp	2016-05-31 03:25:40 UTC (rev 201503)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBValue.cpp	2016-05-31 03:35:44 UTC (rev 201504)
@@ -28,8 +28,8 @@
 
 #if ENABLE(INDEXED_DATABASE)
 
-#include "CrossThreadCopier.h"
 #include "SerializedScriptValue.h"
+#include <wtf/CrossThreadTask.h>
 
 namespace WebCore {
 

Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.h (201503 => 201504)


--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.h	2016-05-31 03:25:40 UTC (rev 201503)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.h	2016-05-31 03:35:44 UTC (rev 201504)
@@ -27,11 +27,11 @@
 
 #if ENABLE(INDEXED_DATABASE)
 
-#include "CrossThreadTask.h"
 #include "IDBConnectionToServer.h"
 #include "IDBResourceIdentifier.h"
 #include "TransactionOperation.h"
 #include <functional>
+#include <wtf/CrossThreadTask.h>
 #include <wtf/HashMap.h>
 #include <wtf/MainThread.h>
 #include <wtf/MessageQueue.h>

Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp (201503 => 201504)


--- trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp	2016-05-31 03:25:40 UTC (rev 201503)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp	2016-05-31 03:35:44 UTC (rev 201504)
@@ -28,7 +28,6 @@
 
 #if ENABLE(INDEXED_DATABASE)
 
-#include "CrossThreadCopier.h"
 #include "IDBRequestData.h"
 #include "IDBResultData.h"
 #include "Logging.h"
@@ -36,6 +35,7 @@
 #include "SQLiteFileSystem.h"
 #include "SQLiteIDBBackingStore.h"
 #include "SecurityOrigin.h"
+#include <wtf/CrossThreadCopier.h>
 #include <wtf/Locker.h>
 #include <wtf/MainThread.h>
 

Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h (201503 => 201504)


--- trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h	2016-05-31 03:25:40 UTC (rev 201503)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h	2016-05-31 03:35:44 UTC (rev 201504)
@@ -27,11 +27,11 @@
 
 #if ENABLE(INDEXED_DATABASE)
 
-#include "CrossThreadTask.h"
 #include "IDBConnectionToClient.h"
 #include "IDBDatabaseIdentifier.h"
 #include "UniqueIDBDatabase.h"
 #include "UniqueIDBDatabaseConnection.h"
+#include <wtf/CrossThreadTask.h>
 #include <wtf/HashMap.h>
 #include <wtf/Lock.h>
 #include <wtf/MessageQueue.h>
@@ -41,7 +41,6 @@
 
 namespace WebCore {
 
-class CrossThreadTask;
 class IDBCursorInfo;
 class IDBRequestData;
 class IDBValue;

Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h (201503 => 201504)


--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h	2016-05-31 03:25:40 UTC (rev 201503)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h	2016-05-31 03:35:44 UTC (rev 201504)
@@ -27,7 +27,6 @@
 
 #if ENABLE(INDEXED_DATABASE)
 
-#include "CrossThreadTask.h"
 #include "IDBBackingStore.h"
 #include "IDBBindingUtilities.h"
 #include "IDBDatabaseIdentifier.h"
@@ -38,6 +37,7 @@
 #include "Timer.h"
 #include "UniqueIDBDatabaseConnection.h"
 #include "UniqueIDBDatabaseTransaction.h"
+#include <wtf/CrossThreadTask.h>
 #include <wtf/Deque.h>
 #include <wtf/HashCountedSet.h>
 #include <wtf/HashSet.h>

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (201503 => 201504)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2016-05-31 03:25:40 UTC (rev 201503)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2016-05-31 03:35:44 UTC (rev 201504)
@@ -1251,8 +1251,6 @@
 		2E4346530F546A8200B0F1BA /* WorkerRunLoop.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E4346410F546A8200B0F1BA /* WorkerRunLoop.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		2E4346540F546A8200B0F1BA /* WorkerThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E4346420F546A8200B0F1BA /* WorkerThread.cpp */; };
 		2E4346550F546A8200B0F1BA /* WorkerThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E4346430F546A8200B0F1BA /* WorkerThread.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		2E4346580F546A9900B0F1BA /* CrossThreadCopier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E4346560F546A9900B0F1BA /* CrossThreadCopier.cpp */; };
-		2E4346590F546A9900B0F1BA /* CrossThreadCopier.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E4346570F546A9900B0F1BA /* CrossThreadCopier.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		2E7582EE12764F260062628B /* JSFileReaderCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E7582ED12764F260062628B /* JSFileReaderCustom.cpp */; };
 		2E75841D12779ADA0062628B /* FileReaderLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E75841A12779ADA0062628B /* FileReaderLoader.cpp */; };
 		2E75841E12779ADA0062628B /* FileReaderLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E75841B12779ADA0062628B /* FileReaderLoader.h */; };
@@ -2038,6 +2036,8 @@
 		514C767D0CE923A1007EF3CD /* ResourceRequestBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 514C76680CE923A1007EF3CD /* ResourceRequestBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		514C767E0CE923A1007EF3CD /* ResourceResponseBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 514C76690CE923A1007EF3CD /* ResourceResponseBase.cpp */; };
 		514C767F0CE923A1007EF3CD /* ResourceResponseBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 514C766A0CE923A1007EF3CD /* ResourceResponseBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		515F79531CFCA3D000CCED93 /* WebCoreCrossThreadCopier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 515F79511CFCA3C700CCED93 /* WebCoreCrossThreadCopier.cpp */; };
+		515F79541CFCA3D500CCED93 /* WebCoreCrossThreadCopier.h in Headers */ = {isa = PBXBuildFile; fileRef = 515F79521CFCA3C700CCED93 /* WebCoreCrossThreadCopier.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		5160300B0CC4251200C8AC25 /* FileSystemPOSIX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5160300A0CC4251200C8AC25 /* FileSystemPOSIX.cpp */; };
 		5160306C0CC4362300C8AC25 /* FileSystemCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5160306B0CC4362300C8AC25 /* FileSystemCF.cpp */; };
 		5160712E1BD8307800DBC4F2 /* IDBObjectStoreInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5160712C1BD8307200DBC4F2 /* IDBObjectStoreInfo.cpp */; };
@@ -2221,7 +2221,6 @@
 		51E3F9D60DA05E1D00250911 /* JSStorage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51E3F9D40DA05E1D00250911 /* JSStorage.cpp */; };
 		51E4143416A6596300C633C7 /* ResourceHandleTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E4143216A6595100C633C7 /* ResourceHandleTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		51E6821016387302003BBF3C /* LoaderStrategy.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E6820F16387302003BBF3C /* LoaderStrategy.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		51E6FA7C1BBB4FC3008700D9 /* CrossThreadTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E6FA7B1BBB4FB5008700D9 /* CrossThreadTask.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		51EC92650CE90DD400F90308 /* JSCustomSQLStatementErrorCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51EC925D0CE90DD400F90308 /* JSCustomSQLStatementErrorCallback.cpp */; };
 		51EE7B381AA50B0500F92B21 /* ResourceLoadInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 51EE7B371AA50B0500F92B21 /* ResourceLoadInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		51EE7B3A1AA5123100F92B21 /* ResourceLoadInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51EE7B391AA5123100F92B21 /* ResourceLoadInfo.cpp */; };
@@ -8742,8 +8741,6 @@
 		2E4346410F546A8200B0F1BA /* WorkerRunLoop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WorkerRunLoop.h; sourceTree = "<group>"; };
 		2E4346420F546A8200B0F1BA /* WorkerThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WorkerThread.cpp; sourceTree = "<group>"; };
 		2E4346430F546A8200B0F1BA /* WorkerThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WorkerThread.h; sourceTree = "<group>"; };
-		2E4346560F546A9900B0F1BA /* CrossThreadCopier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CrossThreadCopier.cpp; sourceTree = "<group>"; };
-		2E4346570F546A9900B0F1BA /* CrossThreadCopier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CrossThreadCopier.h; sourceTree = "<group>"; };
 		2E7582ED12764F260062628B /* JSFileReaderCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFileReaderCustom.cpp; sourceTree = "<group>"; };
 		2E75841A12779ADA0062628B /* FileReaderLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileReaderLoader.cpp; sourceTree = "<group>"; };
 		2E75841B12779ADA0062628B /* FileReaderLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileReaderLoader.h; sourceTree = "<group>"; };
@@ -9612,6 +9609,8 @@
 		514C76690CE923A1007EF3CD /* ResourceResponseBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceResponseBase.cpp; sourceTree = "<group>"; };
 		514C766A0CE923A1007EF3CD /* ResourceResponseBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceResponseBase.h; sourceTree = "<group>"; };
 		515E5FEF195101470086CA5E /* PlatformGamepad.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PlatformGamepad.h; sourceTree = "<group>"; };
+		515F79511CFCA3C700CCED93 /* WebCoreCrossThreadCopier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebCoreCrossThreadCopier.cpp; sourceTree = "<group>"; };
+		515F79521CFCA3C700CCED93 /* WebCoreCrossThreadCopier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreCrossThreadCopier.h; sourceTree = "<group>"; };
 		5160300A0CC4251200C8AC25 /* FileSystemPOSIX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileSystemPOSIX.cpp; sourceTree = "<group>"; };
 		5160306B0CC4362300C8AC25 /* FileSystemCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileSystemCF.cpp; sourceTree = "<group>"; };
 		5160712B1BD8305300DBC4F2 /* TransactionOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TransactionOperation.h; sourceTree = "<group>"; };
@@ -9812,7 +9811,6 @@
 		51E3F9D50DA05E1D00250911 /* JSStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSStorage.h; sourceTree = "<group>"; };
 		51E4143216A6595100C633C7 /* ResourceHandleTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceHandleTypes.h; sourceTree = "<group>"; };
 		51E6820F16387302003BBF3C /* LoaderStrategy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoaderStrategy.h; sourceTree = "<group>"; };
-		51E6FA7B1BBB4FB5008700D9 /* CrossThreadTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CrossThreadTask.h; sourceTree = "<group>"; };
 		51EAC5B018163F4E004F1BA4 /* IDBRecordIdentifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBRecordIdentifier.h; sourceTree = "<group>"; };
 		51EC925D0CE90DD400F90308 /* JSCustomSQLStatementErrorCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCustomSQLStatementErrorCallback.cpp; sourceTree = "<group>"; };
 		51EE7B371AA50B0500F92B21 /* ResourceLoadInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLoadInfo.h; sourceTree = "<group>"; };
@@ -22900,9 +22898,6 @@
 				D8B6152E1032495100C8554A /* Cookie.h */,
 				339B5B62131DAA3200F48D02 /* CookiesStrategy.h */,
 				862F129D18C1572C005C54AF /* CountedUserActivity.h */,
-				2E4346560F546A9900B0F1BA /* CrossThreadCopier.cpp */,
-				2E4346570F546A9900B0F1BA /* CrossThreadCopier.h */,
-				51E6FA7B1BBB4FB5008700D9 /* CrossThreadTask.h */,
 				E11AF15011B9A1A300805103 /* Cursor.cpp */,
 				F587868402DE3B8601EA4122 /* Cursor.h */,
 				A5732B08136A161D005C8D7C /* DateComponents.cpp */,
@@ -23046,6 +23041,8 @@
 				9A1142031832D134000BB8AD /* ValueToString.h */,
 				46DB7D581B20FE58005651B2 /* VNodeTracker.cpp */,
 				46DB7D591B20FE58005651B2 /* VNodeTracker.h */,
+				515F79511CFCA3C700CCED93 /* WebCoreCrossThreadCopier.cpp */,
+				515F79521CFCA3C700CCED93 /* WebCoreCrossThreadCopier.h */,
 				9380F47109A11AB4001FDB34 /* Widget.cpp */,
 				9380F47209A11AB4001FDB34 /* Widget.h */,
 				E1E1BEFF115FF6FB006F52CA /* WindowsKeyboardCodes.h */,
@@ -25371,8 +25368,6 @@
 				2D481F02146B5C5500AA7834 /* CrossfadeGeneratedImage.h in Headers */,
 				E1C416120F6562FD0092D2FB /* CrossOriginAccessControl.h in Headers */,
 				E1C415DA0F655D6F0092D2FB /* CrossOriginPreflightResultCache.h in Headers */,
-				2E4346590F546A9900B0F1BA /* CrossThreadCopier.h in Headers */,
-				51E6FA7C1BBB4FC3008700D9 /* CrossThreadTask.h in Headers */,
 				E169803D1133542D00894115 /* CRuntimeObject.h in Headers */,
 				975CA28B130365F800E99AD9 /* Crypto.h in Headers */,
 				E172AF6E180F24C600FBADB9 /* CryptoAlgorithm.h in Headers */,
@@ -28394,6 +28389,7 @@
 				498770F31242C535002226BA /* TilingData.h in Headers */,
 				F55B3DDC1251F12D003EF269 /* TimeInputType.h in Headers */,
 				7553CFE8108F473F00EA281E /* TimelineRecordFactory.h in Headers */,
+				515F79541CFCA3D500CCED93 /* WebCoreCrossThreadCopier.h in Headers */,
 				9305B24D098F1B6B00C28855 /* Timer.h in Headers */,
 				E44613B00CD6331000FADA75 /* TimeRanges.h in Headers */,
 				2D7ED0AB1BAE99170043B3E5 /* TimerEventBasedMock.h in Headers */,
@@ -29295,7 +29291,6 @@
 				2D481F00146B5C4C00AA7834 /* CrossfadeGeneratedImage.cpp in Sources */,
 				E1C416170F6563180092D2FB /* CrossOriginAccessControl.cpp in Sources */,
 				E1C415DE0F655D7C0092D2FB /* CrossOriginPreflightResultCache.cpp in Sources */,
-				2E4346580F546A9900B0F1BA /* CrossThreadCopier.cpp in Sources */,
 				E16980491133644700894115 /* CRuntimeObject.cpp in Sources */,
 				975CA28A130365F800E99AD9 /* Crypto.cpp in Sources */,
 				E172AF6D180F24C600FBADB9 /* CryptoAlgorithm.cpp in Sources */,
@@ -31315,6 +31310,7 @@
 				5A574F24131DB93900471B88 /* RenderQuote.cpp in Sources */,
 				D70AD65713E1342B005B50B4 /* RenderRegion.cpp in Sources */,
 				BCE93F471517C6D5008CCF74 /* RenderRegionSet.cpp in Sources */,
+				515F79531CFCA3D000CCED93 /* WebCoreCrossThreadCopier.cpp in Sources */,
 				A871DFE20A15376B00B12A68 /* RenderReplaced.cpp in Sources */,
 				CD4BE52A1CE136EF009D87DA /* GenericTaskQueue.cpp in Sources */,
 				BCA846D60DC67A350026C309 /* RenderReplica.cpp in Sources */,

Modified: trunk/Source/WebCore/dom/ScriptExecutionContext.h (201503 => 201504)


--- trunk/Source/WebCore/dom/ScriptExecutionContext.h	2016-05-31 03:25:40 UTC (rev 201503)
+++ trunk/Source/WebCore/dom/ScriptExecutionContext.h	2016-05-31 03:35:44 UTC (rev 201504)
@@ -28,12 +28,12 @@
 #pragma once
 
 #include "ActiveDOMObject.h"
-#include "CrossThreadTask.h"
 #include "DOMTimer.h"
 #include "ResourceRequest.h"
 #include "SecurityContext.h"
 #include "Supplementable.h"
 #include <runtime/ConsoleTypes.h>
+#include <wtf/CrossThreadTask.h>
 #include <wtf/HashSet.h>
 #include <wtf/NoncopyableFunction.h>
 

Modified: trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.cpp (201503 => 201504)


--- trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.cpp	2016-05-31 03:25:40 UTC (rev 201503)
+++ trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.cpp	2016-05-31 03:35:44 UTC (rev 201504)
@@ -35,9 +35,9 @@
 #include "BlobPart.h"
 #include "BlobRegistry.h"
 #include "BlobURL.h"
-#include "CrossThreadTask.h"
 #include "SecurityOrigin.h"
 #include <mutex>
+#include <wtf/CrossThreadTask.h>
 #include <wtf/HashMap.h>
 #include <wtf/MainThread.h>
 #include <wtf/MessageQueue.h>

Deleted: trunk/Source/WebCore/platform/CrossThreadCopier.cpp (201503 => 201504)


--- trunk/Source/WebCore/platform/CrossThreadCopier.cpp	2016-05-31 03:25:40 UTC (rev 201503)
+++ trunk/Source/WebCore/platform/CrossThreadCopier.cpp	2016-05-31 03:35:44 UTC (rev 201504)
@@ -1,136 +0,0 @@
-/*
- * Copyright (C) 2009 Google 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:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * 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.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * OWNER OR 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 "config.h"
-
-#include "CrossThreadCopier.h"
-
-#include "URL.h"
-#include "ResourceError.h"
-#include "ResourceRequest.h"
-#include "ResourceResponse.h"
-#include "SecurityOriginData.h"
-#include "SerializedScriptValue.h"
-#include "SessionID.h"
-#include "ThreadSafeDataBuffer.h"
-#include <wtf/Assertions.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-CrossThreadCopierBase<false, false, URL>::Type CrossThreadCopierBase<false, false, URL>::copy(const URL& url)
-{
-    return url.isolatedCopy();
-}
-
-CrossThreadCopierBase<false, false, String>::Type CrossThreadCopierBase<false, false, String>::copy(const String& str)
-{
-    return str.isolatedCopy();
-}
-
-CrossThreadCopierBase<false, false, ResourceError>::Type CrossThreadCopierBase<false, false, ResourceError>::copy(const ResourceError& error)
-{
-    return error.copy();
-}
-
-CrossThreadCopierBase<false, false, ResourceRequest>::Type CrossThreadCopierBase<false, false, ResourceRequest>::copy(const ResourceRequest& request)
-{
-    return request.copyData();
-}
-
-CrossThreadCopierBase<false, false, ResourceResponse>::Type CrossThreadCopierBase<false, false, ResourceResponse>::copy(const ResourceResponse& response)
-{
-    return response.copyData();
-}
-
-CrossThreadCopierBase<false, false, SecurityOriginData>::Type CrossThreadCopierBase<false, false, SecurityOriginData>::copy(const SecurityOriginData& originData)
-{
-    return originData.isolatedCopy();
-}
-
-CrossThreadCopierBase<false, false, SessionID>::Type CrossThreadCopierBase<false, false, SessionID>::copy(const SessionID& sessionID)
-{
-    return sessionID;
-}
-
-CrossThreadCopierBase<false, false, ThreadSafeDataBuffer>::Type CrossThreadCopierBase<false, false, ThreadSafeDataBuffer>::copy(const ThreadSafeDataBuffer& buffer)
-{
-    return ThreadSafeDataBuffer(buffer);
-}
-
-CrossThreadCopierBase<false, false, std::chrono::system_clock::time_point>::Type CrossThreadCopierBase<false, false, std::chrono::system_clock::time_point>::copy(const std::chrono::system_clock::time_point& timePoint)
-{
-    return timePoint;
-}
-
-// Test CrossThreadCopier using COMPILE_ASSERT.
-
-// Verify that ThreadSafeRefCounted objects get handled correctly.
-class CopierThreadSafeRefCountedTest : public ThreadSafeRefCounted<CopierThreadSafeRefCountedTest> {
-};
-
-COMPILE_ASSERT((std::is_same<
-                  PassRefPtr<CopierThreadSafeRefCountedTest>,
-                  CrossThreadCopier<PassRefPtr<CopierThreadSafeRefCountedTest>>::Type
-                  >::value),
-               PassRefPtrTest);
-COMPILE_ASSERT((std::is_same<
-                  PassRefPtr<CopierThreadSafeRefCountedTest>,
-                  CrossThreadCopier<RefPtr<CopierThreadSafeRefCountedTest>>::Type
-                  >::value),
-               RefPtrTest);
-COMPILE_ASSERT((std::is_same<
-                  PassRefPtr<CopierThreadSafeRefCountedTest>,
-                  CrossThreadCopier<CopierThreadSafeRefCountedTest*>::Type
-                  >::value),
-               RawPointerTest);
-
-// Add specializations for RefCounted types which will let us verify that no other template matches.
-template<typename T> struct CrossThreadCopierBase<false, false, RefPtr<T>> {
-    typedef int Type;
-};
-
-template<typename T> struct CrossThreadCopierBase<false, false, PassRefPtr<T>> {
-    typedef int Type;
-};
-
-template<typename T> struct CrossThreadCopierBase<false, false, T*> {
-    typedef int Type;
-};
-
-// Verify that RefCounted objects only match the above templates which expose Type as int.
-class CopierRefCountedTest : public RefCounted<CopierRefCountedTest> {
-};
-
-static_assert((std::is_same<int, CrossThreadCopier<PassRefPtr<CopierRefCountedTest>>::Type>::value), "CrossThreadCopier specialization improperly applied to PassRefPtr<> of a RefCounted (but not ThreadSafeRefCounted) type");
-static_assert((std::is_same<int, CrossThreadCopier<RefPtr<CopierRefCountedTest>>::Type>::value), "CrossThreadCopier specialization improperly applied to RefPtr<> of a RefCounted (but not ThreadSafeRefCounted) type");
-static_assert((std::is_same<int, CrossThreadCopier<CopierRefCountedTest*>::Type>::value), "CrossThreadCopier specialization improperly applied to raw pointer of a RefCounted (but not ThreadSafeRefCounted) type");
-
-} // namespace WebCore

Deleted: trunk/Source/WebCore/platform/CrossThreadCopier.h (201503 => 201504)


--- trunk/Source/WebCore/platform/CrossThreadCopier.h	2016-05-31 03:25:40 UTC (rev 201503)
+++ trunk/Source/WebCore/platform/CrossThreadCopier.h	2016-05-31 03:35:44 UTC (rev 201504)
@@ -1,185 +0,0 @@
-/*
- * Copyright (C) 2009, 2010 Google Inc. All rights reserved.
- * Copyright (C) 2014, 2015, 2016 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:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * 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.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * OWNER OR 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.
- */
-
-#pragma once
-
-#include <wtf/Assertions.h>
-#include <wtf/Forward.h>
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefPtr.h>
-#include <wtf/Threading.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-class IntRect;
-class IntSize;
-class URL;
-class ResourceError;
-class ResourceRequest;
-class ResourceResponse;
-class SessionID;
-class ThreadSafeDataBuffer;
-struct CrossThreadResourceResponseData;
-struct CrossThreadResourceRequestData;
-struct SecurityOriginData;
-struct ThreadableLoaderOptions;
-
-struct CrossThreadCopierBaseHelper {
-    template<typename T> struct RemovePointer {
-        typedef T Type;
-    };
-    template<typename T> struct RemovePointer<T*> {
-        typedef T Type;
-    };
-
-    template<typename T> struct RemovePointer<RefPtr<T>> {
-        typedef T Type;
-    };
-
-    template<typename T> struct RemovePointer<PassRefPtr<T>> {
-        typedef T Type;
-    };
-
-    template<typename T> struct IsEnumOrConvertibleToInteger {
-        static const bool value = std::is_integral<T>::value || std::is_enum<T>::value || std::is_convertible<T, long double>::value;
-    };
-
-    template<typename T> struct IsThreadSafeRefCountedPointer {
-        static const bool value = std::is_convertible<typename RemovePointer<T>::Type*, ThreadSafeRefCounted<typename RemovePointer<T>::Type>*>::value;
-    };
-};
-
-template<typename T> struct CrossThreadCopierPassThrough {
-    typedef T Type;
-    static Type copy(const T& parameter)
-    {
-        return parameter;
-    }
-};
-
-template<bool isEnumOrConvertibleToInteger, bool isThreadSafeRefCounted, typename T> struct CrossThreadCopierBase;
-
-// Integers get passed through without any changes.
-template<typename T> struct CrossThreadCopierBase<true, false, T> : public CrossThreadCopierPassThrough<T> {
-};
-
-// To allow a type to be passed across threads using its copy constructor, add a forward declaration of the type and
-// a CopyThreadCopierBase<false, false, TypeName> : public CrossThreadCopierPassThrough<TypeName> { }; to this file.
-template<> struct CrossThreadCopierBase<false, false, IntRect> : public CrossThreadCopierPassThrough<IntRect> {
-};
-
-template<> struct CrossThreadCopierBase<false, false, IntSize> : public CrossThreadCopierPassThrough<IntSize> {
-};
-
-// Classes that have an isolatedCopy() method get a default specialization.
-template<class T> struct CrossThreadCopierBase<false, false, T> {
-    static T copy(const T& value)
-    {
-        return value.isolatedCopy();
-    }
-};
-
-// Custom copy methods.
-template<typename T> struct CrossThreadCopierBase<false, true, T> {
-    typedef typename CrossThreadCopierBaseHelper::RemovePointer<T>::Type RefCountedType;
-    static_assert(std::is_convertible<RefCountedType*, ThreadSafeRefCounted<RefCountedType>*>::value, "T is not convertible to ThreadSafeRefCounted!");
-
-    typedef PassRefPtr<RefCountedType> Type;
-    WEBCORE_EXPORT static Type copy(const T& refPtr)
-    {
-        return refPtr;
-    }
-};
-
-template<> struct CrossThreadCopierBase<false, false, URL> {
-    typedef URL Type;
-    static Type copy(const URL&);
-};
-
-template<> struct WEBCORE_EXPORT CrossThreadCopierBase<false, false, String> {
-    typedef String Type;
-    static Type copy(const String&);
-};
-
-template<> struct CrossThreadCopierBase<false, false, ResourceError> {
-    typedef ResourceError Type;
-    static Type copy(const ResourceError&);
-};
-
-template<> struct CrossThreadCopierBase<false, false, ResourceRequest> {
-    typedef std::unique_ptr<CrossThreadResourceRequestData> Type;
-    static Type copy(const ResourceRequest&);
-};
-
-template<> struct CrossThreadCopierBase<false, false, ResourceResponse> {
-    typedef std::unique_ptr<CrossThreadResourceResponseData> Type;
-    static Type copy(const ResourceResponse&);
-};
-
-template<> struct CrossThreadCopierBase<false, false, SecurityOriginData> {
-    typedef SecurityOriginData Type;
-    static Type copy(const SecurityOriginData&);
-};
-
-template<> struct CrossThreadCopierBase<false, false, SessionID> {
-    typedef SessionID Type;
-    static Type copy(const SessionID&);
-};
-
-template<> struct CrossThreadCopierBase<false, false, ThreadSafeDataBuffer> {
-    typedef ThreadSafeDataBuffer Type;
-    static Type copy(const ThreadSafeDataBuffer&);
-};
-
-template<> struct CrossThreadCopierBase<false, false, std::chrono::system_clock::time_point> {
-    typedef std::chrono::system_clock::time_point Type;
-    static Type copy(const Type& source);
-};
-
-template<typename T>
-struct CrossThreadCopier : public CrossThreadCopierBase<CrossThreadCopierBaseHelper::IsEnumOrConvertibleToInteger<T>::value, CrossThreadCopierBaseHelper::IsThreadSafeRefCountedPointer<T>::value, T> {
-};
-
-// Default specialization for Vectors of CrossThreadCopyable classes.
-template<typename T> struct CrossThreadCopierBase<false, false, Vector<T>> {
-    typedef Vector<T> Type;
-    static Type copy(const Type& source)
-    {
-        Type destination;
-        destination.reserveInitialCapacity(source.size());
-        for (auto& object : source)
-            destination.uncheckedAppend(CrossThreadCopier<T>::copy(object));
-        return destination;
-    }
-};
-
-} // namespace WebCore

Deleted: trunk/Source/WebCore/platform/CrossThreadTask.h (201503 => 201504)


--- trunk/Source/WebCore/platform/CrossThreadTask.h	2016-05-31 03:25:40 UTC (rev 201503)
+++ trunk/Source/WebCore/platform/CrossThreadTask.h	2016-05-31 03:35:44 UTC (rev 201504)
@@ -1,253 +0,0 @@
-/*
- * Copyright (C) 2013, 2015 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 CrossThreadTask_h
-#define CrossThreadTask_h
-
-#include "CrossThreadCopier.h"
-#include <functional>
-
-namespace WebCore {
-
-class CrossThreadTask {
-    WTF_MAKE_NONCOPYABLE(CrossThreadTask);
-public:
-    CrossThreadTask(const std::function<void ()> taskFunction)
-        : m_taskFunction(taskFunction)
-    {
-        ASSERT(taskFunction);
-    }
-
-    void performTask()
-    {
-        m_taskFunction();
-    }
-
-protected:
-    CrossThreadTask() { }
-
-    std::function<void ()> m_taskFunction;
-};
-
-template <typename T, typename... Arguments>
-class CrossThreadTaskImpl final : public CrossThreadTask {
-public:
-    CrossThreadTaskImpl(T* callee, void (T::*method)(Arguments...), Arguments&&... arguments)
-    {
-        m_taskFunction = [callee, method, arguments...] {
-            (callee->*method)(arguments...);
-        };
-    }
-};
-
-template <typename... Arguments>
-class CrossThreadTaskStaticImpl final : public CrossThreadTask {
-public:
-    CrossThreadTaskStaticImpl(void (*method)(Arguments...), Arguments&&... arguments)
-    {
-        m_taskFunction = [method, arguments...] {
-            method(arguments...);
-        };
-    }
-};
-
-template<typename T>
-std::unique_ptr<CrossThreadTask> createCrossThreadTask(
-    T& callee,
-    void (T::*method)())
-{
-    return std::make_unique<CrossThreadTaskImpl<T>>(&callee, method);
-}
-
-template<typename T, typename P1, typename MP1>
-std::unique_ptr<CrossThreadTask> createCrossThreadTask(
-    T& callee,
-    void (T::*method)(MP1),
-    const P1& parameter1)
-{
-    return std::make_unique<CrossThreadTaskImpl<T, MP1>>(
-        &callee,
-        method,
-        WebCore::CrossThreadCopier<P1>::copy(parameter1));
-}
-
-template<typename T, typename P1, typename MP1, typename P2, typename MP2>
-std::unique_ptr<CrossThreadTask> createCrossThreadTask(
-    T& callee,
-    void (T::*method)(MP1, MP2),
-    const P1& parameter1,
-    const P2& parameter2)
-{
-    return std::make_unique<CrossThreadTaskImpl<T, MP1, MP2>>(
-        &callee,
-        method,
-        WebCore::CrossThreadCopier<P1>::copy(parameter1),
-        WebCore::CrossThreadCopier<P2>::copy(parameter2));
-
-}
-
-template<typename T, typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3>
-std::unique_ptr<CrossThreadTask> createCrossThreadTask(
-    T& callee,
-    void (T::*method)(MP1, MP2, MP3),
-    const P1& parameter1,
-    const P2& parameter2,
-    const P3& parameter3)
-{
-    return std::make_unique<CrossThreadTaskImpl<T, MP1, MP2, MP3>>(
-        &callee,
-        method,
-        WebCore::CrossThreadCopier<P1>::copy(parameter1),
-        WebCore::CrossThreadCopier<P2>::copy(parameter2),
-        WebCore::CrossThreadCopier<P3>::copy(parameter3));
-}
-
-template<typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3>
-std::unique_ptr<CrossThreadTask> createCrossThreadTask(
-    void (*method)(MP1, MP2, MP3),
-    const P1& parameter1,
-    const P2& parameter2,
-    const P3& parameter3)
-{
-    return std::make_unique<CrossThreadTaskStaticImpl<MP1, MP2, MP3>>(
-        method,
-        WebCore::CrossThreadCopier<P1>::copy(parameter1),
-        WebCore::CrossThreadCopier<P2>::copy(parameter2),
-        WebCore::CrossThreadCopier<P3>::copy(parameter3));
-}
-
-template<typename T, typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3, typename P4, typename MP4>
-std::unique_ptr<CrossThreadTask> createCrossThreadTask(
-    T& callee,
-    void (T::*method)(MP1, MP2, MP3, MP4),
-    const P1& parameter1,
-    const P2& parameter2,
-    const P3& parameter3,
-    const P4& parameter4)
-{
-    return std::make_unique<CrossThreadTaskImpl<T, MP1, MP2, MP3, MP4>>(
-        &callee,
-        method,
-        WebCore::CrossThreadCopier<P1>::copy(parameter1),
-        WebCore::CrossThreadCopier<P2>::copy(parameter2),
-        WebCore::CrossThreadCopier<P3>::copy(parameter3),
-        WebCore::CrossThreadCopier<P4>::copy(parameter4));
-}
-
-template<typename T, typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3, typename P4, typename MP4, typename P5, typename MP5>
-std::unique_ptr<CrossThreadTask> createCrossThreadTask(
-    T& callee,
-    void (T::*method)(MP1, MP2, MP3, MP4, MP5),
-    const P1& parameter1,
-    const P2& parameter2,
-    const P3& parameter3,
-    const P4& parameter4,
-    const P5& parameter5)
-{
-    return std::make_unique<CrossThreadTaskImpl<T, MP1, MP2, MP3, MP4, MP5>>(
-        &callee,
-        method,
-        WebCore::CrossThreadCopier<P1>::copy(parameter1),
-        WebCore::CrossThreadCopier<P2>::copy(parameter2),
-        WebCore::CrossThreadCopier<P3>::copy(parameter3),
-        WebCore::CrossThreadCopier<P4>::copy(parameter4),
-        WebCore::CrossThreadCopier<P5>::copy(parameter5));
-}
-
-template<typename T, typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3, typename P4, typename MP4, typename P5, typename MP5, typename P6, typename MP6>
-std::unique_ptr<CrossThreadTask> createCrossThreadTask(
-    T& callee,
-    void (T::*method)(MP1, MP2, MP3, MP4, MP5, MP6),
-    const P1& parameter1,
-    const P2& parameter2,
-    const P3& parameter3,
-    const P4& parameter4,
-    const P5& parameter5,
-    const P6& parameter6)
-{
-    return std::make_unique<CrossThreadTaskImpl<T, MP1, MP2, MP3, MP4, MP5, MP6>>(
-        &callee,
-        method,
-        WebCore::CrossThreadCopier<P1>::copy(parameter1),
-        WebCore::CrossThreadCopier<P2>::copy(parameter2),
-        WebCore::CrossThreadCopier<P3>::copy(parameter3),
-        WebCore::CrossThreadCopier<P4>::copy(parameter4),
-        WebCore::CrossThreadCopier<P5>::copy(parameter5),
-        WebCore::CrossThreadCopier<P6>::copy(parameter6));
-}
-
-template<typename T, typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3, typename P4, typename MP4, typename P5, typename MP5, typename P6, typename MP6, typename P7, typename MP7>
-std::unique_ptr<CrossThreadTask> createCrossThreadTask(
-    T& callee,
-    void (T::*method)(MP1, MP2, MP3, MP4, MP5, MP6, MP7),
-    const P1& parameter1,
-    const P2& parameter2,
-    const P3& parameter3,
-    const P4& parameter4,
-    const P5& parameter5,
-    const P6& parameter6,
-    const P7& parameter7)
-{
-    return std::make_unique<CrossThreadTaskImpl<T, MP1, MP2, MP3, MP4, MP5, MP6, MP7>>(
-        &callee,
-        method,
-        WebCore::CrossThreadCopier<P1>::copy(parameter1),
-        WebCore::CrossThreadCopier<P2>::copy(parameter2),
-        WebCore::CrossThreadCopier<P3>::copy(parameter3),
-        WebCore::CrossThreadCopier<P4>::copy(parameter4),
-        WebCore::CrossThreadCopier<P5>::copy(parameter5),
-        WebCore::CrossThreadCopier<P6>::copy(parameter6),
-        WebCore::CrossThreadCopier<P7>::copy(parameter7));
-}
-
-template<typename T, typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3, typename P4, typename MP4, typename P5, typename MP5, typename P6, typename MP6, typename P7, typename MP7, typename P8, typename MP8>
-std::unique_ptr<CrossThreadTask> createCrossThreadTask(
-    T& callee,
-    void (T::*method)(MP1, MP2, MP3, MP4, MP5, MP6, MP7, MP8),
-    const P1& parameter1,
-    const P2& parameter2,
-    const P3& parameter3,
-    const P4& parameter4,
-    const P5& parameter5,
-    const P6& parameter6,
-    const P7& parameter7,
-    const P8& parameter8)
-{
-    return std::make_unique<CrossThreadTaskImpl<T, MP1, MP2, MP3, MP4, MP5, MP6, MP7, MP8>>(
-        &callee,
-        method,
-        WebCore::CrossThreadCopier<P1>::copy(parameter1),
-        WebCore::CrossThreadCopier<P2>::copy(parameter2),
-        WebCore::CrossThreadCopier<P3>::copy(parameter3),
-        WebCore::CrossThreadCopier<P4>::copy(parameter4),
-        WebCore::CrossThreadCopier<P5>::copy(parameter5),
-        WebCore::CrossThreadCopier<P6>::copy(parameter6),
-        WebCore::CrossThreadCopier<P7>::copy(parameter7),
-        WebCore::CrossThreadCopier<P8>::copy(parameter8));
-}
-
-} // namespace WebCore
-
-#endif // CrossThreadTask_h

Added: trunk/Source/WebCore/platform/WebCoreCrossThreadCopier.cpp (0 => 201504)


--- trunk/Source/WebCore/platform/WebCoreCrossThreadCopier.cpp	                        (rev 0)
+++ trunk/Source/WebCore/platform/WebCoreCrossThreadCopier.cpp	2016-05-31 03:35:44 UTC (rev 201504)
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2009 Google 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:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * 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.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * OWNER OR 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 "config.h"
+#include "WebCoreCrossThreadCopier.h"
+
+#include "SessionID.h"
+#include "ThreadSafeDataBuffer.h"
+
+namespace WTF {
+
+CrossThreadCopierBase<false, false, WebCore::SessionID>::Type CrossThreadCopierBase<false, false, WebCore::SessionID>::copy(const WebCore::SessionID& sessionID)
+{
+    return sessionID;
+}
+
+CrossThreadCopierBase<false, false, WebCore::ThreadSafeDataBuffer>::Type CrossThreadCopierBase<false, false, WebCore::ThreadSafeDataBuffer>::copy(const WebCore::ThreadSafeDataBuffer& buffer)
+{
+    return WebCore::ThreadSafeDataBuffer(buffer);
+}
+
+} // namespace WTF

Added: trunk/Source/WebCore/platform/WebCoreCrossThreadCopier.h (0 => 201504)


--- trunk/Source/WebCore/platform/WebCoreCrossThreadCopier.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/WebCoreCrossThreadCopier.h	2016-05-31 03:35:44 UTC (rev 201504)
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2009, 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2014, 2015, 2016 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:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * 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.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * OWNER OR 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.
+ */
+
+#pragma once
+
+#include <wtf/CrossThreadCopier.h>
+
+namespace WebCore {
+class SessionID;
+class ThreadSafeDataBuffer;
+}
+
+namespace WTF {
+
+template<> struct CrossThreadCopierBase<false, false, WebCore::SessionID> {
+    typedef WebCore::SessionID Type;
+    static Type copy(const WebCore::SessionID&);
+};
+
+template<> struct CrossThreadCopierBase<false, false, WebCore::ThreadSafeDataBuffer> {
+    typedef WebCore::ThreadSafeDataBuffer Type;
+    static Type copy(const WebCore::ThreadSafeDataBuffer&);
+};
+
+} // namespace WTF

Modified: trunk/Source/WebCore/platform/network/cf/ResourceError.h (201503 => 201504)


--- trunk/Source/WebCore/platform/network/cf/ResourceError.h	2016-05-31 03:25:40 UTC (rev 201503)
+++ trunk/Source/WebCore/platform/network/cf/ResourceError.h	2016-05-31 03:35:44 UTC (rev 201504)
@@ -61,6 +61,8 @@
     WEBCORE_EXPORT CFErrorRef cfError() const;
     WEBCORE_EXPORT operator CFErrorRef() const;
 
+    ResourceError isolatedCopy() const { return copy(); }
+
 #if USE(CFNETWORK)
 #if PLATFORM(WIN)
     ResourceError(const String& domain, int errorCode, const URL& failingURL, const String& localizedDescription, CFDataRef certificate);

Modified: trunk/Source/WebCore/platform/network/cf/ResourceRequest.h (201503 => 201504)


--- trunk/Source/WebCore/platform/network/cf/ResourceRequest.h	2016-05-31 03:25:40 UTC (rev 201503)
+++ trunk/Source/WebCore/platform/network/cf/ResourceRequest.h	2016-05-31 03:35:44 UTC (rev 201504)
@@ -24,8 +24,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef ResourceRequest_h
-#define ResourceRequest_h
+#pragma once
 
 #include "ResourceRequestBase.h"
 #include <wtf/RetainPtr.h>
@@ -82,6 +81,8 @@
         }
 #endif
 
+        ResourceRequest isolatedCopy() const { return *ResourceRequest::adopt(copyData()); }
+
         WEBCORE_EXPORT void updateFromDelegatePreservingOldProperties(const ResourceRequest&);
 
 #if PLATFORM(MAC)
@@ -162,5 +163,3 @@
 
 
 } // namespace WebCore
-
-#endif // ResourceRequest_h

Modified: trunk/Source/WebCore/platform/network/cf/ResourceResponse.h (201503 => 201504)


--- trunk/Source/WebCore/platform/network/cf/ResourceResponse.h	2016-05-31 03:25:40 UTC (rev 201503)
+++ trunk/Source/WebCore/platform/network/cf/ResourceResponse.h	2016-05-31 03:35:44 UTC (rev 201504)
@@ -23,8 +23,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#ifndef ResourceResponse_h
-#define ResourceResponse_h
+#pragma once
 
 #include "ResourceResponseBase.h"
 #include <wtf/RetainPtr.h>
@@ -73,6 +72,8 @@
     {
     }
 
+    ResourceResponse isolatedCopy() const { return *ResourceResponse::adopt(copyData()); }
+
     unsigned memoryUsage() const
     {
         // FIXME: Find some programmatic lighweight way to calculate ResourceResponse and associated classes.
@@ -124,5 +125,3 @@
 };
 
 } // namespace WebCore
-
-#endif // ResourceResponse_h

Modified: trunk/Source/WebKit2/CMakeLists.txt (201503 => 201504)


--- trunk/Source/WebKit2/CMakeLists.txt	2016-05-31 03:25:40 UTC (rev 201503)
+++ trunk/Source/WebKit2/CMakeLists.txt	2016-05-31 03:35:44 UTC (rev 201504)
@@ -259,7 +259,6 @@
     Shared/WebContextMenuItem.cpp
     Shared/WebContextMenuItemData.cpp
     Shared/WebCoreArgumentCoders.cpp
-    Shared/WebCrossThreadCopier.cpp
     Shared/WebEvent.cpp
     Shared/WebEventConversion.cpp
     Shared/WebGeolocationPosition.cpp

Modified: trunk/Source/WebKit2/ChangeLog (201503 => 201504)


--- trunk/Source/WebKit2/ChangeLog	2016-05-31 03:25:40 UTC (rev 201503)
+++ trunk/Source/WebKit2/ChangeLog	2016-05-31 03:35:44 UTC (rev 201504)
@@ -1,3 +1,19 @@
+2016-05-30  Brady Eidson  <beid...@apple.com>
+
+        Move CrossThreadCopier/CrossThreadTask to WTF.
+        https://bugs.webkit.org/show_bug.cgi?id=158207
+
+        Reviewed by Alex Christensen.
+
+        * CMakeLists.txt:
+        * WebKit2.xcodeproj/project.pbxproj:
+
+        * DatabaseProcess/DatabaseProcess.cpp:
+        * DatabaseProcess/DatabaseProcess.h:
+
+        * Shared/WebCrossThreadCopier.cpp: Removed.
+        * Shared/WebCrossThreadCopier.h: Removed.
+
 2016-05-28  Chris Dumez  <cdu...@apple.com>
 
         Templatize NoncopyableFunction class similarly to std::function

Modified: trunk/Source/WebKit2/DatabaseProcess/DatabaseProcess.cpp (201503 => 201504)


--- trunk/Source/WebKit2/DatabaseProcess/DatabaseProcess.cpp	2016-05-31 03:25:40 UTC (rev 201503)
+++ trunk/Source/WebKit2/DatabaseProcess/DatabaseProcess.cpp	2016-05-31 03:35:44 UTC (rev 201504)
@@ -33,13 +33,12 @@
 #include "DatabaseProcessProxyMessages.h"
 #include "DatabaseToWebProcessConnection.h"
 #include "WebCoreArgumentCoders.h"
-#include "WebCrossThreadCopier.h"
 #include "WebsiteData.h"
-#include <WebCore/CrossThreadTask.h>
 #include <WebCore/FileSystem.h>
 #include <WebCore/NotImplemented.h>
 #include <WebCore/SessionID.h>
 #include <WebCore/TextEncoding.h>
+#include <wtf/CrossThreadTask.h>
 #include <wtf/MainThread.h>
 
 using namespace WebCore;

Modified: trunk/Source/WebKit2/DatabaseProcess/DatabaseProcess.h (201503 => 201504)


--- trunk/Source/WebKit2/DatabaseProcess/DatabaseProcess.h	2016-05-31 03:25:40 UTC (rev 201503)
+++ trunk/Source/WebKit2/DatabaseProcess/DatabaseProcess.h	2016-05-31 03:35:44 UTC (rev 201504)
@@ -23,8 +23,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef DatabaseProcess_h
-#define DatabaseProcess_h
+#pragma once
 
 #if ENABLE(DATABASE_PROCESS)
 
@@ -33,10 +32,10 @@
 #include <WebCore/IDBBackingStore.h>
 #include <WebCore/IDBServer.h>
 #include <WebCore/UniqueIDBDatabase.h>
+#include <wtf/CrossThreadTask.h>
 #include <wtf/NeverDestroyed.h>
 
 namespace WebCore {
-class CrossThreadTask;
 class SessionID;
 struct SecurityOriginData;
 }
@@ -69,7 +68,7 @@
 
     WorkQueue& queue() { return m_queue.get(); }
 
-    void postDatabaseTask(std::unique_ptr<WebCore::CrossThreadTask>);
+    void postDatabaseTask(std::unique_ptr<CrossThreadTask>);
 
 #if ENABLE(INDEXED_DATABASE)
     // WebCore::IDBServer::IDBBackingStoreFileHandler
@@ -127,12 +126,10 @@
     HashMap<String, RefPtr<SandboxExtension>> m_blobTemporaryFileSandboxExtensions;
     HashMap<uint64_t, std::function<void (const SandboxExtension::HandleArray&)>> m_sandboxExtensionForBlobsCompletionHandlers;
 
-    Deque<std::unique_ptr<WebCore::CrossThreadTask>> m_databaseTasks;
+    Deque<std::unique_ptr<CrossThreadTask>> m_databaseTasks;
     Lock m_databaseTaskMutex;
 };
 
 } // namespace WebKit
 
 #endif // ENABLE(DATABASE_PROCESS)
-
-#endif // DatabaseProcess_h

Deleted: trunk/Source/WebKit2/Shared/WebCrossThreadCopier.cpp (201503 => 201504)


--- trunk/Source/WebKit2/Shared/WebCrossThreadCopier.cpp	2016-05-31 03:25:40 UTC (rev 201503)
+++ trunk/Source/WebKit2/Shared/WebCrossThreadCopier.cpp	2016-05-31 03:35:44 UTC (rev 201504)
@@ -1,67 +0,0 @@
-/*
- * 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 "config.h"
-#include "WebCrossThreadCopier.h"
-
-#if ENABLE(INDEXED_DATABASE)
-
-#include <WebCore/IDBKeyData.h>
-
-using namespace WebKit;
-
-namespace WebCore {
-
-Vector<char> CrossThreadCopierBase<false, false, Vector<char>>::copy(const Vector<char>& vector)
-{
-    Vector<char> result;
-    result.reserveInitialCapacity(vector.size());
-    result.appendVector(vector);
-    return result;
-}
-
-Vector<int64_t> CrossThreadCopierBase<false, false, Vector<int64_t>>::copy(const Vector<int64_t>& vector)
-{
-    Vector<int64_t> result;
-    result.reserveInitialCapacity(vector.size());
-    result.appendVector(vector);
-    return result;
-}
-
-Vector<uint8_t> CrossThreadCopierBase<false, false, Vector<uint8_t>>::copy(const Vector<uint8_t>& vector)
-{
-    Vector<uint8_t> result;
-    result.reserveInitialCapacity(vector.size());
-    result.appendVector(vector);
-    return result;
-}
-
-ASCIILiteral CrossThreadCopierBase<false, false, ASCIILiteral>::copy(const ASCIILiteral& literal)
-{
-    return literal;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)

Deleted: trunk/Source/WebKit2/Shared/WebCrossThreadCopier.h (201503 => 201504)


--- trunk/Source/WebKit2/Shared/WebCrossThreadCopier.h	2016-05-31 03:25:40 UTC (rev 201503)
+++ trunk/Source/WebKit2/Shared/WebCrossThreadCopier.h	2016-05-31 03:35:44 UTC (rev 201504)
@@ -1,74 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef WebCrossThreadCopier_h
-#define WebCrossThreadCopier_h
-
-#include <WebCore/CrossThreadCopier.h>
-#include <wtf/Vector.h>
-
-#if ENABLE(INDEXED_DATABASE)
-
-namespace WebCore {
-struct SecurityOriginData;
-}
-
-namespace WebKit {
-enum class LegacyUniqueIDBDatabaseShutdownType;
-}
-
-namespace WTF {
-class ASCIILiteral;
-}
-
-namespace WebCore {
-
-template<> struct CrossThreadCopierBase<false, false, WebKit::LegacyUniqueIDBDatabaseShutdownType> {
-    static WebKit::LegacyUniqueIDBDatabaseShutdownType copy(const WebKit::LegacyUniqueIDBDatabaseShutdownType& type)
-    {
-        return type;
-    }
-};
-
-template<> struct CrossThreadCopierBase<false, false, Vector<char>> {
-    static Vector<char> copy(const Vector<char>&);
-};
-
-template<> struct CrossThreadCopierBase<false, false, Vector<int64_t>> {
-    static Vector<int64_t> copy(const Vector<int64_t>&);
-};
-
-template<> struct CrossThreadCopierBase<false, false, Vector<uint8_t>> {
-    static Vector<uint8_t> copy(const Vector<uint8_t>&);
-};
-
-template<> struct CrossThreadCopierBase<false, false, WTF::ASCIILiteral> {
-    static WTF::ASCIILiteral copy(const WTF::ASCIILiteral&);
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(INDEXED_DATABASE)
-#endif // WebCrossThreadCopier_h

Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (201503 => 201504)


--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2016-05-31 03:25:40 UTC (rev 201503)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2016-05-31 03:35:44 UTC (rev 201504)
@@ -929,7 +929,6 @@
 		515E772B184008B90007203F /* DatabaseProcessCreationParameters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 515E7729184008B90007203F /* DatabaseProcessCreationParameters.cpp */; };
 		515E772C184008B90007203F /* DatabaseProcessCreationParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 515E772A184008B90007203F /* DatabaseProcessCreationParameters.h */; };
 		5160BFE113381DF900918999 /* LoggingFoundation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5160BFE013381DF900918999 /* LoggingFoundation.mm */; };
-		516311871858446600534647 /* WebCrossThreadCopier.h in Headers */ = {isa = PBXBuildFile; fileRef = 516311861858446600534647 /* WebCrossThreadCopier.h */; };
 		516319921628980A00E22F00 /* NetworkProcessProxyMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 516319911628980A00E22F00 /* NetworkProcessProxyMac.mm */; };
 		5163199416289A6000E22F00 /* NetworkProcessMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51ACC9341628064800342550 /* NetworkProcessMessageReceiver.cpp */; };
 		5163199516289A6300E22F00 /* NetworkProcessMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 51ACC9351628064800342550 /* NetworkProcessMessages.h */; };
@@ -972,7 +971,6 @@
 		51ACBBA1127A8F2C00D203B9 /* WebContextMenuProxyMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51ACBB9F127A8F2C00D203B9 /* WebContextMenuProxyMac.mm */; };
 		51B15A8413843A3900321AD8 /* EnvironmentUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51B15A8213843A3900321AD8 /* EnvironmentUtilities.cpp */; };
 		51B15A8513843A3900321AD8 /* EnvironmentUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 51B15A8313843A3900321AD8 /* EnvironmentUtilities.h */; };
-		51BA24461858F55D00EA2811 /* WebCrossThreadCopier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51BA24451858F41500EA2811 /* WebCrossThreadCopier.cpp */; };
 		51CD1C5D1B3493AF00142CA5 /* WKSecurityOriginRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51CD1C591B3493A900142CA5 /* WKSecurityOriginRef.cpp */; };
 		51CD1C5E1B3493B400142CA5 /* WKSecurityOriginRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 51CD1C5A1B3493A900142CA5 /* WKSecurityOriginRef.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		51CD1C651B34B9D400142CA5 /* WKSecurityOrigin.h in Headers */ = {isa = PBXBuildFile; fileRef = 51CD1C5F1B34B9C900142CA5 /* WKSecurityOrigin.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -2953,7 +2951,6 @@
 		515E7729184008B90007203F /* DatabaseProcessCreationParameters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DatabaseProcessCreationParameters.cpp; sourceTree = "<group>"; };
 		515E772A184008B90007203F /* DatabaseProcessCreationParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseProcessCreationParameters.h; sourceTree = "<group>"; };
 		5160BFE013381DF900918999 /* LoggingFoundation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LoggingFoundation.mm; sourceTree = "<group>"; };
-		516311861858446600534647 /* WebCrossThreadCopier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCrossThreadCopier.h; sourceTree = "<group>"; };
 		516319911628980A00E22F00 /* NetworkProcessProxyMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = NetworkProcessProxyMac.mm; path = mac/NetworkProcessProxyMac.mm; sourceTree = "<group>"; };
 		5164C0941B05B757004F102A /* ChildProcess.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ChildProcess.messages.in; sourceTree = "<group>"; };
 		516A4A5B120A2CCD00C05B7F /* APIError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIError.h; sourceTree = "<group>"; };
@@ -3001,7 +2998,6 @@
 		51ACC9351628064800342550 /* NetworkProcessMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkProcessMessages.h; sourceTree = "<group>"; };
 		51B15A8213843A3900321AD8 /* EnvironmentUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EnvironmentUtilities.cpp; path = unix/EnvironmentUtilities.cpp; sourceTree = "<group>"; };
 		51B15A8313843A3900321AD8 /* EnvironmentUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EnvironmentUtilities.h; path = unix/EnvironmentUtilities.h; sourceTree = "<group>"; };
-		51BA24451858F41500EA2811 /* WebCrossThreadCopier.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebCrossThreadCopier.cpp; sourceTree = "<group>"; };
 		51CD1C591B3493A900142CA5 /* WKSecurityOriginRef.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKSecurityOriginRef.cpp; sourceTree = "<group>"; };
 		51CD1C5A1B3493A900142CA5 /* WKSecurityOriginRef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKSecurityOriginRef.h; sourceTree = "<group>"; };
 		51CD1C5F1B34B9C900142CA5 /* WKSecurityOrigin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKSecurityOrigin.h; sourceTree = "<group>"; };
@@ -4525,8 +4521,6 @@
 				510FBB991288C95E00AFFDF4 /* WebContextMenuItemData.h */,
 				939AE7651316E99C00AE06A6 /* WebCoreArgumentCoders.cpp */,
 				BC1DD7B1114DC396005ADAF3 /* WebCoreArgumentCoders.h */,
-				51BA24451858F41500EA2811 /* WebCrossThreadCopier.cpp */,
-				516311861858446600534647 /* WebCrossThreadCopier.h */,
 				C0337DAD127A24FE008FF4F4 /* WebEvent.cpp */,
 				BC032DAF10F4380F0058C15A /* WebEvent.h */,
 				BC032DB010F4380F0058C15A /* WebEventConversion.cpp */,
@@ -7704,7 +7698,6 @@
 				3309344A1315B9220097A7BC /* WebCookieManagerProxyMessages.h in Headers */,
 				BC1DD7B2114DC396005ADAF3 /* WebCoreArgumentCoders.h in Headers */,
 				512F589B12A8838800629530 /* WebCredential.h in Headers */,
-				516311871858446600534647 /* WebCrossThreadCopier.h in Headers */,
 				1AA83F6D1A5B63FF00026EC6 /* WebDatabaseProvider.h in Headers */,
 				CD19A26E1A13E834008D650E /* WebDiagnosticLoggingClient.h in Headers */,
 				1A5B1C5518987EDF004FCF9B /* WebDocumentLoader.h in Headers */,
@@ -9189,7 +9182,6 @@
 				939AE7661316E99C00AE06A6 /* WebCoreArgumentCoders.cpp in Sources */,
 				BCE23263122C6CF300D5C35A /* WebCoreArgumentCodersMac.mm in Sources */,
 				512F589A12A8838800629530 /* WebCredential.cpp in Sources */,
-				51BA24461858F55D00EA2811 /* WebCrossThreadCopier.cpp in Sources */,
 				1AA83F6C1A5B63FF00026EC6 /* WebDatabaseProvider.cpp in Sources */,
 				CD19A26D1A13E82A008D650E /* WebDiagnosticLoggingClient.cpp in Sources */,
 				1A5B1C5418987EDF004FCF9B /* WebDocumentLoader.cpp in Sources */,
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to