summaryrefslogtreecommitdiff
path: root/Source/WebKit/chromium/public/WebSocket.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit/chromium/public/WebSocket.h')
-rw-r--r--Source/WebKit/chromium/public/WebSocket.h23
1 files changed, 19 insertions, 4 deletions
diff --git a/Source/WebKit/chromium/public/WebSocket.h b/Source/WebKit/chromium/public/WebSocket.h
index f00b7957a..c10c372ad 100644
--- a/Source/WebKit/chromium/public/WebSocket.h
+++ b/Source/WebKit/chromium/public/WebSocket.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
+ * Copyright (C) 2011, 2012 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
@@ -38,7 +38,7 @@ namespace WebCore { class WebSocketChannel; }
namespace WebKit {
-class WebData;
+class WebArrayBuffer;
class WebDocument;
class WebString;
class WebURL;
@@ -60,13 +60,28 @@ public:
CloseEventCodeMaximumUserDefined = 4999
};
+ enum BinaryType {
+ BinaryTypeBlob = 0,
+ BinaryTypeArrayBuffer = 1
+ };
+
WEBKIT_EXPORT static WebSocket* create(const WebDocument&, WebSocketClient*);
virtual ~WebSocket() { }
+ // These functions come from binaryType attribute of the WebSocket API
+ // specification. It specifies binary object type for receiving binary
+ // frames representation. Receiving text frames are always mapped to
+ // WebString type regardless of this attribute.
+ // Default type is BinaryTypeBlob. But currently it is not supported.
+ // Set BinaryTypeArrayBuffer here ahead of using binary communication.
+ // See also, The WebSocket API - http://www.w3.org/TR/websockets/ .
+ virtual BinaryType binaryType() const = 0;
+ virtual bool setBinaryType(BinaryType) = 0;
+
virtual void connect(const WebURL&, const WebString& protocol) = 0;
virtual WebString subprotocol() = 0;
- virtual bool sendText(const WebString& message) = 0;
- virtual bool sendBinary(const WebData& binaryData) = 0;
+ virtual bool sendText(const WebString&) = 0;
+ virtual bool sendArrayBuffer(const WebArrayBuffer&) = 0;
virtual unsigned long bufferedAmount() const = 0;
virtual void close(int code, const WebString& reason) = 0;
virtual void fail(const WebString& reason) = 0;