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

Side by Side Diff: mojo/public/js/new_bindings/router.js

Issue 2891193002: Mojo JS bindings: switch all mojo/ layout tests to use the new mode. (Closed)
Patch Set: . Created 3 years, 7 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 (function() { 5 (function() {
6 var internal = mojo.internal; 6 var internal = mojo.internal;
7 7
8 /** 8 /**
9 * The state of |endpoint|. If both the endpoint and its peer have been 9 * The state of |endpoint|. If both the endpoint and its peer have been
10 * closed, removes it from |endpoints_|. 10 * closed, removes it from |endpoints_|.
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 }; 224 };
225 225
226 Router.prototype.close = function() { 226 Router.prototype.close = function() {
227 this.connector_.close(); 227 this.connector_.close();
228 // Closing the message pipe won't trigger connection error handler. 228 // Closing the message pipe won't trigger connection error handler.
229 // Explicitly call onPipeConnectionError() so that associated endpoints 229 // Explicitly call onPipeConnectionError() so that associated endpoints
230 // will get notified. 230 // will get notified.
231 this.onPipeConnectionError(); 231 this.onPipeConnectionError();
232 }; 232 };
233 233
234 Router.prototype.waitForNextMessageForTesting = function() {
235 this.connector_.waitForNextMessageForTesting();
236 };
237
238 Router.prototype.onPeerAssociatedEndpointClosed = function(interfaceId, 234 Router.prototype.onPeerAssociatedEndpointClosed = function(interfaceId,
239 reason) { 235 reason) {
240 check(!internal.isMasterInterfaceId(interfaceId) || reason); 236 check(!internal.isMasterInterfaceId(interfaceId) || reason);
241 237
242 var endpoint = this.endpoints_.get(interfaceId); 238 var endpoint = this.endpoints_.get(interfaceId);
243 if (!endpoint) { 239 if (!endpoint) {
244 endpoint = new InterfaceEndpoint(this, interfaceId); 240 endpoint = new InterfaceEndpoint(this, interfaceId);
245 this.endpoints_.set(interfaceId, endpoint); 241 this.endpoints_.set(interfaceId, endpoint);
246 } 242 }
247 243
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 } else { 301 } else {
306 endpoint.peerClosed = true; 302 endpoint.peerClosed = true;
307 } 303 }
308 if (endpoint.closed && endpoint.peerClosed) { 304 if (endpoint.closed && endpoint.peerClosed) {
309 this.endpoints_.delete(endpoint.id); 305 this.endpoints_.delete(endpoint.id);
310 } 306 }
311 }; 307 };
312 308
313 internal.Router = Router; 309 internal.Router = Router;
314 })(); 310 })();
OLDNEW
« no previous file with comments | « mojo/public/js/new_bindings/lib/interface_endpoint_client.js ('k') | mojo/public/js/new_bindings/validator.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698