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

Unified Diff: extensions/renderer/resources/serial_service.js

Issue 488363002: Implement the host side of serial connection I/O on data pipe. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix win x64 build Created 6 years, 4 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
« no previous file with comments | « extensions/renderer/api/serial/serial_api_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/resources/serial_service.js
diff --git a/extensions/renderer/resources/serial_service.js b/extensions/renderer/resources/serial_service.js
index 00d137b1ea1cac14226803db8fd829650b2c83c7..b8b0970db71ab70e1921064d4570c6ed204a6ae6 100644
--- a/extensions/renderer/resources/serial_service.js
+++ b/extensions/renderer/resources/serial_service.js
@@ -122,7 +122,19 @@ define('serial_service', [
options = options || {};
var serviceOptions = getServiceOptions(options);
var pipe = core.createMessagePipe();
- service.connect(path, serviceOptions, pipe.handle0);
+ // Note: These two are created and closed because the service implementation
+ // requires that we provide valid message pipes for the data source and
+ // sink. Currently the client handles are immediately closed; the real
+ // implementation will come later.
+ var sendPipe = core.createMessagePipe();
+ var receivePipe = core.createMessagePipe();
+ service.connect(path,
+ serviceOptions,
+ pipe.handle0,
+ sendPipe.handle0,
+ receivePipe.handle0);
+ core.close(sendPipe.handle1);
+ core.close(receivePipe.handle1);
var router = new routerModule.Router(pipe.handle1);
var connection = new serialMojom.ConnectionProxy(router);
return connection.getInfo().then(convertServiceInfo).then(
« no previous file with comments | « extensions/renderer/api/serial/serial_api_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698