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

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: fix compilation error 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..6af36c0f89f7d43139fae14a0fa80d6f1f404d1a 100644
--- a/third_party/WebKit/Source/core/frame/ImageBitmap.h
+++ b/third_party/WebKit/Source/core/frame/ImageBitmap.h
@@ -28,13 +28,13 @@ 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&);
- static PassRefPtrWillBeRawPtr<ImageBitmap> create(Image*, const IntRect&);
static PassRefPtrWillBeRawPtr<ImageBitmap> create(PassRefPtr<StaticBitmapImage>);
+ static PassRefPtrWillBeRawPtr<ImageBitmap> create(PassRefPtr<StaticBitmapImage>, const IntRect&);
StaticBitmapImage* bitmapImage() const { return (m_image) ? m_image.get() : nullptr; }
unsigned long width() const;
@@ -42,13 +42,14 @@ public:
IntSize size() const;
bool isNeutered() const { return m_isNeutered; }
+ bool originClean() const { return m_image->originClean(); }
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_image->originClean(); }
void adjustDrawRects(FloatRect* srcRect, FloatRect* dstRect) const override;
FloatSize elementSize() const override;
@@ -59,13 +60,13 @@ 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&);
- ImageBitmap(Image*, const IntRect&);
ImageBitmap(PassRefPtr<StaticBitmapImage>);
+ ImageBitmap(PassRefPtr<StaticBitmapImage>, const IntRect&);
// ImageLoaderClient
void notifyImageSourceChanged() override;

Powered by Google App Engine
This is Rietveld 408576698