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

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

Issue 1781613002: Fix data race problem in createImageBitmap(Blob) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix data rance layout test Created 4 years, 9 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
« no previous file with comments | « third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp ('k') | no next file » | 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, 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 24 matching lines...) Expand all
35 #include "platform/heap/Handle.h" 35 #include "platform/heap/Handle.h"
36 #include "wtf/Assertions.h" 36 #include "wtf/Assertions.h"
37 #include "wtf/Forward.h" 37 #include "wtf/Forward.h"
38 #include "wtf/PassOwnPtr.h" 38 #include "wtf/PassOwnPtr.h"
39 #include "wtf/PassRefPtr.h" 39 #include "wtf/PassRefPtr.h"
40 #include "wtf/RawPtr.h" 40 #include "wtf/RawPtr.h"
41 #include "wtf/RefPtr.h" 41 #include "wtf/RefPtr.h"
42 #include "wtf/ThreadSafeRefCounted.h" 42 #include "wtf/ThreadSafeRefCounted.h"
43 #include "wtf/TypeTraits.h" 43 #include "wtf/TypeTraits.h"
44 44
45 class SkRefCnt;
46
45 namespace blink { 47 namespace blink {
46 48
47 class IntRect; 49 class IntRect;
48 class IntSize; 50 class IntSize;
49 class KURL; 51 class KURL;
50 class ResourceError; 52 class ResourceError;
51 class ResourceRequest; 53 class ResourceRequest;
52 class ResourceResponse; 54 class ResourceResponse;
53 struct CrossThreadResourceResponseData; 55 struct CrossThreadResourceResponseData;
54 struct CrossThreadResourceRequestData; 56 struct CrossThreadResourceRequestData;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 return ptr; 106 return ptr;
105 } 107 }
106 }; 108 };
107 109
108 template <typename T> 110 template <typename T>
109 struct CrossThreadCopier : public CrossThreadCopierBase< 111 struct CrossThreadCopier : public CrossThreadCopierBase<
110 T, 112 T,
111 std::is_arithmetic<T>::value || std::is_enum<T>::value, 113 std::is_arithmetic<T>::value || std::is_enum<T>::value,
112 WTF::IsSubclassOfTemplate<typename WTF::RemoveTemplate<T, RefPtr>::Type, Thr eadSafeRefCounted>::value 114 WTF::IsSubclassOfTemplate<typename WTF::RemoveTemplate<T, RefPtr>::Type, Thr eadSafeRefCounted>::value
113 || WTF::IsSubclassOfTemplate<typename std::remove_pointer<T>::type, ThreadSa feRefCounted>::value 115 || WTF::IsSubclassOfTemplate<typename std::remove_pointer<T>::type, ThreadSa feRefCounted>::value
114 || WTF::IsSubclassOfTemplate<typename WTF::RemoveTemplate<T, PassRefPtr>::Ty pe, ThreadSafeRefCounted>::value, 116 || WTF::IsSubclassOfTemplate<typename WTF::RemoveTemplate<T, PassRefPtr>::Ty pe, ThreadSafeRefCounted>::value
117 || std::is_base_of<SkRefCnt, typename WTF::RemoveTemplate<T, RefPtr>::Type>: :value
118 || std::is_base_of<SkRefCnt, typename std::remove_pointer<T>::type>::value
119 || std::is_base_of<SkRefCnt, typename WTF::RemoveTemplate<T, PassRefPtr>::Ty pe>::value,
115 WTF::IsSubclassOfTemplate<typename std::remove_pointer<T>::type, GarbageColl ected>::value> { 120 WTF::IsSubclassOfTemplate<typename std::remove_pointer<T>::type, GarbageColl ected>::value> {
116 STATIC_ONLY(CrossThreadCopier); 121 STATIC_ONLY(CrossThreadCopier);
117 }; 122 };
118 123
119 // CrossThreadCopier specializations follow. 124 // CrossThreadCopier specializations follow.
120 125
121 // nullptr_t can be passed through without any changes. 126 // nullptr_t can be passed through without any changes.
122 template <> 127 template <>
123 struct CrossThreadCopier<std::nullptr_t> : public CrossThreadCopierPassThrough<s td::nullptr_t> { 128 struct CrossThreadCopier<std::nullptr_t> : public CrossThreadCopierPassThrough<s td::nullptr_t> {
124 STATIC_ONLY(CrossThreadCopier); 129 STATIC_ONLY(CrossThreadCopier);
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 266
262 template <typename T> 267 template <typename T>
263 AllowCrossThreadAccessWrapper<const WeakPtr<T>&> AllowCrossThreadAccess(const We akPtr<T>& value) 268 AllowCrossThreadAccessWrapper<const WeakPtr<T>&> AllowCrossThreadAccess(const We akPtr<T>& value)
264 { 269 {
265 return AllowCrossThreadAccessWrapper<const WeakPtr<T>&>(value); 270 return AllowCrossThreadAccessWrapper<const WeakPtr<T>&>(value);
266 } 271 }
267 272
268 } // namespace blink 273 } // namespace blink
269 274
270 #endif // CrossThreadCopier_h 275 #endif // CrossThreadCopier_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698