dom/base/MessageChannel.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.

     2 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     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/. */
     7 #ifndef mozilla_dom_MessageChannel_h
     8 #define mozilla_dom_MessageChannel_h
    10 #include "mozilla/Attributes.h"
    11 #include "mozilla/ErrorResult.h"
    12 #include "mozilla/dom/BindingDeclarations.h"
    13 #include "nsCycleCollectionParticipant.h"
    14 #include "nsWrapperCache.h"
    15 #include "nsCOMPtr.h"
    17 class nsPIDOMWindow;
    19 namespace mozilla {
    20 namespace dom {
    22 class MessagePort;
    24 class MessageChannel MOZ_FINAL : public nsISupports
    25                                , public nsWrapperCache
    26 {
    27 public:
    28   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
    29   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MessageChannel)
    31   static bool PrefEnabled();
    33 public:
    34   MessageChannel(nsPIDOMWindow* aWindow);
    36   ~MessageChannel();
    38   nsPIDOMWindow*
    39   GetParentObject() const
    40   {
    41     return mWindow;
    42   }
    44   virtual JSObject*
    45   WrapObject(JSContext* aCx) MOZ_OVERRIDE;
    47   static already_AddRefed<MessageChannel>
    48   Constructor(const GlobalObject& aGlobal, ErrorResult& aRv);
    50   MessagePort*
    51   Port1() const
    52   {
    53     return mPort1;
    54   }
    56   MessagePort*
    57   Port2() const
    58   {
    59     return mPort2;
    60   }
    62 private:
    63   nsCOMPtr<nsPIDOMWindow> mWindow;
    65   nsRefPtr<MessagePort> mPort1;
    66   nsRefPtr<MessagePort> mPort2;
    67 };
    69 } // namespace dom
    70 } // namespace mozilla
    72 #endif // mozilla_dom_MessageChannel_h

mercurial