Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 14 matching lines...) Expand all Loading... | |
| 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 "platform/PlatformExport.h" |
| 35 #include "platform/heap/Handle.h" | |
| 35 #include "wtf/Assertions.h" | 36 #include "wtf/Assertions.h" |
| 36 #include "wtf/Forward.h" | 37 #include "wtf/Forward.h" |
| 37 #include "wtf/PassOwnPtr.h" | 38 #include "wtf/PassOwnPtr.h" |
| 38 #include "wtf/PassRefPtr.h" | 39 #include "wtf/PassRefPtr.h" |
| 39 #include "wtf/RefPtr.h" | 40 #include "wtf/RefPtr.h" |
| 40 #include "wtf/ThreadSafeRefCounted.h" | 41 #include "wtf/ThreadSafeRefCounted.h" |
| 41 #include "wtf/TypeTraits.h" | 42 #include "wtf/TypeTraits.h" |
| 42 | 43 |
| 43 namespace WebCore { | 44 namespace WebCore { |
| 44 | 45 |
| 45 class IntRect; | 46 class IntRect; |
| 46 class IntSize; | 47 class IntSize; |
| 47 class KURL; | 48 class KURL; |
| 48 class ResourceError; | 49 class ResourceError; |
| 49 class ResourceRequest; | 50 class ResourceRequest; |
| 50 class ResourceResponse; | 51 class ResourceResponse; |
| 52 class ThreadableWebSocketChannelClientWrapper; | |
| 51 struct CrossThreadResourceResponseData; | 53 struct CrossThreadResourceResponseData; |
| 52 struct CrossThreadResourceRequestData; | 54 struct CrossThreadResourceRequestData; |
| 53 struct ThreadableLoaderOptions; | 55 struct ThreadableLoaderOptions; |
| 54 | 56 |
| 55 template<typename T> struct CrossThreadCopierPassThrough { | 57 template<typename T> struct CrossThreadCopierPassThrough { |
| 56 typedef T Type; | 58 typedef T Type; |
| 57 static Type copy(const T& parameter) | 59 static Type copy(const T& parameter) |
| 58 { | 60 { |
| 59 return parameter; | 61 return parameter; |
| 60 } | 62 } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 97 }; | 99 }; |
| 98 | 100 |
| 99 template<typename T> struct CrossThreadCopierBase<false, false, PassOwnPtr<T > > { | 101 template<typename T> struct CrossThreadCopierBase<false, false, PassOwnPtr<T > > { |
| 100 typedef PassOwnPtr<T> Type; | 102 typedef PassOwnPtr<T> Type; |
| 101 static Type copy(Type ownPtr) | 103 static Type copy(Type ownPtr) |
| 102 { | 104 { |
| 103 return ownPtr; | 105 return ownPtr; |
| 104 } | 106 } |
| 105 }; | 107 }; |
| 106 | 108 |
| 109 template<> struct CrossThreadCopierBase<false, false, ThreadableWebSocketCha nnelClientWrapper*> { | |
|
haraken
2014/05/07 07:45:16
I must admit that I'm not understanding what I'm d
tkent
2014/05/07 08:10:41
The generated code would be ok. We don't need spe
haraken
2014/05/07 11:18:33
Done. Please take a look, I'm not familiar with te
| |
| 110 typedef ThreadableWebSocketChannelClientWrapper* Type; | |
| 111 static Type copy(Type rawPtr) | |
| 112 { | |
| 113 return rawPtr; | |
| 114 } | |
| 115 }; | |
| 116 | |
| 107 template<> struct CrossThreadCopierBase<false, false, KURL> { | 117 template<> struct CrossThreadCopierBase<false, false, KURL> { |
| 108 typedef KURL Type; | 118 typedef KURL Type; |
| 109 PLATFORM_EXPORT static Type copy(const KURL&); | 119 PLATFORM_EXPORT static Type copy(const KURL&); |
| 110 }; | 120 }; |
| 111 | 121 |
| 112 template<> struct CrossThreadCopierBase<false, false, String> { | 122 template<> struct CrossThreadCopierBase<false, false, String> { |
| 113 typedef String Type; | 123 typedef String Type; |
| 114 PLATFORM_EXPORT static Type copy(const String&); | 124 PLATFORM_EXPORT static Type copy(const String&); |
| 115 }; | 125 }; |
| 116 | 126 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 171 | 181 |
| 172 template<typename T> AllowAccessLaterWrapper<T> AllowAccessLater(T* value) | 182 template<typename T> AllowAccessLaterWrapper<T> AllowAccessLater(T* value) |
| 173 { | 183 { |
| 174 return AllowAccessLaterWrapper<T>(value); | 184 return AllowAccessLaterWrapper<T>(value); |
| 175 } | 185 } |
| 176 | 186 |
| 177 | 187 |
| 178 } // namespace WebCore | 188 } // namespace WebCore |
| 179 | 189 |
| 180 #endif // CrossThreadCopier_h | 190 #endif // CrossThreadCopier_h |
| OLD | NEW |