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

Side by Side Diff: third_party/WebKit/Source/modules/offscreencanvas/OffscreenCanvasModules.cpp

Issue 2490443002: Make OffscreenCanvas an EventTarget (Closed)
Patch Set: keep a Member<ExecutionContext> in OffscreenCanvas 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #include "modules/offscreencanvas/OffscreenCanvasModules.h" 5 #include "modules/offscreencanvas/OffscreenCanvasModules.h"
6 6
7 #include "core/html/canvas/CanvasContextCreationAttributes.h" 7 #include "core/html/canvas/CanvasContextCreationAttributes.h"
8 #include "core/offscreencanvas/OffscreenCanvas.h" 8 #include "core/offscreencanvas/OffscreenCanvas.h"
9 #include "modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h" 9 #include "modules/offscreencanvas2d/OffscreenCanvasRenderingContext2D.h"
10 10
11 namespace blink { 11 namespace blink {
12 12
13 void OffscreenCanvasModules::getContext( 13 void OffscreenCanvasModules::getContext(
14 ScriptState* scriptState, 14 ScriptState* scriptState,
15 OffscreenCanvas& offscreenCanvas, 15 OffscreenCanvas& offscreenCanvas,
16 const String& id, 16 const String& id,
17 const CanvasContextCreationAttributes& attributes, 17 const CanvasContextCreationAttributes& attributes,
18 ExceptionState& exceptionState, 18 ExceptionState& exceptionState,
19 OffscreenRenderingContext& result) { 19 OffscreenRenderingContext& result) {
20 if (offscreenCanvas.isNeutered()) { 20 if (offscreenCanvas.isNeutered()) {
21 exceptionState.throwDOMException(InvalidStateError, 21 exceptionState.throwDOMException(InvalidStateError,
22 "OffscreenCanvas object is detached"); 22 "OffscreenCanvas object is detached");
23 return; 23 return;
24 } 24 }
25 25
26 offscreenCanvas.setExecutionContext(scriptState->getExecutionContext());
Justin Novosad 2016/11/14 19:45:08 Add a comment: OffscreenCanvas cannot be transferr
26 CanvasRenderingContext* context = 27 CanvasRenderingContext* context =
27 offscreenCanvas.getCanvasRenderingContext(scriptState, id, attributes); 28 offscreenCanvas.getCanvasRenderingContext(scriptState, id, attributes);
28 if (context) 29 if (context)
29 context->setOffscreenCanvasGetContextResult(result); 30 context->setOffscreenCanvasGetContextResult(result);
30 } 31 }
31 32
32 } // namespace blink 33 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698