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

Side by Side 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: Created 5 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef ImageBitmap_h 5 #ifndef ImageBitmap_h
6 #define ImageBitmap_h 6 #define ImageBitmap_h
7 7
8 #include "bindings/core/v8/ScriptWrappable.h" 8 #include "bindings/core/v8/ScriptWrappable.h"
9 #include "core/CoreExport.h" 9 #include "core/CoreExport.h"
10 #include "core/html/HTMLImageElement.h" 10 #include "core/html/HTMLImageElement.h"
(...skipping 10 matching lines...) Expand all
21 namespace blink { 21 namespace blink {
22 22
23 class HTMLCanvasElement; 23 class HTMLCanvasElement;
24 class HTMLVideoElement; 24 class HTMLVideoElement;
25 class ImageData; 25 class ImageData;
26 26
27 class CORE_EXPORT ImageBitmap final : public RefCountedWillBeGarbageCollectedFin alized<ImageBitmap>, public ScriptWrappable, public ImageLoaderClient, public Ca nvasImageSource, public ImageBitmapSource { 27 class CORE_EXPORT ImageBitmap final : public RefCountedWillBeGarbageCollectedFin alized<ImageBitmap>, public ScriptWrappable, public ImageLoaderClient, public Ca nvasImageSource, public ImageBitmapSource {
28 DEFINE_WRAPPERTYPEINFO(); 28 DEFINE_WRAPPERTYPEINFO();
29 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ImageBitmap); 29 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ImageBitmap);
30 public: 30 public:
31 static PassRefPtrWillBeRawPtr<ImageBitmap> create(HTMLImageElement*, const I ntRect&); 31 static PassRefPtrWillBeRawPtr<ImageBitmap> create(HTMLImageElement*, const I ntRect&, bool originCleanFlag = true);
Justin Novosad 2015/12/16 03:34:35 The value of the origin clean flag should not be a
xidachen 2015/12/22 14:29:40 Done.
32 static PassRefPtrWillBeRawPtr<ImageBitmap> create(HTMLVideoElement*, const I ntRect&); 32 static PassRefPtrWillBeRawPtr<ImageBitmap> create(HTMLVideoElement*, const I ntRect&, bool originCleanFlag = true);
Justin Novosad 2015/12/16 03:34:35 same here
xidachen 2015/12/22 14:29:40 Done.
33 static PassRefPtrWillBeRawPtr<ImageBitmap> create(HTMLCanvasElement*, const IntRect&); 33 static PassRefPtrWillBeRawPtr<ImageBitmap> create(HTMLCanvasElement*, const IntRect&);
34 static PassRefPtrWillBeRawPtr<ImageBitmap> create(ImageData*, const IntRect& ); 34 static PassRefPtrWillBeRawPtr<ImageBitmap> create(ImageData*, const IntRect& );
35 static PassRefPtrWillBeRawPtr<ImageBitmap> create(ImageBitmap*, const IntRec t&); 35 static PassRefPtrWillBeRawPtr<ImageBitmap> create(ImageBitmap*, const IntRec t&);
36 static PassRefPtrWillBeRawPtr<ImageBitmap> create(Image*, const IntRect&); 36 static PassRefPtrWillBeRawPtr<ImageBitmap> create(Image*, const IntRect&);
37 static PassRefPtrWillBeRawPtr<ImageBitmap> create(PassRefPtr<StaticBitmapIma ge>); 37 static PassRefPtrWillBeRawPtr<ImageBitmap> create(PassRefPtr<StaticBitmapIma ge>);
38 38
39 StaticBitmapImage* bitmapImage() const { return (m_image) ? m_image.get() : nullptr; } 39 StaticBitmapImage* bitmapImage() const { return (m_image) ? m_image.get() : nullptr; }
40 unsigned long width() const; 40 unsigned long width() const;
41 unsigned long height() const; 41 unsigned long height() const;
42 IntSize size() const; 42 IntSize size() const;
43 43
44 bool isNeutered() const { return m_isNeutered; } 44 bool isNeutered() const { return m_isNeutered; }
45 PassRefPtr<StaticBitmapImage> transfer(); 45 PassRefPtr<StaticBitmapImage> transfer();
46 46
47 ~ImageBitmap() override; 47 ~ImageBitmap() override;
48 48
49 // CanvasImageSource implementation 49 // CanvasImageSource implementation
50 PassRefPtr<Image> getSourceImageForCanvas(SourceImageStatus*, AccelerationHi nt) const override; 50 PassRefPtr<Image> getSourceImageForCanvas(SourceImageStatus*, AccelerationHi nt) const override;
51 bool wouldTaintOrigin(SecurityOrigin*) const override { return false; } 51 bool wouldTaintOrigin(SecurityOrigin*) const override { return false; }
52 void adjustDrawRects(FloatRect* srcRect, FloatRect* dstRect) const override; 52 void adjustDrawRects(FloatRect* srcRect, FloatRect* dstRect) const override;
53 FloatSize elementSize() const override; 53 FloatSize elementSize() const override;
54 54
55 // ImageBitmapSource implementation 55 // ImageBitmapSource implementation
56 IntSize bitmapSourceSize() const override { return size(); } 56 IntSize bitmapSourceSize() const override { return size(); }
57 ScriptPromise createImageBitmap(ScriptState*, EventTarget&, int sx, int sy, int sw, int sh, ExceptionState&) override; 57 ScriptPromise createImageBitmap(ScriptState*, EventTarget&, int sx, int sy, int sw, int sh, ExceptionState&) override;
58 58
59 DECLARE_VIRTUAL_TRACE(); 59 DECLARE_VIRTUAL_TRACE();
60 60
61 private: 61 private:
62 ImageBitmap(HTMLImageElement*, const IntRect&); 62 ImageBitmap(HTMLImageElement*, const IntRect&, bool);
63 ImageBitmap(HTMLVideoElement*, const IntRect&); 63 ImageBitmap(HTMLVideoElement*, const IntRect&, bool);
64 ImageBitmap(HTMLCanvasElement*, const IntRect&); 64 ImageBitmap(HTMLCanvasElement*, const IntRect&);
65 ImageBitmap(ImageData*, const IntRect&); 65 ImageBitmap(ImageData*, const IntRect&);
66 ImageBitmap(ImageBitmap*, const IntRect&); 66 ImageBitmap(ImageBitmap*, const IntRect&);
67 ImageBitmap(Image*, const IntRect&); 67 ImageBitmap(Image*, const IntRect&);
68 ImageBitmap(PassRefPtr<StaticBitmapImage>); 68 ImageBitmap(PassRefPtr<StaticBitmapImage>);
69 69
70 // ImageLoaderClient 70 // ImageLoaderClient
71 void notifyImageSourceChanged() override; 71 void notifyImageSourceChanged() override;
72 bool requestsHighLiveResourceCachePriority() override { return true; } 72 bool requestsHighLiveResourceCachePriority() override { return true; }
73 73
74 RefPtr<StaticBitmapImage> m_image; 74 RefPtr<StaticBitmapImage> m_image;
75 bool m_isNeutered = false; 75 bool m_isNeutered = false;
76 bool m_isOriginClean = true;
76 }; 77 };
77 78
78 } // namespace blink 79 } // namespace blink
79 80
80 #endif // ImageBitmap_h 81 #endif // ImageBitmap_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698