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

Unified Diff: third_party/WebKit/Source/platform/CrossThreadCopier.h

Issue 2355153002: Disallowed PassRefPtr copies across threads. (Closed)
Patch Set: Changed typedef to PassRefPtr<T> Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/CrossThreadCopier.h
diff --git a/third_party/WebKit/Source/platform/CrossThreadCopier.h b/third_party/WebKit/Source/platform/CrossThreadCopier.h
index 8d49eef467e90d7d648c6e21c75b6adb578ba960..c863a4047bdba6462e1a62ff76a5f9f112326c14 100644
--- a/third_party/WebKit/Source/platform/CrossThreadCopier.h
+++ b/third_party/WebKit/Source/platform/CrossThreadCopier.h
@@ -91,9 +91,14 @@ struct CrossThreadCopier : public CrossThreadCopierBase<T, std::is_arithmetic<T>
// CrossThreadCopier specializations follow.
template <typename T>
-struct CrossThreadCopier<PassRefPtr<T>> : public CrossThreadCopierPassThrough<PassRefPtr<T>> {
+struct CrossThreadCopier<PassRefPtr<T>> {
STATIC_ONLY(CrossThreadCopier);
+ typedef PassRefPtr<T> Type;
static_assert(WTF::IsSubclassOfTemplate<T, ThreadSafeRefCounted>::value, "PassRefPtr<T> can be passed across threads only if T is ThreadSafeRefCounted.");
+ static PassRefPtr<T> copy(PassRefPtr<T>&& pointer)
+ {
+ return std::move(pointer);
+ }
};
template <typename T>
struct CrossThreadCopier<RefPtr<T>> : public CrossThreadCopierPassThrough<RefPtr<T>> {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698