Index: public/platform/WebSocketChannelHandleClient.h |
diff --git a/public/platform/WebSocketStreamHandleClient.h b/public/platform/WebSocketChannelHandleClient.h |
similarity index 65% |
copy from public/platform/WebSocketStreamHandleClient.h |
copy to public/platform/WebSocketChannelHandleClient.h |
index 4f392411056f2160f1691d48470a2f2807c8c899..a0701b34153f1443907d4b27d2a14d77251118c0 100644 |
--- a/public/platform/WebSocketStreamHandleClient.h |
+++ b/public/platform/WebSocketChannelHandleClient.h |
@@ -1,5 +1,5 @@ |
/* |
- * Copyright (C) 2009 Google Inc. All rights reserved. |
+ * Copyright (C) 2013 Google Inc. All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are |
@@ -28,37 +28,34 @@ |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
-#ifndef WebSocketStreamHandleClient_h |
-#define WebSocketStreamHandleClient_h |
+#ifndef WebSocketChannelHandleClient_h |
+#define WebSocketChannelHandleClient_h |
#include "WebCommon.h" |
+#include "public/platform/WebSocketChannelHandle.h" |
namespace WebKit { |
class WebData; |
-class WebSocketStreamError; |
-class WebSocketStreamHandle; |
+class WebString; |
class WebURL; |
-class WebSocketStreamHandleClient { |
+// FIXME: This class should replace WebSocketStreamHandleClient. |
+class WebSocketChannelHandleClient { |
public: |
- |
- // Called when Socket Stream is opened. |
- virtual void didOpenStream(WebSocketStreamHandle*, int /* maxPendingSendAllowed */) = 0; |
- |
- // Called when |amountSent| bytes are sent. |
- virtual void didSendData(WebSocketStreamHandle*, int /* amountSent */) = 0; |
+ // Called when the handle is opened. |
+ virtual void didConnect(WebSocketChannelHandle*, bool /* succeed */, const WebString& selectedProtocol, const WebString& extensions) = 0; |
// Called when data are received. |
- virtual void didReceiveData(WebSocketStreamHandle*, const WebData&) = 0; |
+ virtual void didReceiveData(WebSocketChannelHandle*, const WebData&, WebSocketChannelHandle::MessageType, bool fin) = 0; |
- // Called when Socket Stream is closed. |
- virtual void didClose(WebSocketStreamHandle*) = 0; |
+ // Called when the handle is closed. |
+ virtual void didClose(WebSocketChannelHandle*, unsigned short code, const WebString& reason) = 0; |
- // Called when Socket Stream has an error. |
- virtual void didFail(WebSocketStreamHandle*, const WebSocketStreamError&) = 0; |
+ virtual void didReceiveFlowControl(WebSocketChannelHandle*, int64_t quota) = 0; |
}; |
} // namespace WebKit |
-#endif |
+#endif // WebSocketChannelHandleClient_h |
+ |