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

Side by Side Diff: mojo/public/js/associated_bindings.js

Issue 2840333002: Add encounteredError() to AssociatedInterfacePtrController. (Closed)
Patch Set: 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
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/associated_bindings", [ 5 define("mojo/public/js/associated_bindings", [
6 "mojo/public/js/core", 6 "mojo/public/js/core",
7 "mojo/public/js/interface_types", 7 "mojo/public/js/interface_types",
8 "mojo/public/js/lib/interface_endpoint_client", 8 "mojo/public/js/lib/interface_endpoint_client",
9 "mojo/public/js/lib/interface_endpoint_handle", 9 "mojo/public/js/lib/interface_endpoint_handle",
10 ], function(core, types, interfaceEndpointClient, interfaceEndpointHandle) { 10 ], function(core, types, interfaceEndpointClient, interfaceEndpointHandle) {
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 109
110 AssociatedInterfacePtrController.prototype.resetWithReason = function( 110 AssociatedInterfacePtrController.prototype.resetWithReason = function(
111 reason) { 111 reason) {
112 if (this.isBound()) { 112 if (this.isBound()) {
113 this.interfaceEndpointClient_.close(reason); 113 this.interfaceEndpointClient_.close(reason);
114 this.interfaceEndpointClient_ = null; 114 this.interfaceEndpointClient_ = null;
115 } 115 }
116 this.reset(); 116 this.reset();
117 }; 117 };
118 118
119 // Indicates whether an error has been encountered. If true, method calls
120 // on this interface will be dropped (and may already have been dropped).
121 AssociatedInterfacePtrController.prototype.encounteredError = function() {
122 return this.interfaceEndpointClient_ ?
123 this.interfaceEndpointClient_.encounteredError : false;
124 };
125
119 AssociatedInterfacePtrController.prototype.setConnectionErrorHandler = 126 AssociatedInterfacePtrController.prototype.setConnectionErrorHandler =
120 function(callback) { 127 function(callback) {
121 if (!this.isBound()) { 128 if (!this.isBound()) {
122 throw new Error("Cannot set connection error handler if not bound."); 129 throw new Error("Cannot set connection error handler if not bound.");
123 } 130 }
124 131
125 this.interfaceEndpointClient_.setConnectionErrorHandler(callback); 132 this.interfaceEndpointClient_.setConnectionErrorHandler(callback);
126 }; 133 };
127 134
128 AssociatedInterfacePtrController.prototype.passInterface = function() { 135 AssociatedInterfacePtrController.prototype.passInterface = function() {
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 239
233 var exports = {}; 240 var exports = {};
234 exports.AssociatedInterfacePtrInfo = types.AssociatedInterfacePtrInfo; 241 exports.AssociatedInterfacePtrInfo = types.AssociatedInterfacePtrInfo;
235 exports.AssociatedInterfaceRequest = types.AssociatedInterfaceRequest; 242 exports.AssociatedInterfaceRequest = types.AssociatedInterfaceRequest;
236 exports.makeRequest = makeRequest; 243 exports.makeRequest = makeRequest;
237 exports.AssociatedInterfacePtrController = AssociatedInterfacePtrController; 244 exports.AssociatedInterfacePtrController = AssociatedInterfacePtrController;
238 exports.AssociatedBinding = AssociatedBinding; 245 exports.AssociatedBinding = AssociatedBinding;
239 246
240 return exports; 247 return exports;
241 }); 248 });
OLDNEW
« no previous file with comments | « no previous file | mojo/public/js/lib/interface_endpoint_client.js » ('j') | mojo/public/js/lib/interface_endpoint_client.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698