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

Unified Diff: third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp

Issue 2493673002: Synchronize OffscreenCanvas content with the placeholder canvas (Closed)
Patch Set: fix obsolete test Created 4 years, 1 month 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/offscreencanvas/OffscreenCanvas.cpp
diff --git a/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp b/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp
index 94cbf94f568d6c2c2578b12199da58119e0b4067..e0b6e08cd06df0f875cd53179f79c84f65ea0b89 100644
--- a/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp
+++ b/third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.cpp
@@ -32,7 +32,7 @@ OffscreenCanvas* OffscreenCanvas::create(unsigned width, unsigned height) {
void OffscreenCanvas::setWidth(unsigned width, ExceptionState& exceptionState) {
// If this OffscreenCanvas is transferred control by an html canvas,
// its size is determined by html canvas's size and cannot be resized.
- if (m_canvasId >= 0) {
+ if (hasPlaceholderCanvas()) {
exceptionState.throwDOMException(InvalidStateError,
"Resizing is not allowed on an "
"OffscreenCanvas that has been "
@@ -45,7 +45,7 @@ void OffscreenCanvas::setWidth(unsigned width, ExceptionState& exceptionState) {
void OffscreenCanvas::setHeight(unsigned height,
ExceptionState& exceptionState) {
// Same comment as above.
- if (m_canvasId >= 0) {
+ if (hasPlaceholderCanvas()) {
exceptionState.throwDOMException(InvalidStateError,
"Resizing is not allowed on an "
"OffscreenCanvas that has been "
@@ -184,8 +184,8 @@ OffscreenCanvasFrameDispatcher* OffscreenCanvas::getOrCreateFrameDispatcher() {
// (either main or worker) to the browser process and remains unchanged
// throughout the lifetime of this OffscreenCanvas.
m_frameDispatcher = wrapUnique(new OffscreenCanvasFrameDispatcherImpl(
- m_clientId, m_sinkId, m_localId, m_nonceHigh, m_nonceLow, width(),
- height()));
+ m_clientId, m_sinkId, m_localId, m_nonceHigh, m_nonceLow,
+ m_placeholderCanvasId, width(), height()));
}
return m_frameDispatcher.get();
}

Powered by Google App Engine
This is Rietveld 408576698