Sat, 03 Jan 2015 20:18:00 +0100
Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.
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 | /* |
michael@0 | 7 | |
michael@0 | 8 | Interfaces for the RDF/XML sink, which parses RDF/XML into |
michael@0 | 9 | a graph representation. |
michael@0 | 10 | |
michael@0 | 11 | */ |
michael@0 | 12 | |
michael@0 | 13 | #include "nsISupports.idl" |
michael@0 | 14 | |
michael@0 | 15 | // XXX Until these get scriptable. See nsIRDFXMLSink::AddNameSpace() |
michael@0 | 16 | [ptr] native nsIAtomPtr(nsIAtom); |
michael@0 | 17 | [ref] native nsStringRef(nsString); |
michael@0 | 18 | %{C++ |
michael@0 | 19 | class nsIAtom; |
michael@0 | 20 | class nsString; |
michael@0 | 21 | %} |
michael@0 | 22 | |
michael@0 | 23 | interface nsIRDFXMLSink; |
michael@0 | 24 | |
michael@0 | 25 | /** |
michael@0 | 26 | * An observer that is notified as progress is made on the load |
michael@0 | 27 | * of an RDF/XML document in an <code>nsIRDFXMLSink</code>. |
michael@0 | 28 | */ |
michael@0 | 29 | [scriptable, uuid(EB1A5D30-AB33-11D2-8EC6-00805F29F370)] |
michael@0 | 30 | interface nsIRDFXMLSinkObserver : nsISupports |
michael@0 | 31 | { |
michael@0 | 32 | /** |
michael@0 | 33 | * Called when the load begins. |
michael@0 | 34 | * @param aSink the RDF/XML sink on which the load is beginning. |
michael@0 | 35 | */ |
michael@0 | 36 | void onBeginLoad(in nsIRDFXMLSink aSink); |
michael@0 | 37 | |
michael@0 | 38 | /** |
michael@0 | 39 | * Called when the load is suspended (e.g., for network quantization). |
michael@0 | 40 | * @param aSink the RDF/XML sink that is being interrupted. |
michael@0 | 41 | */ |
michael@0 | 42 | void onInterrupt(in nsIRDFXMLSink aSink); |
michael@0 | 43 | |
michael@0 | 44 | /** |
michael@0 | 45 | * Called when a suspended load is resuming. |
michael@0 | 46 | * @param aSink the RDF/XML sink that is resuming. |
michael@0 | 47 | */ |
michael@0 | 48 | void onResume(in nsIRDFXMLSink aSink); |
michael@0 | 49 | |
michael@0 | 50 | /** |
michael@0 | 51 | * Called when an RDF/XML load completes successfully. |
michael@0 | 52 | * @param aSink the RDF/XML sink that has finished loading. |
michael@0 | 53 | */ |
michael@0 | 54 | void onEndLoad(in nsIRDFXMLSink aSink); |
michael@0 | 55 | |
michael@0 | 56 | /** |
michael@0 | 57 | * Called when an error occurs during the load |
michael@0 | 58 | * @param aSink the RDF/XML sink in which the error occurred |
michael@0 | 59 | * @param aStatus the networking result code |
michael@0 | 60 | * @param aErrorMsg an error message, if applicable |
michael@0 | 61 | */ |
michael@0 | 62 | void onError(in nsIRDFXMLSink aSink, in nsresult aStatus, in wstring aErrorMsg); |
michael@0 | 63 | }; |
michael@0 | 64 | |
michael@0 | 65 | |
michael@0 | 66 | |
michael@0 | 67 | /** |
michael@0 | 68 | * A "sink" that receives and processes RDF/XML. This interface is used |
michael@0 | 69 | * by the RDF/XML parser. |
michael@0 | 70 | */ |
michael@0 | 71 | [scriptable, uuid(EB1A5D31-AB33-11D2-8EC6-00805F29F370)] |
michael@0 | 72 | interface nsIRDFXMLSink : nsISupports |
michael@0 | 73 | { |
michael@0 | 74 | /** |
michael@0 | 75 | * Set to <code>true</code> if the sink is read-only and cannot |
michael@0 | 76 | * be modified |
michael@0 | 77 | */ |
michael@0 | 78 | attribute boolean readOnly; |
michael@0 | 79 | |
michael@0 | 80 | /** |
michael@0 | 81 | * Initiate the RDF/XML load. |
michael@0 | 82 | */ |
michael@0 | 83 | void beginLoad(); |
michael@0 | 84 | |
michael@0 | 85 | /** |
michael@0 | 86 | * Suspend the RDF/XML load. |
michael@0 | 87 | */ |
michael@0 | 88 | void interrupt(); |
michael@0 | 89 | |
michael@0 | 90 | /** |
michael@0 | 91 | * Resume the RDF/XML load. |
michael@0 | 92 | */ |
michael@0 | 93 | void resume(); |
michael@0 | 94 | |
michael@0 | 95 | /** |
michael@0 | 96 | * Complete the RDF/XML load. |
michael@0 | 97 | */ |
michael@0 | 98 | void endLoad(); |
michael@0 | 99 | |
michael@0 | 100 | /** |
michael@0 | 101 | * Add namespace information to the RDF/XML sink. |
michael@0 | 102 | * @param aPrefix the namespace prefix |
michael@0 | 103 | * @param aURI the namespace URI |
michael@0 | 104 | */ |
michael@0 | 105 | [noscript] void addNameSpace(in nsIAtomPtr aPrefix, |
michael@0 | 106 | [const] in nsStringRef aURI); |
michael@0 | 107 | |
michael@0 | 108 | /** |
michael@0 | 109 | * Add an observer that will be notified as the RDF/XML load |
michael@0 | 110 | * progresses. |
michael@0 | 111 | * <p> |
michael@0 | 112 | * |
michael@0 | 113 | * Note that the sink will acquire a strong reference to the |
michael@0 | 114 | * observer, so care should be taken to avoid cyclical references |
michael@0 | 115 | * that cannot be released (i.e., if the observer holds a |
michael@0 | 116 | * reference to the sink, it should be sure that it eventually |
michael@0 | 117 | * clears the reference). |
michael@0 | 118 | * |
michael@0 | 119 | * @param aObserver the observer to add to the sink's set of |
michael@0 | 120 | * load observers. |
michael@0 | 121 | */ |
michael@0 | 122 | void addXMLSinkObserver(in nsIRDFXMLSinkObserver aObserver); |
michael@0 | 123 | |
michael@0 | 124 | /** |
michael@0 | 125 | * Remove an observer from the sink's set of observers. |
michael@0 | 126 | * @param aObserver the observer to remove. |
michael@0 | 127 | */ |
michael@0 | 128 | void removeXMLSinkObserver(in nsIRDFXMLSinkObserver aObserver); |
michael@0 | 129 | }; |
michael@0 | 130 |