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

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

Issue 2290903002: Change (Pass)RefPtr<SkXxx> into sk_sp<SkXxx>. (Closed)
Patch Set: Rebasing... 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
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 03acaeffbb89ff80171e262b9a9673de0fcbdcfa..8d49eef467e90d7d648c6e21c75b6adb578ba960 100644
--- a/third_party/WebKit/Source/platform/CrossThreadCopier.h
+++ b/third_party/WebKit/Source/platform/CrossThreadCopier.h
@@ -32,6 +32,7 @@
#define CrossThreadCopier_h
#include "platform/PlatformExport.h"
+#include "third_party/skia/include/core/SkRefCnt.h"
#include "wtf/Assertions.h"
#include "wtf/Forward.h"
#include "wtf/Functional.h" // FunctionThreadAffinity
@@ -92,12 +93,17 @@ struct CrossThreadCopier : public CrossThreadCopierBase<T, std::is_arithmetic<T>
template <typename T>
struct CrossThreadCopier<PassRefPtr<T>> : public CrossThreadCopierPassThrough<PassRefPtr<T>> {
STATIC_ONLY(CrossThreadCopier);
- static_assert(WTF::IsSubclassOfTemplate<T, ThreadSafeRefCounted>::value || std::is_base_of<SkRefCnt, T>::value, "PassRefPtr<T> can be passed across threads only if T is ThreadSafeRefCounted or SkRefCnt.");
+ static_assert(WTF::IsSubclassOfTemplate<T, ThreadSafeRefCounted>::value, "PassRefPtr<T> can be passed across threads only if T is ThreadSafeRefCounted.");
};
template <typename T>
struct CrossThreadCopier<RefPtr<T>> : public CrossThreadCopierPassThrough<RefPtr<T>> {
STATIC_ONLY(CrossThreadCopier);
- static_assert(WTF::IsSubclassOfTemplate<T, ThreadSafeRefCounted>::value || std::is_base_of<SkRefCnt, T>::value, "RefPtr<T> can be passed across threads only if T is ThreadSafeRefCounted or SkRefCnt.");
+ static_assert(WTF::IsSubclassOfTemplate<T, ThreadSafeRefCounted>::value, "RefPtr<T> can be passed across threads only if T is ThreadSafeRefCounted.");
+};
+template <typename T>
+struct CrossThreadCopier<sk_sp<T>> : public CrossThreadCopierPassThrough<sk_sp<T>> {
+ STATIC_ONLY(CrossThreadCopier);
+ static_assert(std::is_base_of<SkRefCnt, T>::value, "sk_sp<T> can be passed across threads only if T is SkRefCnt.");
};
// nullptr_t can be passed through without any changes.
« no previous file with comments | « third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp ('k') | third_party/WebKit/Source/platform/DragImage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698