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

Unified Diff: third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp

Issue 2318383002: Submit CompositorFrame from worker (Closed)
Patch Set: Remove a TODO comment 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
diff --git a/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp b/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
index 9a149bbeeb97bf6e28e7a86e60883c881e0ad551..4f805106e6c2e15e2056075a2f0e9ef421ec8adf 100644
--- a/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
+++ b/third_party/WebKit/Source/modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.cpp
@@ -44,12 +44,13 @@ DEFINE_TRACE(OffscreenCanvasRenderingContext2D)
BaseRenderingContext2D::trace(visitor);
}
-void OffscreenCanvasRenderingContext2D::commit(ExecutionContext* executionContext)
+void OffscreenCanvasRenderingContext2D::commit(ExceptionState& exceptionState)
{
- if (executionContext->isWorkerGlobalScope()) {
- // TODO(xlai): implement commit() on worker thread; currently, do
- // nothing for worker thread. See crbug.com/563858.
- return;
+ if (getOffscreenCanvas()->getAssociatedCanvasId() < 0) {
+ // If an OffscreenCanvas has no associated canvas Id, it indicates that
+ // it is not an OffscreenCanvas created by transfering control from html
+ // canvas.
+ exceptionState.throwDOMException(InvalidStateError, "Commit() has no effect if HTMLCanvasElement.transferControlToOffscreen() is not called.");
Justin Novosad 2016/09/07 21:40:15 This message is not true: there is an effect, an e
xlai (Olivia) 2016/09/08 15:27:15 Done.
}
getOffscreenCanvas()->getOrCreateFrameDispatcher()->dispatchFrame();
}

Powered by Google App Engine
This is Rietveld 408576698