dom/base/nsHistory.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: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* vim: set ts=2 sw=2 et tw=79: */
     3 /* This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #ifndef nsHistory_h___
     7 #define nsHistory_h___
     9 #include "mozilla/Attributes.h"
    10 #include "mozilla/ErrorResult.h"
    11 #include "nsCOMPtr.h"
    12 #include "nsCycleCollectionParticipant.h"
    13 #include "nsIDOMHistory.h"
    14 #include "nsPIDOMWindow.h" // for GetParentObject
    15 #include "nsStringFwd.h"
    16 #include "nsWrapperCache.h"
    18 class nsIDocShell;
    19 class nsISHistory;
    20 class nsIWeakReference;
    21 class nsPIDOMWindow;
    23 // Script "History" object
    24 class nsHistory MOZ_FINAL : public nsIDOMHistory, // Empty, needed for extension
    25                                                   // backwards compat
    26                             public nsWrapperCache
    27 {
    28 public:
    29   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
    30   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsHistory)
    32 public:
    33   nsHistory(nsPIDOMWindow* aInnerWindow);
    34   virtual ~nsHistory();
    36   nsPIDOMWindow* GetParentObject() const;
    37   virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
    39   uint32_t GetLength(mozilla::ErrorResult& aRv) const;
    40   void GetState(JSContext* aCx, JS::MutableHandle<JS::Value> aResult,
    41                 mozilla::ErrorResult& aRv) const;
    42   void Go(int32_t aDelta, mozilla::ErrorResult& aRv);
    43   void Back(mozilla::ErrorResult& aRv);
    44   void Forward(mozilla::ErrorResult& aRv);
    45   void PushState(JSContext* aCx, JS::Handle<JS::Value> aData,
    46                  const nsAString& aTitle, const nsAString& aUrl,
    47                  mozilla::ErrorResult& aRv);
    48   void ReplaceState(JSContext* aCx, JS::Handle<JS::Value> aData,
    49                     const nsAString& aTitle, const nsAString& aUrl,
    50                     mozilla::ErrorResult& aRv);
    52 protected:
    53   nsIDocShell* GetDocShell() const;
    55   void PushOrReplaceState(JSContext* aCx, JS::Handle<JS::Value> aData,
    56                           const nsAString& aTitle, const nsAString& aUrl,
    57                           mozilla::ErrorResult& aRv, bool aReplace);
    59   already_AddRefed<nsISHistory> GetSessionHistory() const;
    61   nsCOMPtr<nsIWeakReference> mInnerWindow;
    62 };
    64 #endif /* nsHistory_h___ */

mercurial