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

Unified Diff: third_party/WebKit/Source/core/frame/ImageBitmap.h

Issue 1532473002: Add a origin clean flag in ImageBitmap class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: StaticBitmapImage now has a second parameter for origin clean flag Created 4 years, 11 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/core/frame/ImageBitmap.h
diff --git a/third_party/WebKit/Source/core/frame/ImageBitmap.h b/third_party/WebKit/Source/core/frame/ImageBitmap.h
index 59fbf3362f5c6d1b4df2c660b749340cbd4c4b32..f3b1edf7628462e0bf2432c7a54846cae146458f 100644
--- a/third_party/WebKit/Source/core/frame/ImageBitmap.h
+++ b/third_party/WebKit/Source/core/frame/ImageBitmap.h
@@ -28,8 +28,8 @@ class CORE_EXPORT ImageBitmap final : public RefCountedWillBeGarbageCollectedFin
DEFINE_WRAPPERTYPEINFO();
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ImageBitmap);
public:
- static PassRefPtrWillBeRawPtr<ImageBitmap> create(HTMLImageElement*, const IntRect&);
- static PassRefPtrWillBeRawPtr<ImageBitmap> create(HTMLVideoElement*, const IntRect&);
+ static PassRefPtrWillBeRawPtr<ImageBitmap> create(HTMLImageElement*, const IntRect&, Document*);
+ static PassRefPtrWillBeRawPtr<ImageBitmap> create(HTMLVideoElement*, const IntRect&, Document*);
static PassRefPtrWillBeRawPtr<ImageBitmap> create(HTMLCanvasElement*, const IntRect&);
static PassRefPtrWillBeRawPtr<ImageBitmap> create(ImageData*, const IntRect&);
static PassRefPtrWillBeRawPtr<ImageBitmap> create(ImageBitmap*, const IntRect&);
@@ -42,13 +42,14 @@ public:
IntSize size() const;
bool isNeutered() const { return m_isNeutered; }
+ bool originClean() const { return m_isOriginClean; }
PassRefPtr<StaticBitmapImage> transfer();
~ImageBitmap() override;
// CanvasImageSource implementation
PassRefPtr<Image> getSourceImageForCanvas(SourceImageStatus*, AccelerationHint) const override;
- bool wouldTaintOrigin(SecurityOrigin*) const override { return false; }
+ bool wouldTaintOrigin(SecurityOrigin*) const override { return !m_isOriginClean; }
void adjustDrawRects(FloatRect* srcRect, FloatRect* dstRect) const override;
FloatSize elementSize() const override;
@@ -59,8 +60,8 @@ public:
DECLARE_VIRTUAL_TRACE();
private:
- ImageBitmap(HTMLImageElement*, const IntRect&);
- ImageBitmap(HTMLVideoElement*, const IntRect&);
+ ImageBitmap(HTMLImageElement*, const IntRect&, Document*);
+ ImageBitmap(HTMLVideoElement*, const IntRect&, Document*);
ImageBitmap(HTMLCanvasElement*, const IntRect&);
ImageBitmap(ImageData*, const IntRect&);
ImageBitmap(ImageBitmap*, const IntRect&);
@@ -73,6 +74,7 @@ private:
RefPtr<StaticBitmapImage> m_image;
bool m_isNeutered = false;
+ bool m_isOriginClean = true;
Justin Novosad 2016/01/07 17:12:01 This is redundant now that we have a notion of ori
xidachen 2016/01/08 18:07:55 Acknowledged.
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698