| Index: mojo/public/js/connector.js
|
| diff --git a/mojo/public/js/connector.js b/mojo/public/js/connector.js
|
| index 012e3c7c07b46b12d6490701c20144a4641a9277..d51b429d7d012e03283a43baf7fd34fc7481c39c 100644
|
| --- a/mojo/public/js/connector.js
|
| +++ b/mojo/public/js/connector.js
|
| @@ -18,6 +18,7 @@ define("mojo/public/js/connector", [
|
| this.incomingReceiver_ = null;
|
| this.readWatcher_ = null;
|
| this.errorHandler_ = null;
|
| + this.paused_ = false;
|
|
|
| if (handle) {
|
| this.readWatcher_ = support.watch(handle,
|
| @@ -37,6 +38,31 @@ define("mojo/public/js/connector", [
|
| }
|
| };
|
|
|
| + Connector.prototype.pauseIncomingMethodCallProcessing = function() {
|
| + if (this.paused_) {
|
| + return;
|
| + }
|
| + this.paused_= true;
|
| +
|
| + if (this.readWatcher_) {
|
| + support.cancelWatch(this.readWatcher_);
|
| + this.readWatcher_ = null;
|
| + }
|
| + };
|
| +
|
| + Connector.prototype.resumeIncomingMethodCallProcessing = function() {
|
| + if (!this.paused_) {
|
| + return;
|
| + }
|
| + this.paused_= false;
|
| +
|
| + if (this.handle_) {
|
| + this.readWatcher_ = support.watch(this.handle_,
|
| + core.HANDLE_SIGNAL_READABLE,
|
| + this.readMore_.bind(this));
|
| + }
|
| + };
|
| +
|
| Connector.prototype.accept = function(message) {
|
| if (this.error_)
|
| return false;
|
| @@ -85,6 +111,10 @@ define("mojo/public/js/connector", [
|
|
|
| Connector.prototype.readMore_ = function(result) {
|
| for (;;) {
|
| + if (this.paused_) {
|
| + return;
|
| + }
|
| +
|
| var read = core.readMessage(this.handle_,
|
| core.READ_MESSAGE_FLAG_NONE);
|
| if (this.handle_ == null) // The connector has been closed.
|
|
|