OLD | NEW |
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 17 matching lines...) Expand all Loading... |
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 "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 "platform/network/ResourceTimingInfo.h" |
38 #include "platform/weborigin/KURL.h" | 39 #include "platform/weborigin/KURL.h" |
39 #include "wtf/text/WTFString.h" | 40 #include "wtf/text/WTFString.h" |
40 | 41 |
41 namespace blink { | 42 namespace blink { |
42 | 43 |
43 CrossThreadCopierBase<false, false, false, KURL>::Type CrossThreadCopierBase<fal
se, false, false, KURL>::copy(const KURL& url) | 44 CrossThreadCopierBase<false, false, false, KURL>::Type CrossThreadCopierBase<fal
se, false, false, KURL>::copy(const KURL& url) |
44 { | 45 { |
45 return url.copy(); | 46 return url.copy(); |
46 } | 47 } |
47 | 48 |
(...skipping 10 matching lines...) Expand all Loading... |
58 CrossThreadCopierBase<false, false, false, ResourceRequest>::Type CrossThreadCop
ierBase<false, false, false, ResourceRequest>::copy(const ResourceRequest& reque
st) | 59 CrossThreadCopierBase<false, false, false, ResourceRequest>::Type CrossThreadCop
ierBase<false, false, false, ResourceRequest>::copy(const ResourceRequest& reque
st) |
59 { | 60 { |
60 return request.copyData(); | 61 return request.copyData(); |
61 } | 62 } |
62 | 63 |
63 CrossThreadCopierBase<false, false, false, ResourceResponse>::Type CrossThreadCo
pierBase<false, false, false, ResourceResponse>::copy(const ResourceResponse& re
sponse) | 64 CrossThreadCopierBase<false, false, false, ResourceResponse>::Type CrossThreadCo
pierBase<false, false, false, ResourceResponse>::copy(const ResourceResponse& re
sponse) |
64 { | 65 { |
65 return response.copyData(); | 66 return response.copyData(); |
66 } | 67 } |
67 | 68 |
| 69 CrossThreadCopierBase<false, false, false, ResourceTimingInfo>::Type CrossThread
CopierBase<false, false, false, ResourceTimingInfo>::copy(const ResourceTimingIn
fo& info) |
| 70 { |
| 71 return info.copyData(); |
| 72 } |
| 73 |
68 // Test CrossThreadCopier using static_assert. | 74 // Test CrossThreadCopier using static_assert. |
69 | 75 |
70 // Verify that ThreadSafeRefCounted objects get handled correctly. | 76 // Verify that ThreadSafeRefCounted objects get handled correctly. |
71 class CopierThreadSafeRefCountedTest : public ThreadSafeRefCounted<CopierThreadS
afeRefCountedTest> { | 77 class CopierThreadSafeRefCountedTest : public ThreadSafeRefCounted<CopierThreadS
afeRefCountedTest> { |
72 }; | 78 }; |
73 | 79 |
74 static_assert((WTF::IsSameType< | 80 static_assert((WTF::IsSameType< |
75 PassRefPtr<CopierThreadSafeRefCountedTest>, | 81 PassRefPtr<CopierThreadSafeRefCountedTest>, |
76 CrossThreadCopier<PassRefPtr<CopierThreadSafeRefCountedTest>>::Type | 82 CrossThreadCopier<PassRefPtr<CopierThreadSafeRefCountedTest>>::Type |
77 >::value), | 83 >::value), |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 "PassOwnPtr test"); | 129 "PassOwnPtr test"); |
124 | 130 |
125 // Verify that PassOwnPtr does not get passed through. | 131 // Verify that PassOwnPtr does not get passed through. |
126 static_assert((WTF::IsSameType< | 132 static_assert((WTF::IsSameType< |
127 int, | 133 int, |
128 CrossThreadCopier<OwnPtr<float>>::Type | 134 CrossThreadCopier<OwnPtr<float>>::Type |
129 >::value), | 135 >::value), |
130 "OwnPtr test"); | 136 "OwnPtr test"); |
131 | 137 |
132 } // namespace blink | 138 } // namespace blink |
OLD | NEW |