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

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

Issue 2493673002: Synchronize OffscreenCanvas content with the placeholder canvas (Closed)
Patch Set: build fix 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 dd349c5992f4626c9653f1820fb09b272c0ed875..0d17fb305b42f419735807a7e87dfa803b1d853f 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,7 +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_nonce, width(), height()));
+ m_clientId, m_sinkId, m_localId, m_nonce, m_placeholderCanvasId,
+ width(), height()));
}
return m_frameDispatcher.get();
}

Powered by Google App Engine
This is Rietveld 408576698