Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1308)

Unified Diff: Source/modules/websockets/WebSocket.idl

Issue 954933003: Sync the WebSocket interface with the spec (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add TypeChecking=Interface Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/websockets/DocumentWebSocketChannel.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/websockets/WebSocket.idl
diff --git a/Source/modules/websockets/WebSocket.idl b/Source/modules/websockets/WebSocket.idl
index c2a343cd22eff344cdf80919caf67e452b138cb3..c24bc4a235ea077cee863f512cecb7c428c9177e 100644
--- a/Source/modules/websockets/WebSocket.idl
+++ b/Source/modules/websockets/WebSocket.idl
@@ -29,24 +29,24 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// http://dev.w3.org/html5/websockets/#websocket
-// http://www.whatwg.org/specs/web-apps/current-work/multipage/network.html#websocket
+// https://html.spec.whatwg.org/multipage/comms.html#the-websocket-interface
// FIXME: use BinaryType in binaryType
enum BinaryType { "blob", "arraybuffer" };
[
ActiveDOMObject,
- // FIXME: should be optional union type http://crbug.com/240176
- Constructor(DOMString url, optional DOMString protocol),
- Constructor(DOMString url, sequence<DOMString> protocols),
+ // FIXME: Spec has DOMString[]. https://www.w3.org/Bugs/Public/show_bug.cgi?id=28102
+ Constructor(DOMString url, optional (DOMString or sequence<DOMString>) protocols),
ConstructorCallWith=ExecutionContext,
Exposed=(Window,Worker),
+ TypeChecking=Interface,
RaisesException=Constructor,
GarbageCollected,
ImplementedAs=DOMWebSocket,
] interface WebSocket : EventTarget {
- [DeprecateAs=WebSocketURL] readonly attribute DOMString URL; // Lowercased .url is the one in the spec, but leaving .URL for compatibility reasons.
+ // FIXME: Lowercase .url is in the spec, .URL is for compatibility reasons. Remove when possible.
+ [DeprecateAs=WebSocketURL] readonly attribute DOMString URL;
readonly attribute DOMString url;
// ready state
@@ -58,17 +58,19 @@ enum BinaryType { "blob", "arraybuffer" };
readonly attribute unsigned long bufferedAmount;
// networking
- attribute EventHandler onopen;
- attribute EventHandler onerror;
- attribute EventHandler onclose;
+ attribute EventHandler onopen;
+ attribute EventHandler onerror;
+ attribute EventHandler onclose;
+ // FIXME: Per spec and impl, should never return undefined. Verify and remove extended attribute.
[TreatReturnedNullStringAs=Undefined] readonly attribute DOMString extensions;
+ // FIXME: Per spec and impl, should never return undefined. Verify and remove extended attribute.
[TreatReturnedNullStringAs=Undefined] readonly attribute DOMString protocol;
- [RaisesException] void close([Clamp] optional unsigned short code, optional DOMString reason);
+ [RaisesException] void close([Clamp] optional unsigned short code, optional USVString reason);
// messaging
- attribute EventHandler onmessage;
- attribute DOMString binaryType;
- [RaisesException] void send(DOMString data);
+ attribute EventHandler onmessage;
+ attribute DOMString binaryType;
+ [RaisesException] void send(USVString data);
[RaisesException] void send(Blob data);
[RaisesException] void send(ArrayBuffer data);
[RaisesException] void send(ArrayBufferView data);
« no previous file with comments | « Source/modules/websockets/DocumentWebSocketChannel.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698