Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
michael@0 | 2 | * |
michael@0 | 3 | * This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 6 | |
michael@0 | 7 | #include "nsISupports.idl" |
michael@0 | 8 | |
michael@0 | 9 | interface nsIChannel; |
michael@0 | 10 | interface nsIPrincipal; |
michael@0 | 11 | interface nsIURI; |
michael@0 | 12 | |
michael@0 | 13 | [scriptable, uuid(a5e61a3c-51bd-45be-ac0c-e87b71860656)] |
michael@0 | 14 | interface nsIRefreshURI : nsISupports { |
michael@0 | 15 | /** |
michael@0 | 16 | * Load a uri after waiting for aMillis milliseconds. If the docshell |
michael@0 | 17 | * is busy loading a page currently, the refresh request will be |
michael@0 | 18 | * queued and executed when the current load finishes. |
michael@0 | 19 | * |
michael@0 | 20 | * @param aUri The uri to refresh. |
michael@0 | 21 | * @param aMillis The number of milliseconds to wait. |
michael@0 | 22 | * @param aRepeat Flag to indicate if the uri is to be |
michael@0 | 23 | * repeatedly refreshed every aMillis milliseconds. |
michael@0 | 24 | * @param aMetaRefresh Flag to indicate if this is a Meta refresh. |
michael@0 | 25 | */ |
michael@0 | 26 | void refreshURI(in nsIURI aURI, in long aMillis, in boolean aRepeat, |
michael@0 | 27 | in boolean aMetaRefresh); |
michael@0 | 28 | |
michael@0 | 29 | /** |
michael@0 | 30 | * Loads a URI immediately as if it were a refresh. |
michael@0 | 31 | * |
michael@0 | 32 | * @param aURI The URI to refresh. |
michael@0 | 33 | * @param aMillis The number of milliseconds by which this refresh would |
michael@0 | 34 | * be delayed if it were not being forced. |
michael@0 | 35 | * @param aMetaRefresh Flag to indicate if this is a meta refresh. |
michael@0 | 36 | */ |
michael@0 | 37 | void forceRefreshURI(in nsIURI aURI, in long aMillis, in boolean aMetaRefresh); |
michael@0 | 38 | |
michael@0 | 39 | /** |
michael@0 | 40 | * Checks the passed in channel to see if there is a refresh header, |
michael@0 | 41 | * if there is, will setup a timer to refresh the uri found |
michael@0 | 42 | * in the header. If docshell is busy loading a page currently, the |
michael@0 | 43 | * request will be queued and executed when the current page |
michael@0 | 44 | * finishes loading. |
michael@0 | 45 | * |
michael@0 | 46 | * Returns the NS_REFRESHURI_HEADER_FOUND success code if a refresh |
michael@0 | 47 | * header was found and successfully setup. |
michael@0 | 48 | * |
michael@0 | 49 | * @param aChannel The channel to be parsed. |
michael@0 | 50 | */ |
michael@0 | 51 | void setupRefreshURI(in nsIChannel aChannel); |
michael@0 | 52 | |
michael@0 | 53 | /** |
michael@0 | 54 | * Parses the passed in header string and sets up a refreshURI if |
michael@0 | 55 | * a "refresh" header is found. If docshell is busy loading a page |
michael@0 | 56 | * currently, the request will be queued and executed when |
michael@0 | 57 | * the current page finishes loading. |
michael@0 | 58 | * |
michael@0 | 59 | * @param aBaseURI base URI to resolve refresh uri with. |
michael@0 | 60 | * @param principal the associated principal |
michael@0 | 61 | * @param aHeader The meta refresh header string. |
michael@0 | 62 | */ |
michael@0 | 63 | void setupRefreshURIFromHeader(in nsIURI aBaseURI, in nsIPrincipal principal, in ACString aHeader); |
michael@0 | 64 | |
michael@0 | 65 | /** |
michael@0 | 66 | * Cancels all timer loads. |
michael@0 | 67 | */ |
michael@0 | 68 | void cancelRefreshURITimers(); |
michael@0 | 69 | |
michael@0 | 70 | /** |
michael@0 | 71 | * True when there are pending refreshes, false otherwise. |
michael@0 | 72 | */ |
michael@0 | 73 | readonly attribute boolean refreshPending; |
michael@0 | 74 | }; |