blob: e205e34e54d32d18dc04457ac7577c97fe4b6219 [file] [log] [blame]
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// TODO(ricea): Add standard link when there is one.
[
Constructor(USVString url, optional WebSocketStreamOptions options),
ConstructorCallWith=ScriptState,
Exposed=(Window,Worker),
RaisesException=Constructor,
RuntimeEnabled=WebSocketStream,
ActiveScriptWrappable,
MeasureAs=WebSocketStreamConstructor
] interface WebSocketStream {
readonly attribute USVString url;
[CallWith=ScriptState] readonly attribute Promise<WebSocketConnection> connection;
[CallWith=ScriptState] readonly attribute Promise<WebSocketCloseInfo> closed;
[RaisesException] void close(optional WebSocketCloseInfo closeInfo);
};