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

Unified Diff: third_party/WebKit/Source/platform/graphics/StaticBitmapImage.h

Issue 2906763004: Make Image RefCounted
Patch Set: Created 3 years, 7 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 | « third_party/WebKit/Source/platform/graphics/OffscreenCanvasPlaceholder.cpp ('k') | 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/graphics/StaticBitmapImage.h
diff --git a/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.h b/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.h
index 6dbde204f9575b7b14f6306645f91868c11ad5e8..1f4acc570fa7bec1914261027ef2c5c90b9cde05 100644
--- a/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.h
+++ b/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.h
@@ -7,6 +7,7 @@
#include "gpu/command_buffer/common/mailbox.h"
#include "gpu/command_buffer/common/sync_token.h"
+#include "platform/CrossThreadCopier.h"
#include "platform/graphics/Image.h"
#include "third_party/khronos/GLES2/gl2.h"
#include "third_party/skia/include/core/SkRefCnt.h"
@@ -82,6 +83,18 @@ class PLATFORM_EXPORT StaticBitmapImage : public Image {
bool is_premultiplied_ = true;
};
+template <>
+struct CrossThreadCopier<RefPtr<StaticBitmapImage>> {
+ typedef RefPtr<StaticBitmapImage> Type;
+ static Type Copy(RefPtr<StaticBitmapImage> image) {
+ if (image) {
+ CHECK(image->HasOneRef());
+ image->Transfer();
+ }
+ return image;
+ }
+};
+
} // namespace blink
#endif
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/OffscreenCanvasPlaceholder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698