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

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

Issue 2620083002: Shape Detection: Move mojom interface to //services (Closed)
Patch Set: Created 3 years, 11 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/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/dom/DOMRect.h" 8 #include "core/dom/DOMRect.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"
(...skipping 29 matching lines...) Expand all
40 m_barcodeService->Detect( 40 m_barcodeService->Detect(
41 std::move(sharedBufferHandle), imageWidth, imageHeight, 41 std::move(sharedBufferHandle), imageWidth, imageHeight,
42 convertToBaseCallback(WTF::bind(&BarcodeDetector::onDetectBarcodes, 42 convertToBaseCallback(WTF::bind(&BarcodeDetector::onDetectBarcodes,
43 wrapPersistent(this), 43 wrapPersistent(this),
44 wrapPersistent(resolver)))); 44 wrapPersistent(resolver))));
45 return promise; 45 return promise;
46 } 46 }
47 47
48 void BarcodeDetector::onDetectBarcodes( 48 void BarcodeDetector::onDetectBarcodes(
49 ScriptPromiseResolver* resolver, 49 ScriptPromiseResolver* resolver,
50 Vector<mojom::blink::BarcodeDetectionResultPtr> barcodeDetectionResults) { 50 Vector<shape_detection::mojom::blink::BarcodeDetectionResultPtr>
51 barcodeDetectionResults) {
51 DCHECK(m_barcodeServiceRequests.contains(resolver)); 52 DCHECK(m_barcodeServiceRequests.contains(resolver));
52 m_barcodeServiceRequests.remove(resolver); 53 m_barcodeServiceRequests.remove(resolver);
53 54
54 HeapVector<Member<DetectedBarcode>> detectedBarcodes; 55 HeapVector<Member<DetectedBarcode>> detectedBarcodes;
55 for (const auto& barcode : barcodeDetectionResults) { 56 for (const auto& barcode : barcodeDetectionResults) {
56 HeapVector<Point2D> cornerPoints; 57 HeapVector<Point2D> cornerPoints;
57 for (const auto& corner_point : barcode->corner_points) { 58 for (const auto& corner_point : barcode->corner_points) {
58 Point2D point; 59 Point2D point;
59 point.setX(corner_point->x); 60 point.setX(corner_point->x);
60 point.setY(corner_point->y); 61 point.setY(corner_point->y);
(...skipping 18 matching lines...) Expand all
79 m_barcodeServiceRequests.clear(); 80 m_barcodeServiceRequests.clear();
80 m_barcodeService.reset(); 81 m_barcodeService.reset();
81 } 82 }
82 83
83 DEFINE_TRACE(BarcodeDetector) { 84 DEFINE_TRACE(BarcodeDetector) {
84 ShapeDetector::trace(visitor); 85 ShapeDetector::trace(visitor);
85 visitor->trace(m_barcodeServiceRequests); 86 visitor->trace(m_barcodeServiceRequests);
86 } 87 }
87 88
88 } // namespace blink 89 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698