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

Side by Side Diff: mojo/public/js/lib/control_message_handler.js

Issue 2820783002: Add associated interfaces & bindings. (Closed)
Patch Set: Change Router.prototype.accept. Add a TODO for endpoint client not attached. Created 3 years, 8 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
« no previous file with comments | « mojo/public/js/codec.js ('k') | mojo/public/js/lib/control_message_proxy.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 define("mojo/public/js/lib/control_message_handler", [ 5 define("mojo/public/js/lib/control_message_handler", [
6 "mojo/public/interfaces/bindings/interface_control_messages.mojom", 6 "mojo/public/interfaces/bindings/interface_control_messages.mojom",
7 "mojo/public/js/codec", 7 "mojo/public/js/codec",
8 "mojo/public/js/validator", 8 "mojo/public/js/validator",
9 ], function(controlMessages, codec, validator) { 9 ], function(controlMessages, codec, validator) {
10 10
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 controlMessages.QueryVersionResult({'version': interface_version}); 68 controlMessages.QueryVersionResult({'version': interface_version});
69 } 69 }
70 70
71 var runResponseMessageParams = new 71 var runResponseMessageParams = new
72 controlMessages.RunResponseMessageParams(); 72 controlMessages.RunResponseMessageParams();
73 runResponseMessageParams.output = runOutput; 73 runResponseMessageParams.output = runOutput;
74 74
75 var messageName = controlMessages.kRunMessageId; 75 var messageName = controlMessages.kRunMessageId;
76 var payloadSize = controlMessages.RunResponseMessageParams.encodedSize; 76 var payloadSize = controlMessages.RunResponseMessageParams.encodedSize;
77 var requestID = reader.requestID; 77 var requestID = reader.requestID;
78 var builder = new codec.MessageWithRequestIDBuilder(messageName, 78 var builder = new codec.MessageV1Builder(messageName,
79 payloadSize, codec.kMessageIsResponse, requestID); 79 payloadSize, codec.kMessageIsResponse, requestID);
80 builder.encodeStruct(controlMessages.RunResponseMessageParams, 80 builder.encodeStruct(controlMessages.RunResponseMessageParams,
81 runResponseMessageParams); 81 runResponseMessageParams);
82 responder.accept(builder.finish()); 82 responder.accept(builder.finish());
83 return true; 83 return true;
84 } 84 }
85 85
86 function isControlMessage(message) { 86 function isControlMessage(message) {
87 return message.getName() == controlMessages.kRunMessageId || 87 return message.getName() == controlMessages.kRunMessageId ||
88 message.getName() == controlMessages.kRunOrClosePipeMessageId; 88 message.getName() == controlMessages.kRunOrClosePipeMessageId;
(...skipping 13 matching lines...) Expand all
102 validateControlRequestWithResponse(message); 102 validateControlRequestWithResponse(message);
103 return run(message, responder, this.interface_version_); 103 return run(message, responder, this.interface_version_);
104 }; 104 };
105 105
106 var exports = {}; 106 var exports = {};
107 exports.ControlMessageHandler = ControlMessageHandler; 107 exports.ControlMessageHandler = ControlMessageHandler;
108 exports.isControlMessage = isControlMessage; 108 exports.isControlMessage = isControlMessage;
109 109
110 return exports; 110 return exports;
111 }); 111 });
OLDNEW
« no previous file with comments | « mojo/public/js/codec.js ('k') | mojo/public/js/lib/control_message_proxy.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698