content/xul/document/src/nsXULCommandDispatcher.h

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

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/. */
     7 /*
     9    This is the focus manager for XUL documents.
    11 */
    13 #ifndef nsXULCommandDispatcher_h__
    14 #define nsXULCommandDispatcher_h__
    16 #include "nsCOMPtr.h"
    17 #include "nsIDOMXULCommandDispatcher.h"
    18 #include "nsWeakReference.h"
    19 #include "nsIDOMNode.h"
    20 #include "nsString.h"
    21 #include "nsCycleCollectionParticipant.h"
    23 class nsIDOMElement;
    24 class nsPIWindowRoot;
    26 class nsXULCommandDispatcher : public nsIDOMXULCommandDispatcher,
    27                                public nsSupportsWeakReference
    28 {
    29 public:
    30     nsXULCommandDispatcher(nsIDocument* aDocument);
    31     virtual ~nsXULCommandDispatcher();
    33     // nsISupports
    34     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
    35     NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsXULCommandDispatcher,
    36                                              nsIDOMXULCommandDispatcher)
    38     // nsIDOMXULCommandDispatcher interface
    39     NS_DECL_NSIDOMXULCOMMANDDISPATCHER
    41     void Disconnect();
    42 protected:
    43     already_AddRefed<nsPIWindowRoot> GetWindowRoot();
    45     nsIContent* GetRootFocusedContentAndWindow(nsPIDOMWindow** aWindow);
    47     nsCOMPtr<nsIDocument> mDocument;
    49     class Updater {
    50     public:
    51       Updater(nsIDOMElement* aElement,
    52               const nsAString& aEvents,
    53               const nsAString& aTargets)
    54           : mElement(aElement),
    55             mEvents(aEvents),
    56             mTargets(aTargets),
    57             mNext(nullptr)
    58       {}
    60       nsCOMPtr<nsIDOMElement> mElement;
    61       nsString                mEvents;
    62       nsString                mTargets;
    63       Updater*                mNext;
    64     };
    66     Updater* mUpdaters;
    68     bool Matches(const nsString& aList, 
    69                    const nsAString& aElement);
    70 };
    72 #endif // nsXULCommandDispatcher_h__

mercurial