removing files that have now been moved into necko: b=210561 r=dwitte sr=bryner
git-svn-id: svn://10.0.0.236/trunk@147880 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
b64c3185b4
commit
96c63ea69d
@ -1,49 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ----- BEGIN LICENSE BLOCK -----
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape Communications Corporation.
|
||||
* Portions created by Netscape Communications Corporation are
|
||||
* Copyright (C) 2002 Netscape Communications Corporation.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
||||
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the LGPL or the GPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ----- END LICENSE BLOCK ----- */
|
||||
|
||||
/*
|
||||
* This is a "service" and not just an ordinary component. A consumer must talk
|
||||
* to the service manager, not the component manager.
|
||||
*/
|
||||
|
||||
#ifndef NSCCOOKIEMANAGER_H
|
||||
#define NSCCOOKIEMANAGER_H
|
||||
|
||||
#include "nsICookieManager.h"
|
||||
#define NS_COOKIEMANAGER_CONTRACTID "@mozilla.org/cookiemanager;1"
|
||||
|
||||
#endif
|
||||
@ -1,147 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Daniel Witte.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2003
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Daniel Witte (dwitte@stanford.edu)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsCookie.h"
|
||||
|
||||
/******************************************************************************
|
||||
* nsCookie:
|
||||
* string helper impl
|
||||
******************************************************************************/
|
||||
|
||||
// allocate contiguous storage and copy aSource strings,
|
||||
// providing terminating nulls for each destination string.
|
||||
// XXX consider arena allocation here
|
||||
static inline void
|
||||
StrBlockCopy(const nsACString &aSource1,
|
||||
const nsACString &aSource2,
|
||||
const nsACString &aSource3,
|
||||
const nsACString &aSource4,
|
||||
char *&aDest1,
|
||||
char *&aDest2,
|
||||
char *&aDest3,
|
||||
char *&aDest4,
|
||||
char *&aDestEnd)
|
||||
{
|
||||
// find the required buffer size, adding 4 for the terminating nulls
|
||||
const PRUint32 totalLength = aSource1.Length() + aSource2.Length() + aSource3.Length() + aSource4.Length() + 4;
|
||||
|
||||
char *toBegin = NS_STATIC_CAST(char*, nsMemory::Alloc(totalLength * sizeof(char)));
|
||||
NS_ASSERTION(toBegin, "out of memory allocating for nsCookie!");
|
||||
|
||||
aDest1 = toBegin;
|
||||
if (toBegin) {
|
||||
nsACString::const_iterator fromBegin, fromEnd;
|
||||
|
||||
*copy_string(aSource1.BeginReading(fromBegin), aSource1.EndReading(fromEnd), toBegin) = char(0);
|
||||
aDest2 = ++toBegin;
|
||||
*copy_string(aSource2.BeginReading(fromBegin), aSource2.EndReading(fromEnd), toBegin) = char(0);
|
||||
aDest3 = ++toBegin;
|
||||
*copy_string(aSource3.BeginReading(fromBegin), aSource3.EndReading(fromEnd), toBegin) = char(0);
|
||||
aDest4 = ++toBegin;
|
||||
*copy_string(aSource4.BeginReading(fromBegin), aSource4.EndReading(fromEnd), toBegin) = char(0);
|
||||
aDestEnd = toBegin;
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* nsCookie:
|
||||
* ctor/dtor
|
||||
******************************************************************************/
|
||||
|
||||
nsCookie::nsCookie(const nsACString &aName,
|
||||
const nsACString &aValue,
|
||||
const nsACString &aHost,
|
||||
const nsACString &aPath,
|
||||
nsInt64 aExpiry,
|
||||
nsInt64 aLastAccessed,
|
||||
PRBool aIsSession,
|
||||
PRBool aIsDomain,
|
||||
PRBool aIsSecure,
|
||||
nsCookieStatus aStatus,
|
||||
nsCookiePolicy aPolicy)
|
||||
: mExpiry(aExpiry)
|
||||
, mLastAccessed(aLastAccessed)
|
||||
, mRefCnt(0)
|
||||
, mIsSession(aIsSession != PR_FALSE)
|
||||
, mIsDomain(aIsDomain != PR_FALSE)
|
||||
, mIsSecure(aIsSecure != PR_FALSE)
|
||||
, mStatus(aStatus)
|
||||
, mPolicy(aPolicy)
|
||||
{
|
||||
// allocate a new (contiguous) string, and assign string members
|
||||
StrBlockCopy(aName, aValue, aHost, aPath,
|
||||
mName, mValue, mHost, mPath, mEnd);
|
||||
}
|
||||
|
||||
nsCookie::~nsCookie()
|
||||
{
|
||||
if (mName)
|
||||
nsMemory::Free(mName);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* nsCookie:
|
||||
* xpcom impl
|
||||
******************************************************************************/
|
||||
|
||||
// xpcom getters
|
||||
NS_IMETHODIMP nsCookie::GetName(nsACString &aName) { aName = Name(); return NS_OK; }
|
||||
NS_IMETHODIMP nsCookie::GetValue(nsACString &aValue) { aValue = Value(); return NS_OK; }
|
||||
NS_IMETHODIMP nsCookie::GetHost(nsACString &aHost) { aHost = Host(); return NS_OK; }
|
||||
NS_IMETHODIMP nsCookie::GetPath(nsACString &aPath) { aPath = Path(); return NS_OK; }
|
||||
NS_IMETHODIMP nsCookie::GetExpiry(PRInt64 *aExpiry) { *aExpiry = Expiry(); return NS_OK; }
|
||||
NS_IMETHODIMP nsCookie::GetIsSession(PRBool *aIsSession) { *aIsSession = IsSession(); return NS_OK; }
|
||||
NS_IMETHODIMP nsCookie::GetIsDomain(PRBool *aIsDomain) { *aIsDomain = IsDomain(); return NS_OK; }
|
||||
NS_IMETHODIMP nsCookie::GetIsSecure(PRBool *aIsSecure) { *aIsSecure = IsSecure(); return NS_OK; }
|
||||
NS_IMETHODIMP nsCookie::GetStatus(nsCookieStatus *aStatus) { *aStatus = Status(); return NS_OK; }
|
||||
NS_IMETHODIMP nsCookie::GetPolicy(nsCookiePolicy *aPolicy) { *aPolicy = Policy(); return NS_OK; }
|
||||
|
||||
// compatibility method, for use with the legacy nsICookie interface.
|
||||
// here, expires == 0 denotes a session cookie.
|
||||
NS_IMETHODIMP
|
||||
nsCookie::GetExpires(PRUint64 *aExpires)
|
||||
{
|
||||
if (IsSession()) {
|
||||
*aExpires = 0;
|
||||
} else {
|
||||
*aExpires = Expiry() > nsInt64(0) ? PRInt64(Expiry()) : 1;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsCookie, nsICookie, nsICookie2)
|
||||
@ -1,127 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Daniel Witte.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2003
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Daniel Witte (dwitte@stanford.edu)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef nsCookie_h__
|
||||
#define nsCookie_h__
|
||||
|
||||
#include "nsICookie.h"
|
||||
#include "nsICookie2.h"
|
||||
#include "nsString.h"
|
||||
#include "nsMemory.h"
|
||||
#include "nsInt64.h"
|
||||
|
||||
/**
|
||||
* The nsCookie class is the main cookie storage medium for use within cookie
|
||||
* code. It implements nsICookie2, which extends nsICookie, a frozen interface
|
||||
* for xpcom access of cookie objects.
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
* nsCookie:
|
||||
* implementation
|
||||
******************************************************************************/
|
||||
|
||||
class nsCookie : public nsICookie2
|
||||
{
|
||||
// this is required because we use a bitfield refcount member.
|
||||
public:
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
protected:
|
||||
NS_DECL_OWNINGTHREAD
|
||||
|
||||
public:
|
||||
// nsISupports
|
||||
NS_DECL_NSICOOKIE
|
||||
NS_DECL_NSICOOKIE2
|
||||
|
||||
nsCookie(const nsACString &aName,
|
||||
const nsACString &aValue,
|
||||
const nsACString &aHost,
|
||||
const nsACString &aPath,
|
||||
nsInt64 aExpiry,
|
||||
nsInt64 aLastAccessed,
|
||||
PRBool aIsSession,
|
||||
PRBool aIsDomain,
|
||||
PRBool aIsSecure,
|
||||
nsCookieStatus aStatus,
|
||||
nsCookiePolicy aPolicy);
|
||||
|
||||
virtual ~nsCookie();
|
||||
|
||||
// fast (inline, non-xpcom) getters
|
||||
inline const nsDependentCString Name() const { return nsDependentCString(mName, mValue - 1); }
|
||||
inline const nsDependentCString Value() const { return nsDependentCString(mValue, mHost - 1); }
|
||||
inline const nsDependentCString Host() const { return nsDependentCString(mHost, mPath - 1); }
|
||||
inline const nsDependentCString Path() const { return nsDependentCString(mPath, mEnd); }
|
||||
inline nsInt64 Expiry() const { NS_ASSERTION(!IsSession(), "can't get expiry time for a session cookie"); return mExpiry; }
|
||||
inline nsInt64 LastAccessed() const { return mLastAccessed; }
|
||||
inline PRBool IsSession() const { return mIsSession; }
|
||||
inline PRBool IsDomain() const { return mIsDomain; }
|
||||
inline PRBool IsSecure() const { return mIsSecure; }
|
||||
inline nsCookieStatus Status() const { return mStatus; }
|
||||
inline nsCookiePolicy Policy() const { return mPolicy; }
|
||||
|
||||
// setters on nsCookie only exist for SetLastAccessed().
|
||||
// except for this method, an nsCookie is immutable
|
||||
// and must be deleted & recreated if it needs to be changed.
|
||||
inline void SetLastAccessed(nsInt64 aLastAccessed) { mLastAccessed = aLastAccessed; }
|
||||
|
||||
protected:
|
||||
// member variables
|
||||
// we use char* ptrs to store the strings in a contiguous block,
|
||||
// so we save on the overhead of using nsCStrings. However, we
|
||||
// store a terminating null for each string, so we can hand them
|
||||
// out as nsAFlatCStrings.
|
||||
|
||||
// sizeof(nsCookie) = 44 bytes + Length(strings)
|
||||
char *mName;
|
||||
char *mValue;
|
||||
char *mHost;
|
||||
char *mPath;
|
||||
char *mEnd;
|
||||
nsInt64 mExpiry;
|
||||
nsInt64 mLastAccessed;
|
||||
PRUint32 mRefCnt : 16;
|
||||
PRUint32 mIsSession : 1;
|
||||
PRUint32 mIsDomain : 1;
|
||||
PRUint32 mIsSecure : 1;
|
||||
PRUint32 mStatus : 3;
|
||||
PRUint32 mPolicy : 3;
|
||||
};
|
||||
|
||||
#endif // nsCookie_h__
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,178 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2003
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Daniel Witte (dwitte@stanford.edu)
|
||||
* Michiel van Leeuwen (mvl@exedo.nl)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef nsCookieService_h__
|
||||
#define nsCookieService_h__
|
||||
|
||||
#include "nsICookieService.h"
|
||||
#include "nsICookieManager.h"
|
||||
#include "nsICookieManager2.h"
|
||||
#include "nsIObserver.h"
|
||||
#include "nsWeakReference.h"
|
||||
|
||||
#include "nsCookie.h"
|
||||
#include "nsString.h"
|
||||
#include "nsVoidArray.h"
|
||||
|
||||
struct nsCookieAttributes;
|
||||
class nsICookieConsent;
|
||||
class nsICookiePermission;
|
||||
class nsIPrefBranch;
|
||||
class nsIObserverService;
|
||||
class nsIURI;
|
||||
class nsIPrompt;
|
||||
class nsIChannel;
|
||||
class nsITimer;
|
||||
class nsIFile;
|
||||
class nsInt64;
|
||||
|
||||
/******************************************************************************
|
||||
* nsCookieService:
|
||||
* class declaration
|
||||
******************************************************************************/
|
||||
|
||||
class nsCookieService : public nsICookieService
|
||||
, public nsICookieManager2
|
||||
, public nsIObserver
|
||||
, public nsSupportsWeakReference
|
||||
{
|
||||
public:
|
||||
// nsISupports
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIOBSERVER
|
||||
NS_DECL_NSICOOKIESERVICE
|
||||
NS_DECL_NSICOOKIEMANAGER
|
||||
NS_DECL_NSICOOKIEMANAGER2
|
||||
|
||||
nsCookieService();
|
||||
virtual ~nsCookieService();
|
||||
static nsCookieService* GetSingleton();
|
||||
|
||||
protected:
|
||||
void InitPrefObservers();
|
||||
nsresult ReadPrefs();
|
||||
nsresult Read();
|
||||
nsresult Write();
|
||||
PRBool SetCookieInternal(nsIURI *aHostURI, nsIChannel *aChannel, nsDependentCString &aCookieHeader, nsInt64 aServerTime, nsCookieStatus aStatus, nsCookiePolicy aPolicy);
|
||||
nsresult AddInternal(nsCookie *aCookie, nsInt64 aCurrentTime, nsIURI *aHostURI, const char *aCookieHeader);
|
||||
static PRBool GetTokenValue(nsASingleFragmentCString::const_char_iterator &aIter, nsASingleFragmentCString::const_char_iterator &aEndIter, nsDependentSingleFragmentCSubstring &aTokenString, nsDependentSingleFragmentCSubstring &aTokenValue, PRBool &aEqualsFound);
|
||||
static PRBool ParseAttributes(nsDependentCString &aCookieHeader, nsCookieAttributes &aCookie);
|
||||
static PRBool IsIPAddress(const nsAFlatCString &aHost);
|
||||
static PRBool IsFromMailNews(const nsAFlatCString &aScheme);
|
||||
static PRBool IsInDomain(const nsACString &aDomain, const nsACString &aHost, PRBool aIsDomain = PR_TRUE);
|
||||
static PRBool IsForeign(nsIURI *aHostURI, nsIURI *aFirstURI);
|
||||
static nsCookiePolicy GetP3PPolicy(PRInt32 aPolicy);
|
||||
PRInt32 SiteP3PPolicy(nsIURI *aCurrentURI, nsIChannel *aChannel);
|
||||
nsCookieStatus P3PDecision(nsIURI *aHostURI, nsIURI *aFirstURI, nsIChannel *aChannel);
|
||||
nsCookieStatus CheckPrefs(nsIURI *aHostURI, nsIURI *aFirstURI, nsIChannel *aChannel, const char *aCookieHeader);
|
||||
PRBool CheckDomain(nsCookieAttributes &aCookie, nsIURI *aHostURI);
|
||||
static PRBool CheckPath(nsCookieAttributes &aCookie, nsIURI *aHostURI);
|
||||
PRBool GetExpiry(nsCookieAttributes &aCookie, nsInt64 aServerTime, nsInt64 aCurrentTime, nsCookieStatus aStatus);
|
||||
void RemoveAllFromMemory();
|
||||
void RemoveExpiredCookies(nsInt64 aCurrentTime, PRInt32 &aOldestPosition);
|
||||
PRBool FindCookiesFromHost(nsCookie *aCookie, PRUint32 &aCountFromHost, nsInt64 aCurrentTime);
|
||||
PRBool FindPosition(nsCookie *aCookie, PRInt32 &aInsertPosition, PRInt32 &aDeletePosition, nsInt64 aCurrentTime);
|
||||
void UpdateCookieIcon();
|
||||
|
||||
// Use LazyWrite to save the cookies file on a timer. It will write
|
||||
// the file only once if repeatedly hammered quickly.
|
||||
void LazyWrite();
|
||||
static void DoLazyWrite(nsITimer *aTimer, void *aClosure);
|
||||
|
||||
// Use LazyNotify to broadcast the "cookieChanged" notification at
|
||||
// a reasonable frequency.
|
||||
void LazyNotify();
|
||||
static void DoLazyNotify(nsITimer *aTimer, void *aClosure);
|
||||
|
||||
protected:
|
||||
// cached members
|
||||
nsCOMPtr<nsIPrefBranch> mPrefBranch;
|
||||
nsCOMPtr<nsIFile> mCookieFile;
|
||||
nsCOMPtr<nsIObserverService> mObserverService;
|
||||
nsCOMPtr<nsICookieConsent> mP3PService;
|
||||
nsCOMPtr<nsICookiePermission> mPermissionService;
|
||||
|
||||
// impl members
|
||||
nsCOMPtr<nsITimer> mWriteTimer;
|
||||
nsCOMPtr<nsITimer> mNotifyTimer;
|
||||
nsVoidArray mCookieList;
|
||||
PRPackedBool mCookieChanged;
|
||||
PRPackedBool mCookieIconVisible;
|
||||
|
||||
// cached prefs
|
||||
#ifdef MOZ_PHOENIX
|
||||
// unfortunately, we require this #ifdef for now, since Phoenix uses different
|
||||
// (more optimized) prefs to Mozilla.
|
||||
// the following variables are Phoenix hacks to reduce ifdefs in the code.
|
||||
PRPackedBool mCookiesEnabled_temp, // These two prefs are collapsed
|
||||
mCookiesForDomainOnly_temp; // into mCookiesPermissions.
|
||||
#endif
|
||||
PRPackedBool mCookiesLifetimeEnabled, // Cookie lifetime limit enabled
|
||||
mCookiesLifetimeCurrentSession, // Limit cookie lifetime to current session
|
||||
mCookiesStrictDomains; // Optional pref to apply stricter domain checks
|
||||
PRUint8 mCookiesPermissions; // BEHAVIOR_{ACCEPT, REJECTFOREIGN, REJECT, P3P}
|
||||
PRInt32 mCookiesLifetimeSec; // Lifetime limit specified in seconds
|
||||
|
||||
/* mCookiesP3PString (below) consists of 8 characters having the following interpretation:
|
||||
* [0]: behavior for first-party cookies when site has no privacy policy
|
||||
* [1]: behavior for third-party cookies when site has no privacy policy
|
||||
* [2]: behavior for first-party cookies when site uses PII with no user consent
|
||||
* [3]: behavior for third-party cookies when site uses PII with no user consent
|
||||
* [4]: behavior for first-party cookies when site uses PII with implicit consent only
|
||||
* [5]: behavior for third-party cookies when site uses PII with implicit consent only
|
||||
* [6]: behavior for first-party cookies when site uses PII with explicit consent
|
||||
* [7]: behavior for third-party cookies when site uses PII with explicit consent
|
||||
*
|
||||
* (note: PII = personally identifiable information)
|
||||
*
|
||||
* each of the eight characters can be one of the following:
|
||||
* 'a': accept the cookie
|
||||
* 'd': accept the cookie but downgrade it to a session cookie
|
||||
* 'r': reject the cookie
|
||||
*/
|
||||
nsXPIDLCString mCookiesP3PString;
|
||||
|
||||
// private static member, used to cache a ptr to nsCookieService,
|
||||
// so we can make nsCookieService a singleton xpcom object.
|
||||
static nsCookieService *gCookieService;
|
||||
};
|
||||
|
||||
#define NS_COOKIEMANAGER_CID {0xaaab6710,0xf2c,0x11d5,{0xa5,0x3b,0x0,0x10,0xa4,0x1,0xeb,0x10}}
|
||||
|
||||
#endif // nsCookieService_h__
|
||||
@ -1,108 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
|
||||
* The Original Code is mozilla.org code.
|
||||
|
||||
* The Initial Developer of the Original Code is Netscape
|
||||
* Communications, Inc. Portions created by Netscape are
|
||||
* Copyright (C) 2001, Mozilla. All Rights Reserved.
|
||||
|
||||
* Contributor(s):
|
||||
*/
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
/**
|
||||
* An optional interface for accessing the HTTP or
|
||||
* javascript cookie object
|
||||
*
|
||||
* @status FROZEN
|
||||
*/
|
||||
|
||||
typedef long nsCookieStatus;
|
||||
typedef long nsCookiePolicy;
|
||||
|
||||
[scriptable, uuid(E9FCB9A4-D376-458f-B720-E65E7DF593BC)]
|
||||
|
||||
interface nsICookie : nsISupports {
|
||||
|
||||
/**
|
||||
* the name of the cookie
|
||||
*/
|
||||
readonly attribute ACString name;
|
||||
|
||||
/**
|
||||
* the cookie value
|
||||
*/
|
||||
readonly attribute ACString value;
|
||||
|
||||
/**
|
||||
* true if the cookie is a domain cookie, false otherwise
|
||||
*/
|
||||
readonly attribute boolean isDomain;
|
||||
|
||||
/**
|
||||
* the host (possibly fully qualified) of the cookie
|
||||
*/
|
||||
readonly attribute AUTF8String host;
|
||||
|
||||
/**
|
||||
* the path pertaining to the cookie
|
||||
*/
|
||||
readonly attribute AUTF8String path;
|
||||
|
||||
/**
|
||||
* true if the cookie was transmitted over ssl, false otherwise
|
||||
*/
|
||||
readonly attribute boolean isSecure;
|
||||
|
||||
/**
|
||||
* expiration time (local timezone) expressed as number of seconds since Jan 1, 1970
|
||||
*/
|
||||
readonly attribute PRUint64 expires;
|
||||
|
||||
/**
|
||||
* P3P status of cookie. Values are
|
||||
*
|
||||
* STATUS_UNKNOWN -- cookie collected in a previous session and this info no longer available
|
||||
* STATUS_ACCEPTED -- cookie was accepted as it
|
||||
* STATUS_DOWNGRADED -- cookie was accepted but downgraded to a session cookie
|
||||
* STATUS_FLAGGED -- cookie was accepted with a warning being issued to the user
|
||||
* STATUS_REJECTED -- cookie was not accepted
|
||||
*/
|
||||
const nsCookieStatus STATUS_UNKNOWN=0;
|
||||
const nsCookieStatus STATUS_ACCEPTED=1;
|
||||
const nsCookieStatus STATUS_DOWNGRADED=2;
|
||||
const nsCookieStatus STATUS_FLAGGED=3;
|
||||
const nsCookieStatus STATUS_REJECTED=4;
|
||||
|
||||
readonly attribute nsCookieStatus status;
|
||||
|
||||
/**
|
||||
* Site's compact policy. Values are
|
||||
*
|
||||
* POLICY_UNKNOWN -- cookie collected in a previous session and this info no longer available
|
||||
* POLICY_NONE -- site did not send a compact policy along with the cookie
|
||||
* POLICY_NO_CONSENT -- site collects identfiable information without user involvement
|
||||
* POLICY_IMPLICIT_CONSENT -- site collects identifiable information unless user opts out
|
||||
* POLICY_EXPLICIT_CONSENT -- site does not collect identifiable information unless user opts in
|
||||
* POLICY_NO_II -- site does not collect identifiable information
|
||||
*/
|
||||
const nsCookiePolicy POLICY_UNKNOWN=0;
|
||||
const nsCookiePolicy POLICY_NONE=1;
|
||||
const nsCookiePolicy POLICY_NO_CONSENT=2;
|
||||
const nsCookiePolicy POLICY_IMPLICIT_CONSENT=3;
|
||||
const nsCookiePolicy POLICY_EXPLICIT_CONSENT=4;
|
||||
const nsCookiePolicy POLICY_NO_II=5;
|
||||
readonly attribute nsCookiePolicy policy;
|
||||
|
||||
};
|
||||
@ -1,67 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Daniel Witte.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2003
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Daniel Witte (dwitte@stanford.edu)
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsICookie.idl"
|
||||
|
||||
/**
|
||||
* Main cookie object interface for use by consumers:
|
||||
* extends nsICookie, a frozen interface for external
|
||||
* access of cookie objects
|
||||
*/
|
||||
|
||||
[scriptable, uuid(d3493503-7854-46ed-8284-8af54a847efb)]
|
||||
|
||||
interface nsICookie2 : nsICookie
|
||||
{
|
||||
|
||||
/**
|
||||
* true if the cookie is a session cookie
|
||||
* (note: if true, the expiry time is undefined).
|
||||
*/
|
||||
readonly attribute boolean isSession;
|
||||
|
||||
/**
|
||||
* the actual expiry time of the cookie
|
||||
* (where 0 does not represent a session cookie).
|
||||
*
|
||||
* not to be confused with |expires|, an
|
||||
* attribute on nsICookie.
|
||||
*/
|
||||
readonly attribute PRInt64 expiry;
|
||||
|
||||
};
|
||||
@ -1,51 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
interface nsIHttpChannel;
|
||||
|
||||
[scriptable,uuid(F5A34F50-1F39-11d6-A627-0010A401EB10)]
|
||||
interface nsICookieConsent : nsISupports {
|
||||
long getConsent(in string aURI,
|
||||
in nsIHttpChannel aHttpChannel);
|
||||
};
|
||||
|
||||
%{C++
|
||||
#define NS_COOKIECONSENT_CONTRACTID "@mozilla.org/cookie-consent;1"
|
||||
%}
|
||||
@ -1,75 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.1 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/NPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#include "nsISupports.idl"
|
||||
#include "nsISimpleEnumerator.idl"
|
||||
|
||||
|
||||
/**
|
||||
* An optional interface for accessing or removing the cookies
|
||||
* that are in the cookie list
|
||||
*
|
||||
* @status FROZEN
|
||||
*/
|
||||
|
||||
[scriptable, uuid(AAAB6710-0F2C-11d5-A53B-0010A401EB10)]
|
||||
interface nsICookieManager : nsISupports
|
||||
{
|
||||
|
||||
/**
|
||||
* Called to remove all cookies from the cookie list
|
||||
*/
|
||||
void removeAll();
|
||||
|
||||
/**
|
||||
* Called to enumerate through each cookie in the cookie list.
|
||||
* The objects enumerated over are of type nsICookie
|
||||
*/
|
||||
readonly attribute nsISimpleEnumerator enumerator;
|
||||
|
||||
/**
|
||||
* Called to remove an individual cookie from the cookie list
|
||||
*
|
||||
* @param aDomain The host or domain for which the cookie was set
|
||||
* @param aName The name specified in the cookie
|
||||
* @param aBlocked Indicates if cookies from this host should be permanently blocked
|
||||
*
|
||||
*/
|
||||
void remove(in AUTF8String aDomain, in ACString aName, in AUTF8String aPath, in boolean aBlocked);
|
||||
};
|
||||
@ -1,62 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2003
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsICookieManager.idl"
|
||||
|
||||
/**
|
||||
* Additions to the frozen nsICookieManager
|
||||
*/
|
||||
|
||||
[scriptable, uuid(3E73FF5F-154E-494f-B640-3C654BA2CC2B)]
|
||||
interface nsICookieManager2 : nsICookieManager
|
||||
{
|
||||
/**
|
||||
* Add a cookie. nsICookieService is the normal way to do this. This
|
||||
* method is something of a backdoor.
|
||||
*
|
||||
* @param aDomain the host or domain for which the cookie is set
|
||||
* @param aPath path within the domain for which the cookie is valid
|
||||
* @param aName cookie name
|
||||
* @param aValue cookie data
|
||||
* @param aSecure true if the cookie should be secure
|
||||
* @param aExpires expiration date. 0 means none; a session cookie.
|
||||
*/
|
||||
[noscript]
|
||||
void add(in AUTF8String aDomain, in AUTF8String aPath,
|
||||
in ACString aName, in ACString aValue,
|
||||
in boolean aSecure, in PRInt32 aExpires);
|
||||
};
|
||||
@ -1,126 +0,0 @@
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is cookie manager code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Michiel van Leeuwen (mvl@exedo.nl).
|
||||
* Portions created by the Initial Developer are Copyright (C) 2003
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
interface nsICookie;
|
||||
interface nsIURI;
|
||||
interface nsIChannel;
|
||||
|
||||
typedef long nsCookieAccess;
|
||||
|
||||
/**
|
||||
* An interface to test for cookie permissions
|
||||
*/
|
||||
[scriptable, uuid(91f1c3ec-73a0-4bf0-bdc5-348a1f181b0e)]
|
||||
interface nsICookiePermission : nsISupports
|
||||
{
|
||||
/**
|
||||
* nsCookieAccess values
|
||||
*/
|
||||
const nsCookieAccess ACCESS_DEFAULT = 0;
|
||||
const nsCookieAccess ACCESS_ALLOW = 1;
|
||||
const nsCookieAccess ACCESS_DENY = 2;
|
||||
|
||||
/**
|
||||
* setAccess
|
||||
*
|
||||
* this method is called to block cookie access for the given URI. this
|
||||
* may result in other URIs being blocked as well (e.g., URIs which share
|
||||
* the same host name).
|
||||
*
|
||||
* @param aURI
|
||||
* the URI to block
|
||||
* @param aAccess
|
||||
* the new cookie access for the URI
|
||||
*/
|
||||
void setAccess(in nsIURI aURI,
|
||||
in nsCookieAccess aAccess);
|
||||
|
||||
/**
|
||||
* canAccess
|
||||
*
|
||||
* this method is called to test whether or not the given URI/channel may
|
||||
* access the cookie database, either to set or get cookies.
|
||||
*
|
||||
* @param aURI
|
||||
* the URI trying to access cookies
|
||||
* @param aFirstURI
|
||||
* the URI initiated by the user that resulted in aURI being loaded
|
||||
* @param aChannel
|
||||
* the channel corresponding to aURI
|
||||
*
|
||||
* @return nsCookieAccess value
|
||||
*/
|
||||
nsCookieAccess canAccess(in nsIURI aURI,
|
||||
in nsIURI aFirstURI,
|
||||
in nsIChannel aChannel);
|
||||
|
||||
/**
|
||||
* canSetCookie
|
||||
*
|
||||
* this method is called to test whether or not the given URI/channel may
|
||||
* set a specific cookie. this method is always preceded by a call to
|
||||
* canAccessCookies.
|
||||
*
|
||||
* @param aURI
|
||||
* the URI trying to set the cookie
|
||||
* @param aChannel
|
||||
* the corresponding to aURI
|
||||
* @param aCookie
|
||||
* the cookie being added to the cookie database
|
||||
* @param aNumCookiesFromHost
|
||||
* the number of cookies this host already has set
|
||||
* @param aChangingCookie
|
||||
* PR_TRUE if the cookie is being modified; otherwise, the cookie
|
||||
* is new
|
||||
*
|
||||
* @return true if the cookie can be set.
|
||||
*/
|
||||
boolean canSetCookie(in nsIURI aURI,
|
||||
in nsIChannel aChannel,
|
||||
in nsICookie aCookie,
|
||||
in long aNumCookiesFromHost,
|
||||
in boolean aChangingCookie);
|
||||
};
|
||||
|
||||
%{ C++
|
||||
/**
|
||||
* The nsICookiePermission implementation is an XPCOM service registered
|
||||
* under the ContractID:
|
||||
*/
|
||||
#define NS_COOKIEPERMISSION_CONTRACTID "@mozilla.org/cookie/permission;1"
|
||||
%}
|
||||
Loading…
x
Reference in New Issue
Block a user