Thu, 15 Jan 2015 15:59:08 +0100
Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #include "nsIProxiedChannel.idl" |
michael@0 | 7 | |
michael@0 | 8 | interface nsILoadGroup; |
michael@0 | 9 | interface nsIURI; |
michael@0 | 10 | interface nsIInterfaceRequestor; |
michael@0 | 11 | typedef unsigned long nsLoadFlags; |
michael@0 | 12 | |
michael@0 | 13 | [scriptable, uuid(701093ac-5c7f-429c-99e3-423b041fccb4)] |
michael@0 | 14 | interface nsIHttpAuthenticableChannel : nsIProxiedChannel |
michael@0 | 15 | { |
michael@0 | 16 | /** |
michael@0 | 17 | * If the channel being authenticated is using SSL. |
michael@0 | 18 | */ |
michael@0 | 19 | readonly attribute boolean isSSL; |
michael@0 | 20 | |
michael@0 | 21 | /** |
michael@0 | 22 | * Returns if the proxy HTTP method used is CONNECT. If no proxy is being |
michael@0 | 23 | * used it must return PR_FALSE. |
michael@0 | 24 | */ |
michael@0 | 25 | readonly attribute boolean proxyMethodIsConnect; |
michael@0 | 26 | |
michael@0 | 27 | /** |
michael@0 | 28 | * Cancels the current request. See nsIRequest. |
michael@0 | 29 | */ |
michael@0 | 30 | void cancel(in nsresult aStatus); |
michael@0 | 31 | |
michael@0 | 32 | /** |
michael@0 | 33 | * The load flags of this request. See nsIRequest. |
michael@0 | 34 | */ |
michael@0 | 35 | readonly attribute nsLoadFlags loadFlags; |
michael@0 | 36 | |
michael@0 | 37 | /** |
michael@0 | 38 | * The URI corresponding to the channel. See nsIChannel. |
michael@0 | 39 | */ |
michael@0 | 40 | readonly attribute nsIURI URI; |
michael@0 | 41 | |
michael@0 | 42 | /** |
michael@0 | 43 | * The load group of this request. It is here for querying its |
michael@0 | 44 | * notificationCallbacks. See nsIRequest. |
michael@0 | 45 | */ |
michael@0 | 46 | readonly attribute nsILoadGroup loadGroup; |
michael@0 | 47 | |
michael@0 | 48 | /** |
michael@0 | 49 | * The notification callbacks for the channel. See nsIChannel. |
michael@0 | 50 | */ |
michael@0 | 51 | readonly attribute nsIInterfaceRequestor notificationCallbacks; |
michael@0 | 52 | |
michael@0 | 53 | /** |
michael@0 | 54 | * The HTTP request method. See nsIHttpChannel. |
michael@0 | 55 | */ |
michael@0 | 56 | readonly attribute ACString requestMethod; |
michael@0 | 57 | |
michael@0 | 58 | /** |
michael@0 | 59 | * The "Server" response header. |
michael@0 | 60 | * Return NS_ERROR_NOT_AVAILABLE if not available. |
michael@0 | 61 | */ |
michael@0 | 62 | readonly attribute ACString serverResponseHeader; |
michael@0 | 63 | |
michael@0 | 64 | /** |
michael@0 | 65 | * The Proxy-Authenticate response header. |
michael@0 | 66 | */ |
michael@0 | 67 | readonly attribute ACString proxyChallenges; |
michael@0 | 68 | |
michael@0 | 69 | /** |
michael@0 | 70 | * The WWW-Authenticate response header. |
michael@0 | 71 | */ |
michael@0 | 72 | readonly attribute ACString WWWChallenges; |
michael@0 | 73 | |
michael@0 | 74 | /** |
michael@0 | 75 | * Sets the Proxy-Authorization request header. An empty string |
michael@0 | 76 | * will clear it. |
michael@0 | 77 | */ |
michael@0 | 78 | void setProxyCredentials(in ACString credentials); |
michael@0 | 79 | |
michael@0 | 80 | /** |
michael@0 | 81 | * Sets the Authorization request header. An empty string |
michael@0 | 82 | * will clear it. |
michael@0 | 83 | */ |
michael@0 | 84 | void setWWWCredentials(in ACString credentials); |
michael@0 | 85 | |
michael@0 | 86 | /** |
michael@0 | 87 | * Called when authentication information is ready and has been set on this |
michael@0 | 88 | * object using setWWWCredentials/setProxyCredentials. Implementations can |
michael@0 | 89 | * continue with the request and send the given information to the server. |
michael@0 | 90 | * |
michael@0 | 91 | * It is called asynchronously from |
michael@0 | 92 | * nsIHttpChannelAuthProvider::processAuthentication if that method returns |
michael@0 | 93 | * NS_ERROR_IN_PROGRESS. |
michael@0 | 94 | * |
michael@0 | 95 | * @note Any exceptions thrown from this method should be ignored. |
michael@0 | 96 | */ |
michael@0 | 97 | void onAuthAvailable(); |
michael@0 | 98 | |
michael@0 | 99 | /** |
michael@0 | 100 | * Notifies that the prompt was cancelled. It is called asynchronously |
michael@0 | 101 | * from nsIHttpChannelAuthProvider::processAuthentication if that method |
michael@0 | 102 | * returns NS_ERROR_IN_PROGRESS. |
michael@0 | 103 | * |
michael@0 | 104 | * @param userCancel |
michael@0 | 105 | * If the user was cancelled has cancelled the authentication prompt. |
michael@0 | 106 | */ |
michael@0 | 107 | void onAuthCancelled(in boolean userCancel); |
michael@0 | 108 | }; |