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

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

Issue 1917733004: Reland of: Make OffscreenCanvas Transferable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address all comments Created 4 years, 7 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 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 OffscreenCanvasRenderingContext2D* OffscreenCanvasModules::getContext(OffscreenC anvas& offscreenCanvas, const String& id, const CanvasContextCreationAttributes& attributes) 13 OffscreenCanvasRenderingContext2D* OffscreenCanvasModules::getContext(OffscreenC anvas& offscreenCanvas, const String& id, const CanvasContextCreationAttributes& attributes, ExceptionState& exceptionState)
14 { 14 {
15 if (offscreenCanvas.isNeutered()) {
16 exceptionState.throwDOMException(InvalidStateError, "OffscreenCanvas obj ect is detached");
17 return nullptr;
18 }
19
15 CanvasRenderingContext* context = offscreenCanvas.getCanvasRenderingContext( id, attributes); 20 CanvasRenderingContext* context = offscreenCanvas.getCanvasRenderingContext( id, attributes);
16 if (!context) 21 if (!context)
17 return nullptr; 22 return nullptr;
18 23
19 return static_cast<OffscreenCanvasRenderingContext2D*>(context); 24 return static_cast<OffscreenCanvasRenderingContext2D*>(context);
20 } 25 }
21 26
22 } // namespace blink 27 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698