1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // Streams Private API.
6 namespace streamsPrivate
{
7 dictionary StreamInfo
{
8 // The MIME type of the intercepted URL request.
11 // The original URL that was intercepted.
12 DOMString originalUrl
;
14 // The URL that the stream can be read from.
17 // The ID of the tab that opened the stream. If the stream is not opened in
18 // a tab, it will be -1.
21 // The ID of the view that will render the stream, if the viewer was opened
25 // The amount of data the Stream should contain, if known. If there is no
26 // information on the size it will be -1.
27 long expectedContentSize
;
29 // The HTTP response headers of the intercepted request stored as a
30 // dictionary mapping header name to header value. If a header name appears
31 // multiple times, the header values are merged in the dictionary and
32 // separated by a ", ".
33 object responseHeaders
;
35 // Whether the stream is embedded within another document.
39 callback AbortCallback
= void ();
42 // Abort the URL request on the given stream.
43 // |streamUrl| : The URL of the stream to abort.
44 // |callback| : Called when the stream URL is guaranteed to be invalid. The
45 // underlying URL request may not yet have been aborted when this is run.
46 static
void abort
(DOMString streamUrl
,
47 optional AbortCallback
callback);
51 // Fired when a resource is fetched which matches a mime type handled by
52 // this extension. The resource request is cancelled, and the extension is
53 // expected to handle the request. The event is restricted to a small number
54 // of white-listed extensions.
55 static
void onExecuteMimeTypeHandler
(StreamInfo streamInfo
);