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

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

Issue 2788403002: Revert of Introduce InterfaceEndpointClient(IEC), InterfaceEndpointHandle and (Closed)
Patch Set: 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
« no previous file with comments | « mojo/public/js/codec.js ('k') | mojo/public/js/constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/js/connector.js
diff --git a/mojo/public/js/connector.js b/mojo/public/js/connector.js
index 012e3c7c07b46b12d6490701c20144a4641a9277..4d0627865337f19e231d69306e088054fe9ea36b 100644
--- a/mojo/public/js/connector.js
+++ b/mojo/public/js/connector.js
@@ -78,6 +78,10 @@
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);
@@ -92,12 +96,9 @@
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();
+ this.errorHandler_.onError(read.result);
return;
}
var messageBuffer = new buffer.Buffer(read.buffer);
« no previous file with comments | « mojo/public/js/codec.js ('k') | mojo/public/js/constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698