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

Unified Diff: third_party/WebKit/Source/modules/shapedetection/FaceDetector.cpp

Issue 2629523008: Shape Detection: Remove ConstructorCallWith=Document (Closed)
Patch Set: Add layout test for worker 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/shapedetection/FaceDetector.cpp
diff --git a/third_party/WebKit/Source/modules/shapedetection/FaceDetector.cpp b/third_party/WebKit/Source/modules/shapedetection/FaceDetector.cpp
index d72e2846ba69c960f18c882059bf4ae48fcaba08..1a57df46af85cc04fc3c17b741fe6ed4d2c0a9ac 100644
--- a/third_party/WebKit/Source/modules/shapedetection/FaceDetector.cpp
+++ b/third_party/WebKit/Source/modules/shapedetection/FaceDetector.cpp
@@ -6,29 +6,28 @@
#include "core/dom/DOMException.h"
#include "core/dom/DOMRect.h"
-#include "core/frame/LocalFrame.h"
#include "core/html/canvas/CanvasImageSource.h"
#include "modules/shapedetection/DetectedFace.h"
#include "modules/shapedetection/FaceDetectorOptions.h"
#include "public/platform/InterfaceProvider.h"
+#include "public/platform/Platform.h"
#include "services/shape_detection/public/interfaces/facedetection_provider.mojom-blink.h"
namespace blink {
-FaceDetector* FaceDetector::create(Document& document,
- const FaceDetectorOptions& options) {
- return new FaceDetector(*document.frame(), options);
+FaceDetector* FaceDetector::create(const FaceDetectorOptions& options) {
+ return new FaceDetector(options);
}
-FaceDetector::FaceDetector(LocalFrame& frame,
- const FaceDetectorOptions& options)
- : ShapeDetector(frame) {
+FaceDetector::FaceDetector(const FaceDetectorOptions& options)
+ : ShapeDetector() {
shape_detection::mojom::blink::FaceDetectorOptionsPtr faceDetectorOptions =
shape_detection::mojom::blink::FaceDetectorOptions::New();
faceDetectorOptions->max_detected_faces = options.maxDetectedFaces();
faceDetectorOptions->fast_mode = options.fastMode();
shape_detection::mojom::blink::FaceDetectionProviderPtr provider;
- frame.interfaceProvider()->getInterface(mojo::MakeRequest(&provider));
+ Platform::current()->interfaceProvider()->getInterface(
+ mojo::MakeRequest(&provider));
provider->CreateFaceDetection(mojo::MakeRequest(&m_faceService),
std::move(faceDetectorOptions));

Powered by Google App Engine
This is Rietveld 408576698