| Index: mojo/bindings/java/src/org/chromium/mojo/bindings/Connector.java
|
| diff --git a/mojo/bindings/java/src/org/chromium/mojo/bindings/Connector.java b/mojo/bindings/java/src/org/chromium/mojo/bindings/Connector.java
|
| index 9c74fbd776d48aaf1e0ee9a6505bc101cafcf142..257f6f8749fc64f80f416bd97e36d746c87582e8 100644
|
| --- a/mojo/bindings/java/src/org/chromium/mojo/bindings/Connector.java
|
| +++ b/mojo/bindings/java/src/org/chromium/mojo/bindings/Connector.java
|
| @@ -21,13 +21,6 @@ import org.chromium.mojo.system.MojoResult;
|
| public class Connector implements MessageReceiver, HandleOwner<MessagePipeHandle> {
|
|
|
| /**
|
| - * An {@link ErrorHandler} is notified of error happening while using the message pipe.
|
| - */
|
| - interface ErrorHandler {
|
| - public void onError(MojoException e);
|
| - }
|
| -
|
| - /**
|
| * The callback that is notified when the state of the owned handle changes.
|
| */
|
| private final AsyncWaiterCallback mAsyncWaiterCallback = new AsyncWaiterCallback();
|
| @@ -55,14 +48,14 @@ public class Connector implements MessageReceiver, HandleOwner<MessagePipeHandle
|
| /**
|
| * The error handler to notify of errors.
|
| */
|
| - private ErrorHandler mErrorHandler;
|
| + private ConnectionErrorHandler mErrorHandler;
|
|
|
| /**
|
| * Create a new connector over a |messagePipeHandle|. The created connector will use the default
|
| * {@link AsyncWaiter} from the {@link Core} implementation of |messagePipeHandle|.
|
| */
|
| public Connector(MessagePipeHandle messagePipeHandle) {
|
| - this(messagePipeHandle, getDefaultAsyncWaiterForMessagePipe(messagePipeHandle));
|
| + this(messagePipeHandle, BindingsHelper.getDefaultAsyncWaiterForHandle(messagePipeHandle));
|
| }
|
|
|
| /**
|
| @@ -83,9 +76,10 @@ public class Connector implements MessageReceiver, HandleOwner<MessagePipeHandle
|
| }
|
|
|
| /**
|
| - * Set the {@link ErrorHandler} that will be notified of errors on the owned message pipe.
|
| + * Set the {@link ConnectionErrorHandler} that will be notified of errors on the owned message
|
| + * pipe.
|
| */
|
| - public void setErrorHandler(ErrorHandler errorHandler) {
|
| + public void setErrorHandler(ConnectionErrorHandler errorHandler) {
|
| mErrorHandler = errorHandler;
|
| }
|
|
|
| @@ -133,15 +127,6 @@ public class Connector implements MessageReceiver, HandleOwner<MessagePipeHandle
|
| mMessagePipeHandle.close();
|
| }
|
|
|
| - private static AsyncWaiter getDefaultAsyncWaiterForMessagePipe(
|
| - MessagePipeHandle messagePipeHandle) {
|
| - if (messagePipeHandle.getCore() != null) {
|
| - return messagePipeHandle.getCore().getDefaultAsyncWaiter();
|
| - } else {
|
| - return null;
|
| - }
|
| - }
|
| -
|
| private class AsyncWaiterCallback implements AsyncWaiter.Callback {
|
|
|
| /**
|
| @@ -178,7 +163,7 @@ public class Connector implements MessageReceiver, HandleOwner<MessagePipeHandle
|
| mCancellable = null;
|
| close();
|
| if (mErrorHandler != null) {
|
| - mErrorHandler.onError(exception);
|
| + mErrorHandler.onConnectionError(exception);
|
| }
|
| }
|
|
|
| @@ -222,5 +207,4 @@ public class Connector implements MessageReceiver, HandleOwner<MessagePipeHandle
|
| mCancellable = null;
|
| }
|
| }
|
| -
|
| -}
|
| +}
|
|
|