|  | // 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. | 
|  |  | 
|  | [ | 
|  | Exposed=(Window,Worker), | 
|  | RuntimeEnabled=WebSocketStream, | 
|  | ActiveScriptWrappable | 
|  | ] interface WebSocketStream { | 
|  | [CallWith=ScriptState, RaisesException, MeasureAs=WebSocketStreamConstructor] constructor(USVString url, optional WebSocketStreamOptions options = {}); | 
|  | readonly attribute USVString url; | 
|  | [CallWith=ScriptState] readonly attribute Promise<WebSocketConnection> connection; | 
|  | [CallWith=ScriptState] readonly attribute Promise<WebSocketCloseInfo> closed; | 
|  | [RaisesException] void close(optional WebSocketCloseInfo closeInfo = {}); | 
|  | }; |