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

Unified Diff: mojo/public/js/connector.js

Issue 2744963002: Introduce InterfaceEndpointClient(IEC), InterfaceEndpointHandle and (Closed)
Patch Set: Add binding.html layout test for connection error with reason. Reset IEC when reset() or close()… Created 3 years, 9 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
Index: mojo/public/js/connector.js
diff --git a/mojo/public/js/connector.js b/mojo/public/js/connector.js
index 4d0627865337f19e231d69306e088054fe9ea36b..012e3c7c07b46b12d6490701c20144a4641a9277 100644
--- a/mojo/public/js/connector.js
+++ b/mojo/public/js/connector.js
@@ -78,10 +78,6 @@ define("mojo/public/js/connector", [
this.errorHandler_ = handler;
};
- Connector.prototype.encounteredError = function() {
- return this.error_;
- };
-
Connector.prototype.waitForNextMessageForTesting = function() {
var wait = core.wait(this.handle_, core.HANDLE_SIGNAL_READABLE);
this.readMore_(wait.result);
@@ -96,9 +92,12 @@ define("mojo/public/js/connector", [
if (read.result == core.RESULT_SHOULD_WAIT)
return;
if (read.result != core.RESULT_OK) {
+ // TODO(wangjimmy): Add a handleError method to swap the handle to be
+ // closed with a dummy handle in the case when
+ // read.result != MOJO_RESULT_FAILED_PRECONDITION
this.error_ = true;
if (this.errorHandler_)
- this.errorHandler_.onError(read.result);
+ this.errorHandler_.onError();
return;
}
var messageBuffer = new buffer.Buffer(read.buffer);

Powered by Google App Engine
This is Rietveld 408576698