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

Unified Diff: third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js

Issue 2556353004: Mojo JS bindings: code generator maps interface ptr and request to InterfacePtr and InterfaceReques… (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/sensor/resources/sensor-helpers.js
diff --git a/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js b/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js
index ff79ae5f2cdf1b6b09ea6fe49d89e83ee6e80ead..262145feca1793baebf1d93189cdde29be69e497 100644
--- a/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js
+++ b/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js
@@ -244,10 +244,10 @@ function sensor_mocks(mojo) {
}
// Returns initialized Sensor proxy to the client.
- getSensor(type, stub) {
+ getSensor(type, request) {
if (this.get_sensor_should_fail_) {
- return getSensorResponse(null,
- connection.bindProxy(null, sensor.SensorClient));
+ var ignored = new sensor.SensorClientPtr();
+ return getSensorResponse(null, bindings.makeRequest(ignored));
}
let offset =
@@ -258,6 +258,7 @@ function sensor_mocks(mojo) {
}
if (this.active_sensor_ == null) {
+ var stub = connection.bindHandleToStub(request.handle, sensor.Sensor);
let mockSensor = new MockSensor(stub, this.shared_buffer_handle_,
offset, this.reading_size_in_bytes_, reporting_mode);
this.active_sensor_ = mockSensor;
@@ -284,10 +285,11 @@ function sensor_mocks(mojo) {
this.resolve_func_(this.active_sensor_);
}
- var client_handle = connection.bindProxy(proxy => {
- this.active_sensor_.client_ = proxy;
- }, sensor.SensorClient);
- return getSensorResponse(init_params, client_handle);
+ var client_request = new bindings.InterfaceRequest(
+ connection.bindProxy(proxy => {
+ this.active_sensor_.client_ = proxy;
+ }, sensor.SensorClient));
+ return getSensorResponse(init_params, client_request);
}
// Binds object to mojo message pipe

Powered by Google App Engine
This is Rietveld 408576698