| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 package org.chromium.sdk.internal.websocket; | |
| 6 | |
| 7 import java.io.IOException; | |
| 8 | |
| 9 import org.chromium.sdk.RelayOk; | |
| 10 import org.chromium.sdk.SyncCallback; | |
| 11 import org.chromium.sdk.util.SignalRelay; | |
| 12 | |
| 13 /** | |
| 14 * Abstract interface to WebSocket implementation that hides a particular specif
ication | |
| 15 * version. | |
| 16 */ | |
| 17 public interface WsConnection { | |
| 18 | |
| 19 void startListening(Listener listener); | |
| 20 | |
| 21 void sendTextualMessage(String message) throws IOException; | |
| 22 | |
| 23 RelayOk runInDispatchThread(Runnable runnable, SyncCallback syncCallback); | |
| 24 | |
| 25 SignalRelay<?> getCloser(); | |
| 26 | |
| 27 interface Listener { | |
| 28 void textMessageRecieved(String text); | |
| 29 | |
| 30 /** | |
| 31 * Some non-fatal error happened. | |
| 32 */ | |
| 33 void errorMessage(Exception ex); | |
| 34 | |
| 35 /** | |
| 36 * Connection has been closed. Message is called from Dispatch thread. | |
| 37 */ | |
| 38 void eofMessage(); | |
| 39 } | |
| 40 } | |
| OLD | NEW |