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

Side by Side Diff: third_party/WebKit/Source/modules/shapedetection/BarcodeDetector.cpp

Issue 2539073002: Remove [ConstructorCallWith=ScriptState] from ShapeDetector (Closed)
Patch Set: temp Created 4 years 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/shapedetection/BarcodeDetector.h" 5 #include "modules/shapedetection/BarcodeDetector.h"
6 6
7 #include "core/dom/DOMException.h" 7 #include "core/dom/DOMException.h"
8 #include "core/frame/LocalDOMWindow.h" 8 #include "core/frame/LocalDOMWindow.h"
9 #include "core/frame/LocalFrame.h" 9 #include "core/frame/LocalFrame.h"
10 #include "core/html/canvas/CanvasImageSource.h" 10 #include "core/html/canvas/CanvasImageSource.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 BarcodeDetector* BarcodeDetector::create(ScriptState* scriptState) { 14 BarcodeDetector* BarcodeDetector::create(Document& document) {
15 return new BarcodeDetector(*scriptState->domWindow()->frame()); 15 return new BarcodeDetector(*document.frame());
16 } 16 }
17 17
18 BarcodeDetector::BarcodeDetector(LocalFrame& frame) : ShapeDetector(frame) {} 18 BarcodeDetector::BarcodeDetector(LocalFrame& frame) : ShapeDetector(frame) {}
19 19
20 ScriptPromise BarcodeDetector::detect( 20 ScriptPromise BarcodeDetector::detect(
21 ScriptState* scriptState, 21 ScriptState* scriptState,
22 const CanvasImageSourceUnion& imageSource) { 22 const CanvasImageSourceUnion& imageSource) {
23 return detectShapes(scriptState, ShapeDetector::DetectorType::Barcode, 23 return detectShapes(scriptState, ShapeDetector::DetectorType::Barcode,
24 imageSource); 24 imageSource);
25 } 25 }
26 26
27 DEFINE_TRACE(BarcodeDetector) { 27 DEFINE_TRACE(BarcodeDetector) {
28 ShapeDetector::trace(visitor); 28 ShapeDetector::trace(visitor);
29 } 29 }
30 30
31 } // namespace blink 31 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698