Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(403)

Side by Side Diff: Source/platform/CrossThreadCopier.h

Issue 31483002: Move CrossThreadCopier.cpp/.h to platform/ (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2009, 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 13 matching lines...) Expand all
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef CrossThreadCopier_h 31 #ifndef CrossThreadCopier_h
32 #define CrossThreadCopier_h 32 #define CrossThreadCopier_h
33 33
34 #include "platform/PlatformExport.h"
34 #include "wtf/Assertions.h" 35 #include "wtf/Assertions.h"
35 #include "wtf/Forward.h" 36 #include "wtf/Forward.h"
36 #include "wtf/PassOwnPtr.h" 37 #include "wtf/PassOwnPtr.h"
37 #include "wtf/PassRefPtr.h" 38 #include "wtf/PassRefPtr.h"
38 #include "wtf/RefPtr.h" 39 #include "wtf/RefPtr.h"
39 #include "wtf/ThreadSafeRefCounted.h" 40 #include "wtf/ThreadSafeRefCounted.h"
40 #include "wtf/TypeTraits.h" 41 #include "wtf/TypeTraits.h"
41 42
42 namespace WebCore { 43 namespace WebCore {
43 44
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 template<typename T> struct CrossThreadCopierBase<false, false, PassOwnPtr<T > > { 99 template<typename T> struct CrossThreadCopierBase<false, false, PassOwnPtr<T > > {
99 typedef PassOwnPtr<T> Type; 100 typedef PassOwnPtr<T> Type;
100 static Type copy(Type ownPtr) 101 static Type copy(Type ownPtr)
101 { 102 {
102 return ownPtr; 103 return ownPtr;
103 } 104 }
104 }; 105 };
105 106
106 template<> struct CrossThreadCopierBase<false, false, KURL> { 107 template<> struct CrossThreadCopierBase<false, false, KURL> {
107 typedef KURL Type; 108 typedef KURL Type;
108 static Type copy(const KURL&); 109 PLATFORM_EXPORT static Type copy(const KURL&);
109 }; 110 };
110 111
111 template<> struct CrossThreadCopierBase<false, false, String> { 112 template<> struct CrossThreadCopierBase<false, false, String> {
112 typedef String Type; 113 typedef String Type;
113 static Type copy(const String&); 114 PLATFORM_EXPORT static Type copy(const String&);
114 }; 115 };
115 116
116 template<> struct CrossThreadCopierBase<false, false, ResourceError> { 117 template<> struct CrossThreadCopierBase<false, false, ResourceError> {
117 typedef ResourceError Type; 118 typedef ResourceError Type;
118 static Type copy(const ResourceError&); 119 PLATFORM_EXPORT static Type copy(const ResourceError&);
119 }; 120 };
120 121
121 template<> struct CrossThreadCopierBase<false, false, ResourceRequest> { 122 template<> struct CrossThreadCopierBase<false, false, ResourceRequest> {
122 typedef PassOwnPtr<CrossThreadResourceRequestData> Type; 123 typedef PassOwnPtr<CrossThreadResourceRequestData> Type;
123 static Type copy(const ResourceRequest&); 124 PLATFORM_EXPORT static Type copy(const ResourceRequest&);
124 }; 125 };
125 126
126 template<> struct CrossThreadCopierBase<false, false, ResourceResponse> { 127 template<> struct CrossThreadCopierBase<false, false, ResourceResponse> {
127 typedef PassOwnPtr<CrossThreadResourceResponseData> Type; 128 typedef PassOwnPtr<CrossThreadResourceResponseData> Type;
128 static Type copy(const ResourceResponse&); 129 PLATFORM_EXPORT static Type copy(const ResourceResponse&);
129 }; 130 };
130 131
131 template<typename T> struct CrossThreadCopier : public CrossThreadCopierBase <WTF::IsConvertibleToInteger<T>::value, 132 template<typename T> struct CrossThreadCopier : public CrossThreadCopierBase <WTF::IsConvertibleToInteger<T>::value,
132 WTF::IsSubclassOfTemplate<typename WTF::RemoveTemplate<T, RefPtr>::Type, Thread SafeRefCounted>::value 133 WTF::IsSubclassOfTemplate<typename WTF::RemoveTemplate<T, RefPtr>::Type, Thread SafeRefCounted>::value
133 || WTF::IsSubclassOfTemplate<typename WTF::RemovePointer<T>::Type, ThreadSa feRefCounted>::value 134 || WTF::IsSubclassOfTemplate<typename WTF::RemovePointer<T>::Type, ThreadSa feRefCounted>::value
134 || WTF::IsSubclassOfTemplate<typename WTF::RemoveTemplate<T, PassRefPtr>::T ype, ThreadSafeRefCounted>::value, 135 || WTF::IsSubclassOfTemplate<typename WTF::RemoveTemplate<T, PassRefPtr>::T ype, ThreadSafeRefCounted>::value,
135 T> { 136 T> {
136 }; 137 };
137 138
138 template<typename T> struct AllowCrossThreadAccessWrapper { 139 template<typename T> struct AllowCrossThreadAccessWrapper {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 171
171 template<typename T> AllowAccessLaterWrapper<T> AllowAccessLater(T* value) 172 template<typename T> AllowAccessLaterWrapper<T> AllowAccessLater(T* value)
172 { 173 {
173 return AllowAccessLaterWrapper<T>(value); 174 return AllowAccessLaterWrapper<T>(value);
174 } 175 }
175 176
176 177
177 } // namespace WebCore 178 } // namespace WebCore
178 179
179 #endif // CrossThreadCopier_h 180 #endif // CrossThreadCopier_h
OLDNEW
« no previous file with comments | « Source/modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp ('k') | Source/platform/CrossThreadCopier.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698