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

Unified Diff: third_party/WebKit/LayoutTests/shapedetection/resources/mock-barcodedetection.js

Issue 2590393002: Revert of Mojo JS bindings: switch most usage of "connection"/"router" module to "bindings". (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/shapedetection/resources/mock-barcodedetection.js
diff --git a/third_party/WebKit/LayoutTests/shapedetection/resources/mock-barcodedetection.js b/third_party/WebKit/LayoutTests/shapedetection/resources/mock-barcodedetection.js
index 8395550f40c19562c312e7f1b9839afffc3bf72f..ed870babd3f34f07c3743cc48a72a75c2af133d2 100644
--- a/third_party/WebKit/LayoutTests/shapedetection/resources/mock-barcodedetection.js
+++ b/third_party/WebKit/LayoutTests/shapedetection/resources/mock-barcodedetection.js
@@ -4,18 +4,22 @@
'mockBarcodeDetection',
['third_party/WebKit/public/platform/modules/shapedetection/barcodedetection.mojom',
'mojo/public/js/bindings',
+ 'mojo/public/js/connection',
'mojo/public/js/core',
'content/public/renderer/frame_interfaces',
- ], (barcodeDetection, bindings, mojo, interfaces) => {
+ ], (barcodeDetection, bindings, connection, mojo, interfaces) => {
class MockBarcodeDetection {
constructor() {
- this.bindingSet_ = new bindings.BindingSet(
- barcodeDetection.BarcodeDetection);
-
interfaces.addInterfaceOverrideForTesting(
barcodeDetection.BarcodeDetection.name,
- handle => this.bindingSet_.addBinding(this, handle));
+ pipe => this.bindToPipe(pipe));
+ }
+
+ bindToPipe(pipe) {
+ this.stub_ = connection.bindHandleToStub(pipe,
+ barcodeDetection.BarcodeDetection);
+ bindings.StubBindings(this.stub_).delegate = this;
}
detect(frame_data, width, height) {

Powered by Google App Engine
This is Rietveld 408576698