Index: third_party/WebKit/Source/modules/websockets/WebSocketChannel.h |
diff --git a/third_party/WebKit/Source/modules/websockets/WebSocketChannel.h b/third_party/WebKit/Source/modules/websockets/WebSocketChannel.h |
index d41e3c5e6d85f3a7e3e976f5b680930b54dcbb8f..5031e427e42cb9a16dcd236a1d99208930d0f520 100644 |
--- a/third_party/WebKit/Source/modules/websockets/WebSocketChannel.h |
+++ b/third_party/WebKit/Source/modules/websockets/WebSocketChannel.h |
@@ -70,6 +70,11 @@ public: |
CloseEventCodeMaximumUserDefined = 4999 |
}; |
+ enum BinaryType { |
+ BinaryTypeBlob, |
+ BinaryTypeArrayBuffer, |
+ }; |
+ |
virtual bool connect(const KURL&, const String& protocol) = 0; |
virtual void send(const CString&) = 0; |
virtual void send(const DOMArrayBuffer&, unsigned byteOffset, unsigned byteLength) = 0; |
@@ -82,6 +87,11 @@ public: |
// Do not call |send| after calling this method. |
virtual void close(int code, const String& reason) = 0; |
+ // Change binary mode. This controls whether didReceiveArrayBuffer or didReceiveBlob is called in responnse to a |
+ // binary message. The effect is not instant, so the WebSocketChannelClient has to be prepared to receive a Blob |
+ // even after changing binary type to ArrayBuffer, and vice-versa. |
+ virtual void changeBinaryType(BinaryType) = 0; |
+ |
// Log the reason text and close the connection. Will call didClose(). |
// The MessageLevel parameter will be used for the level of the message |
// shown at the devtool console. |