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.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef nsXULTemplateResultRDF_h__
7 #define nsXULTemplateResultRDF_h__
9 #include "nsCOMPtr.h"
10 #include "nsIRDFResource.h"
11 #include "nsXULTemplateQueryProcessorRDF.h"
12 #include "nsRDFQuery.h"
13 #include "nsRuleNetwork.h"
14 #include "nsIXULTemplateResult.h"
15 #include "nsRDFBinding.h"
16 #include "mozilla/Attributes.h"
18 /**
19 * A single result of a query on an RDF graph
20 */
21 class nsXULTemplateResultRDF MOZ_FINAL : public nsIXULTemplateResult
22 {
23 public:
24 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
25 NS_DECL_CYCLE_COLLECTION_CLASS(nsXULTemplateResultRDF)
27 NS_DECL_NSIXULTEMPLATERESULT
29 nsXULTemplateResultRDF(nsIRDFResource* aNode);
31 nsXULTemplateResultRDF(nsRDFQuery* aQuery,
32 const Instantiation& aInst,
33 nsIRDFResource* aNode);
35 ~nsXULTemplateResultRDF();
37 nsITemplateRDFQuery* Query() { return mQuery; }
39 nsXULTemplateQueryProcessorRDF* GetProcessor()
40 {
41 return (mQuery ? mQuery->Processor() : nullptr);
42 }
44 /**
45 * Get the value of a variable, first by looking in the assignments and
46 * then the bindings
47 */
48 void
49 GetAssignment(nsIAtom* aVar, nsIRDFNode** aValue);
51 /**
52 * Synchronize the bindings after a change in the RDF graph. Bindings that
53 * would be affected will be assigned appropriately based on the change.
54 */
55 bool
56 SyncAssignments(nsIRDFResource* aSubject,
57 nsIRDFResource* aPredicate,
58 nsIRDFNode* aTarget);
60 /**
61 * Return true if the result has an instantiation involving a particular
62 * memory element.
63 */
64 bool
65 HasMemoryElement(const MemoryElement& aMemoryElement);
67 protected:
69 // query that generated the result
70 nsCOMPtr<nsITemplateRDFQuery> mQuery;
72 // resource node
73 nsCOMPtr<nsIRDFResource> mNode;
75 // data computed from query
76 Instantiation mInst;
78 // extra assignments made by rules (<binding> tags)
79 nsBindingValues mBindingValues;
80 };
82 #endif // nsXULTemplateResultRDF_h__