extensions/cookie/nsCookiePermission.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 4
michael@0 5 #ifndef nsCookiePermission_h__
michael@0 6 #define nsCookiePermission_h__
michael@0 7
michael@0 8 #include "nsICookiePermission.h"
michael@0 9 #include "nsIPermissionManager.h"
michael@0 10 #include "nsIObserver.h"
michael@0 11 #include "nsCOMPtr.h"
michael@0 12 #include "mozIThirdPartyUtil.h"
michael@0 13
michael@0 14 class nsIPrefBranch;
michael@0 15
michael@0 16 class nsCookiePermission : public nsICookiePermission
michael@0 17 , public nsIObserver
michael@0 18 {
michael@0 19 public:
michael@0 20 NS_DECL_ISUPPORTS
michael@0 21 NS_DECL_NSICOOKIEPERMISSION
michael@0 22 NS_DECL_NSIOBSERVER
michael@0 23
michael@0 24 nsCookiePermission()
michael@0 25 : mCookiesLifetimeSec(INT64_MAX)
michael@0 26 , mCookiesLifetimePolicy(0) // ACCEPT_NORMALLY
michael@0 27 , mCookiesAlwaysAcceptSession(false)
michael@0 28 {}
michael@0 29 virtual ~nsCookiePermission() {}
michael@0 30
michael@0 31 bool Init();
michael@0 32 void PrefChanged(nsIPrefBranch *, const char *);
michael@0 33
michael@0 34 private:
michael@0 35 bool EnsureInitialized() { return (mPermMgr != nullptr && mThirdPartyUtil != nullptr) || Init(); };
michael@0 36
michael@0 37 nsCOMPtr<nsIPermissionManager> mPermMgr;
michael@0 38 nsCOMPtr<mozIThirdPartyUtil> mThirdPartyUtil;
michael@0 39
michael@0 40 int64_t mCookiesLifetimeSec; // lifetime limit specified in seconds
michael@0 41 uint8_t mCookiesLifetimePolicy; // pref for how long cookies are stored
michael@0 42 bool mCookiesAlwaysAcceptSession; // don't prompt for session cookies
michael@0 43 };
michael@0 44
michael@0 45 // {EF565D0A-AB9A-4A13-9160-0644CDFD859A}
michael@0 46 #define NS_COOKIEPERMISSION_CID \
michael@0 47 {0xEF565D0A, 0xAB9A, 0x4A13, {0x91, 0x60, 0x06, 0x44, 0xcd, 0xfd, 0x85, 0x9a }}
michael@0 48
michael@0 49 #endif

mercurial