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

Side by Side Diff: third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h

Issue 2330553002: Disallow resizing on OffscreenCanvas that has been transferred control from canvas (Closed)
Patch Set: test 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 OffscreenCanvas_h 5 #ifndef OffscreenCanvas_h
6 #define OffscreenCanvas_h 6 #define OffscreenCanvas_h
7 7
8 #include "bindings/core/v8/ScriptPromise.h" 8 #include "bindings/core/v8/ScriptPromise.h"
9 #include "bindings/core/v8/ScriptState.h" 9 #include "bindings/core/v8/ScriptState.h"
10 #include "bindings/core/v8/ScriptWrappable.h" 10 #include "bindings/core/v8/ScriptWrappable.h"
(...skipping 12 matching lines...) Expand all
23 typedef OffscreenCanvasRenderingContext2DOrWebGLRenderingContextOrWebGL2Renderin gContext OffscreenRenderingContext; 23 typedef OffscreenCanvasRenderingContext2DOrWebGLRenderingContextOrWebGL2Renderin gContext OffscreenRenderingContext;
24 24
25 class CORE_EXPORT OffscreenCanvas final : public GarbageCollectedFinalized<Offsc reenCanvas>, public ScriptWrappable, public CanvasImageSource { 25 class CORE_EXPORT OffscreenCanvas final : public GarbageCollectedFinalized<Offsc reenCanvas>, public ScriptWrappable, public CanvasImageSource {
26 DEFINE_WRAPPERTYPEINFO(); 26 DEFINE_WRAPPERTYPEINFO();
27 public: 27 public:
28 static OffscreenCanvas* create(unsigned width, unsigned height); 28 static OffscreenCanvas* create(unsigned width, unsigned height);
29 29
30 // IDL attributes 30 // IDL attributes
31 unsigned width() const { return m_size.width(); } 31 unsigned width() const { return m_size.width(); }
32 unsigned height() const { return m_size.height(); } 32 unsigned height() const { return m_size.height(); }
33 void setWidth(unsigned); 33 void setWidth(unsigned, ExceptionState&);
34 void setHeight(unsigned); 34 void setHeight(unsigned, ExceptionState&);
35 35
36 // API Methods 36 // API Methods
37 ImageBitmap* transferToImageBitmap(ExceptionState&); 37 ImageBitmap* transferToImageBitmap(ExceptionState&);
38 38
39 IntSize size() const { return m_size; } 39 IntSize size() const { return m_size; }
40 void setAssociatedCanvasId(int canvasId) { m_canvasId = canvasId; } 40 void setAssociatedCanvasId(int canvasId) { m_canvasId = canvasId; }
41 int getAssociatedCanvasId() const { return m_canvasId; } 41 int getAssociatedCanvasId() const { return m_canvasId; }
42 bool isNeutered() const { return m_isNeutered; } 42 bool isNeutered() const { return m_isNeutered; }
43 void setNeutered(); 43 void setNeutered();
44 CanvasRenderingContext* getCanvasRenderingContext(ScriptState*, const String &, const CanvasContextCreationAttributes&); 44 CanvasRenderingContext* getCanvasRenderingContext(ScriptState*, const String &, const CanvasContextCreationAttributes&);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 // If this object is not created via HTMLCanvasElement.transferControlToOffs creen(), 97 // If this object is not created via HTMLCanvasElement.transferControlToOffs creen(),
98 // then the following members would remain as initialized zero values. 98 // then the following members would remain as initialized zero values.
99 uint32_t m_clientId = 0; 99 uint32_t m_clientId = 0;
100 uint32_t m_localId = 0; 100 uint32_t m_localId = 0;
101 uint64_t m_nonce = 0; 101 uint64_t m_nonce = 0;
102 }; 102 };
103 103
104 } // namespace blink 104 } // namespace blink
105 105
106 #endif // OffscreenCanvas_h 106 #endif // OffscreenCanvas_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698