dom/audiochannel/AudioChannelAgent.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++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
     2 /* vim: set ts=2 et sw=2 tw=80: */
     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_audio_channel_agent_h__
     8 #define mozilla_dom_audio_channel_agent_h__
    10 #include "nsIAudioChannelAgent.h"
    11 #include "nsCycleCollectionParticipant.h"
    12 #include "nsCOMPtr.h"
    13 #include "nsWeakPtr.h"
    15 #define NS_AUDIOCHANNELAGENT_CONTRACTID "@mozilla.org/audiochannelagent;1"
    16 // f27688e2-3dd7-11e2-904e-10bf48d64bd4
    17 #define NS_AUDIOCHANNELAGENT_CID {0xf27688e2, 0x3dd7, 0x11e2, \
    18       {0x90, 0x4e, 0x10, 0xbf, 0x48, 0xd6, 0x4b, 0xd4}}
    20 class nsIDOMWindow;
    22 namespace mozilla {
    23 namespace dom {
    25 /* Header file */
    26 class AudioChannelAgent : public nsIAudioChannelAgent
    27 {
    28 public:
    29   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
    30   NS_DECL_NSIAUDIOCHANNELAGENT
    32   NS_DECL_CYCLE_COLLECTION_CLASS(AudioChannelAgent)
    34   AudioChannelAgent();
    35   virtual void NotifyAudioChannelStateChanged();
    37   void WindowVolumeChanged();
    39   nsIDOMWindow* Window() const
    40   {
    41     return mWindow;
    42   }
    44 private:
    45   virtual ~AudioChannelAgent();
    47   // Returns mCallback if that's non-null, or otherwise tries to get an
    48   // nsIAudioChannelAgentCallback out of mWeakCallback.
    49   already_AddRefed<nsIAudioChannelAgentCallback> GetCallback();
    51   nsresult InitInternal(nsIDOMWindow* aWindow, int32_t aAudioAgentType,
    52                         nsIAudioChannelAgentCallback* aCallback,
    53                         bool aUseWeakRef, bool aWithVideo=false);
    55   nsCOMPtr<nsIDOMWindow> mWindow;
    56   nsCOMPtr<nsIAudioChannelAgentCallback> mCallback;
    57   nsWeakPtr mWeakCallback;
    58   int32_t mAudioChannelType;
    59   bool mIsRegToService;
    60   bool mVisible;
    61   bool mWithVideo;
    62 };
    64 } // namespace dom
    65 } // namespace mozilla
    66 #endif

mercurial