Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 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. | |
| 4 | |
| 5 module extensions.mime_handler; | |
| 6 | |
| 7 // Information about a stream. | |
| 8 struct StreamInfo { | |
| 9 // The MIME type of the intercepted URL request. | |
| 10 string mime_type; | |
| 11 | |
| 12 // The original URL that was intercepted. | |
| 13 string original_url; | |
| 14 | |
| 15 // The URL that the stream can be read from. | |
| 16 string stream_url; | |
| 17 | |
| 18 // The ID of the tab that opened the stream. If the stream is not opened in a | |
| 19 // tab, it will be -1. | |
| 20 int32 tab_id; | |
| 21 | |
| 22 // The amount of data the Stream should contain, if known. If there is no | |
| 23 // information on the size it will be -1. | |
| 24 int64 expected_content_size; | |
| 25 | |
| 26 // The HTTP response headers of the intercepted request stored as a dictionary | |
| 27 // mapping header name to header value. If a header name appears multiple | |
| 28 // times, the header values are merged in the dictionary and separated by a ", | |
|
raymes
2015/01/12 05:26:04
nit: maybe push " onto the next line
Sam McNally
2015/01/12 07:13:35
Done.
| |
| 29 // ". | |
| 30 map<string, string> response_headers; | |
| 31 | |
| 32 // Whether the stream is embedded within another document. | |
| 33 bool embedded; | |
| 34 }; | |
| 35 | |
| 36 interface MimeHandlerService { | |
| 37 // Returns information about the stream associated with this service instance. | |
| 38 // If the stream has been aborted, |stream_info| will be null. | |
| 39 GetStreamInfo() => (StreamInfo? stream_info); | |
| 40 | |
| 41 // Aborts the stream associated with this service instance. This is an | |
| 42 // idempotent operation. | |
| 43 AbortStream() => (); | |
|
raymes
2015/01/12 05:26:04
Maybe we should have a callback for this so we can
Sam McNally
2015/01/12 07:13:35
It does have a callback. It just didn't bother wai
| |
| 44 }; | |
| OLD | NEW |