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

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

Issue 31483002: Move CrossThreadCopier.cpp/.h to platform/ (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
« no previous file with comments | « Source/platform/CrossThreadCopier.h ('k') | Source/platform/blink_platform.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 12 matching lines...) Expand all
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
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 #include "config.h" 31 #include "config.h"
32 32
33 #include "core/platform/CrossThreadCopier.h" 33 #include "platform/CrossThreadCopier.h"
34 34
35 #include "platform/network/ResourceError.h" 35 #include "platform/network/ResourceError.h"
36 #include "platform/network/ResourceRequest.h" 36 #include "platform/network/ResourceRequest.h"
37 #include "platform/network/ResourceResponse.h" 37 #include "platform/network/ResourceResponse.h"
38 #include "weborigin/KURL.h" 38 #include "weborigin/KURL.h"
39 #include "wtf/Assertions.h" 39 #include "wtf/Assertions.h"
40 #include "wtf/text/WTFString.h" 40 #include "wtf/text/WTFString.h"
41 41
42 namespace WebCore { 42 namespace WebCore {
43 43
(...skipping 13 matching lines...) Expand all
57 } 57 }
58 58
59 CrossThreadCopierBase<false, false, ResourceRequest>::Type CrossThreadCopierBase <false, false, ResourceRequest>::copy(const ResourceRequest& request) 59 CrossThreadCopierBase<false, false, ResourceRequest>::Type CrossThreadCopierBase <false, false, ResourceRequest>::copy(const ResourceRequest& request)
60 { 60 {
61 return request.copyData(); 61 return request.copyData();
62 } 62 }
63 63
64 CrossThreadCopierBase<false, false, ResourceResponse>::Type CrossThreadCopierBas e<false, false, ResourceResponse>::copy(const ResourceResponse& response) 64 CrossThreadCopierBase<false, false, ResourceResponse>::Type CrossThreadCopierBas e<false, false, ResourceResponse>::copy(const ResourceResponse& response)
65 { 65 {
66 return response.copyData(); 66 return response.copyData();
67 } 67 }
abarth-chromium 2013/10/21 03:11:01 Yeah, you're going to need PLATFORM_EXPORT for the
68 68
69 // Test CrossThreadCopier using COMPILE_ASSERT. 69 // Test CrossThreadCopier using COMPILE_ASSERT.
70 70
71 // Verify that ThreadSafeRefCounted objects get handled correctly. 71 // Verify that ThreadSafeRefCounted objects get handled correctly.
72 class CopierThreadSafeRefCountedTest : public ThreadSafeRefCounted<CopierThreadS afeRefCountedTest> { 72 class CopierThreadSafeRefCountedTest : public ThreadSafeRefCounted<CopierThreadS afeRefCountedTest> {
73 }; 73 };
74 74
75 COMPILE_ASSERT((WTF::IsSameType< 75 COMPILE_ASSERT((WTF::IsSameType<
76 PassRefPtr<CopierThreadSafeRefCountedTest>, 76 PassRefPtr<CopierThreadSafeRefCountedTest>,
77 CrossThreadCopier<PassRefPtr<CopierThreadSafeRefCountedTest> > ::Type 77 CrossThreadCopier<PassRefPtr<CopierThreadSafeRefCountedTest> > ::Type
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 PassOwnPtrTest); 124 PassOwnPtrTest);
125 125
126 // Verify that PassOwnPtr does not get passed through. 126 // Verify that PassOwnPtr does not get passed through.
127 COMPILE_ASSERT((WTF::IsSameType< 127 COMPILE_ASSERT((WTF::IsSameType<
128 int, 128 int,
129 CrossThreadCopier<OwnPtr<float> >::Type 129 CrossThreadCopier<OwnPtr<float> >::Type
130 >::value), 130 >::value),
131 OwnPtrTest); 131 OwnPtrTest);
132 132
133 } // namespace WebCore 133 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/platform/CrossThreadCopier.h ('k') | Source/platform/blink_platform.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698