mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 13:07:52 +00:00
moving cookie service into necko: b=210561 r=dwitte sr=bryner
these files were moved from their old home in extensions/cookie. the CVS records cannot be simply moved because attic files exist in the new location, and so i will unfortunately take cvs blame for all. that's unfair to dwitte who has made so many wonderful changes to the cookies backend code! ;-) so, to find out the real cvs blame for these files, please look at the following cvs remove'd files: mozilla/extensions/cookie/nsCookieService.cpp mozilla/extensions/cookie/nsCookieService.h mozilla/extensions/cookie/nsCookie.cpp mozilla/extensions/cookie/nsCookie.h mozilla/extensions/cookie/nsICookie2.idl mozilla/extensions/cookie/nsICookieConsent.idl mozilla/extensions/cookie/nsICookie.idl mozilla/extensions/cookie/nsICookieManager2.idl mozilla/extensions/cookie/nsICookieManager.idl mozilla/extensions/cookie/nsICookiePermission.idl
This commit is contained in:
parent
062870abe1
commit
1754f96409
@ -388,6 +388,9 @@ netwerk/build2/Makefile
|
|||||||
netwerk/cache/Makefile
|
netwerk/cache/Makefile
|
||||||
netwerk/cache/public/Makefile
|
netwerk/cache/public/Makefile
|
||||||
netwerk/cache/src/Makefile
|
netwerk/cache/src/Makefile
|
||||||
|
netwerk/cookie/Makefile
|
||||||
|
netwerk/cookie/public/Makefile
|
||||||
|
netwerk/cookie/src/Makefile
|
||||||
netwerk/dns/Makefile
|
netwerk/dns/Makefile
|
||||||
netwerk/dns/public/Makefile
|
netwerk/dns/public/Makefile
|
||||||
netwerk/dns/src/Makefile
|
netwerk/dns/src/Makefile
|
||||||
|
@ -52,9 +52,7 @@ endif
|
|||||||
|
|
||||||
CPPSRCS = \
|
CPPSRCS = \
|
||||||
nsModuleFactory.cpp \
|
nsModuleFactory.cpp \
|
||||||
nsCookie.cpp \
|
|
||||||
nsPermission.cpp \
|
nsPermission.cpp \
|
||||||
nsCookieService.cpp \
|
|
||||||
nsImgManager.cpp \
|
nsImgManager.cpp \
|
||||||
nsPermissionManager.cpp \
|
nsPermissionManager.cpp \
|
||||||
nsPopupWindowManager.cpp \
|
nsPopupWindowManager.cpp \
|
||||||
@ -62,25 +60,12 @@ CPPSRCS = \
|
|||||||
nsCookiePermission.cpp \
|
nsCookiePermission.cpp \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
SDK_XPIDLSRCS = \
|
|
||||||
nsICookie.idl \
|
|
||||||
nsICookieManager.idl \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
XPIDLSRCS = \
|
XPIDLSRCS = \
|
||||||
nsICookie2.idl \
|
|
||||||
nsICookieConsent.idl \
|
|
||||||
nsIImgManager.idl \
|
nsIImgManager.idl \
|
||||||
nsIPermissionManager.idl \
|
nsIPermissionManager.idl \
|
||||||
nsIPermission.idl \
|
nsIPermission.idl \
|
||||||
nsICookieAcceptDialog.idl \
|
nsICookieAcceptDialog.idl \
|
||||||
nsICookiePromptService.idl \
|
nsICookiePromptService.idl \
|
||||||
nsICookieManager2.idl \
|
|
||||||
nsICookiePermission.idl \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
EXPORTS = \
|
|
||||||
nsCCookieManager.h \
|
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
EXTRA_DSO_LDOPTS = \
|
EXTRA_DSO_LDOPTS = \
|
||||||
|
@ -40,8 +40,6 @@
|
|||||||
#include "nsIModule.h"
|
#include "nsIModule.h"
|
||||||
#include "nsIGenericFactory.h"
|
#include "nsIGenericFactory.h"
|
||||||
#include "nsIServiceManager.h"
|
#include "nsIServiceManager.h"
|
||||||
#include "nsCCookieManager.h"
|
|
||||||
#include "nsCookieService.h"
|
|
||||||
#include "nsImgManager.h"
|
#include "nsImgManager.h"
|
||||||
#include "nsPermissionManager.h"
|
#include "nsPermissionManager.h"
|
||||||
#include "nsPopupWindowManager.h"
|
#include "nsPopupWindowManager.h"
|
||||||
@ -51,7 +49,6 @@
|
|||||||
#include "nsXPIDLString.h"
|
#include "nsXPIDLString.h"
|
||||||
|
|
||||||
// Define the constructor function for the objects
|
// Define the constructor function for the objects
|
||||||
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsCookieService, nsCookieService::GetSingleton)
|
|
||||||
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsImgManager, Init)
|
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsImgManager, Init)
|
||||||
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPermissionManager, Init)
|
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPermissionManager, Init)
|
||||||
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPopupWindowManager, Init)
|
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPopupWindowManager, Init)
|
||||||
@ -92,16 +89,6 @@ UnregisterContentPolicy(nsIComponentManager *aCompMgr, nsIFile *aPath,
|
|||||||
|
|
||||||
// The list of components we register
|
// The list of components we register
|
||||||
static const nsModuleComponentInfo components[] = {
|
static const nsModuleComponentInfo components[] = {
|
||||||
{ "CookieManager",
|
|
||||||
NS_COOKIEMANAGER_CID,
|
|
||||||
NS_COOKIEMANAGER_CONTRACTID,
|
|
||||||
nsCookieServiceConstructor
|
|
||||||
},
|
|
||||||
{ "CookieService",
|
|
||||||
NS_COOKIESERVICE_CID,
|
|
||||||
NS_COOKIESERVICE_CONTRACTID,
|
|
||||||
nsCookieServiceConstructor
|
|
||||||
},
|
|
||||||
{ "ImgManager",
|
{ "ImgManager",
|
||||||
NS_IMGMANAGER_CID,
|
NS_IMGMANAGER_CID,
|
||||||
NS_IMGMANAGER_CONTRACTID,
|
NS_IMGMANAGER_CONTRACTID,
|
||||||
|
@ -58,6 +58,7 @@ SHARED_LIBRARY_LIBS = \
|
|||||||
$(DIST)/lib/$(LIB_PREFIX)neckobase_s.$(LIB_SUFFIX) \
|
$(DIST)/lib/$(LIB_PREFIX)neckobase_s.$(LIB_SUFFIX) \
|
||||||
$(DIST)/lib/$(LIB_PREFIX)neckodns_s.$(LIB_SUFFIX) \
|
$(DIST)/lib/$(LIB_PREFIX)neckodns_s.$(LIB_SUFFIX) \
|
||||||
$(DIST)/lib/$(LIB_PREFIX)neckosocket_s.$(LIB_SUFFIX) \
|
$(DIST)/lib/$(LIB_PREFIX)neckosocket_s.$(LIB_SUFFIX) \
|
||||||
|
$(DIST)/lib/$(LIB_PREFIX)neckocookie_s.$(LIB_SUFFIX) \
|
||||||
$(DIST)/lib/$(LIB_PREFIX)nkconv_s.$(LIB_SUFFIX) \
|
$(DIST)/lib/$(LIB_PREFIX)nkconv_s.$(LIB_SUFFIX) \
|
||||||
$(DIST)/lib/$(LIB_PREFIX)nkcnvts_s.$(LIB_SUFFIX) \
|
$(DIST)/lib/$(LIB_PREFIX)nkcnvts_s.$(LIB_SUFFIX) \
|
||||||
$(DIST)/lib/$(LIB_PREFIX)nkmime_s.$(LIB_SUFFIX) \
|
$(DIST)/lib/$(LIB_PREFIX)nkmime_s.$(LIB_SUFFIX) \
|
||||||
@ -71,6 +72,7 @@ LOCAL_INCLUDES = \
|
|||||||
-I$(srcdir)/../base/src \
|
-I$(srcdir)/../base/src \
|
||||||
-I$(srcdir)/../dns/src \
|
-I$(srcdir)/../dns/src \
|
||||||
-I$(srcdir)/../socket/base \
|
-I$(srcdir)/../socket/base \
|
||||||
|
-I$(srcdir)/../cookie/src \
|
||||||
-I$(srcdir)/../streamconv/src \
|
-I$(srcdir)/../streamconv/src \
|
||||||
-I$(srcdir)/../streamconv/converters \
|
-I$(srcdir)/../streamconv/converters \
|
||||||
-I$(srcdir)/../mime/src \
|
-I$(srcdir)/../mime/src \
|
||||||
|
@ -138,6 +138,12 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsDirIndex)
|
|||||||
#include "nsStreamListenerTee.h"
|
#include "nsStreamListenerTee.h"
|
||||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsStreamListenerTee)
|
NS_GENERIC_FACTORY_CONSTRUCTOR(nsStreamListenerTee)
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "nsCookieService.h"
|
||||||
|
#include "nsCCookieManager.h"
|
||||||
|
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsCookieService, nsCookieService::GetSingleton)
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
// protocols
|
// protocols
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
@ -999,6 +1005,18 @@ static const nsModuleComponentInfo gNetModuleInfo[] = {
|
|||||||
nsCacheService::Create
|
nsCacheService::Create
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{ "CookieManager",
|
||||||
|
NS_COOKIEMANAGER_CID,
|
||||||
|
NS_COOKIEMANAGER_CONTRACTID,
|
||||||
|
nsCookieServiceConstructor
|
||||||
|
},
|
||||||
|
|
||||||
|
{ "CookieService",
|
||||||
|
NS_COOKIESERVICE_CID,
|
||||||
|
NS_COOKIESERVICE_CONTRACTID,
|
||||||
|
nsCookieServiceConstructor
|
||||||
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
NS_IMPL_NSGETMODULE_WITH_DTOR(necko_core_and_primary_protocols, gNetModuleInfo,
|
NS_IMPL_NSGETMODULE_WITH_DTOR(necko_core_and_primary_protocols, gNetModuleInfo,
|
||||||
|
@ -26,6 +26,6 @@ VPATH = @srcdir@
|
|||||||
|
|
||||||
include $(DEPTH)/config/autoconf.mk
|
include $(DEPTH)/config/autoconf.mk
|
||||||
|
|
||||||
DIRS = public
|
DIRS = public src
|
||||||
|
|
||||||
include $(topsrcdir)/config/rules.mk
|
include $(topsrcdir)/config/rules.mk
|
||||||
|
@ -30,8 +30,21 @@ MODULE = necko
|
|||||||
XPIDL_MODULE = necko_cookie
|
XPIDL_MODULE = necko_cookie
|
||||||
GRE_MODULE = 1
|
GRE_MODULE = 1
|
||||||
|
|
||||||
|
SDK_XPIDLSRCS = \
|
||||||
|
nsICookieManager.idl \
|
||||||
|
nsICookie.idl \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
XPIDLSRCS = \
|
XPIDLSRCS = \
|
||||||
nsICookieService.idl \
|
nsICookieService.idl \
|
||||||
|
nsICookie2.idl \
|
||||||
|
nsICookieConsent.idl \
|
||||||
|
nsICookieManager2.idl \
|
||||||
|
nsICookiePermission.idl \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
EXPORTS = \
|
||||||
|
nsCCookieManager.h \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
include $(topsrcdir)/config/rules.mk
|
include $(topsrcdir)/config/rules.mk
|
||||||
|
49
netwerk/cookie/public/nsCCookieManager.h
Normal file
49
netwerk/cookie/public/nsCCookieManager.h
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
/* -*- 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
|
108
netwerk/cookie/public/nsICookie.idl
Normal file
108
netwerk/cookie/public/nsICookie.idl
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
/* -*- 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;
|
||||||
|
|
||||||
|
};
|
67
netwerk/cookie/public/nsICookie2.idl
Normal file
67
netwerk/cookie/public/nsICookie2.idl
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
/* -*- 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;
|
||||||
|
|
||||||
|
};
|
51
netwerk/cookie/public/nsICookieConsent.idl
Normal file
51
netwerk/cookie/public/nsICookieConsent.idl
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
/* -*- 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"
|
||||||
|
%}
|
75
netwerk/cookie/public/nsICookieManager.idl
Normal file
75
netwerk/cookie/public/nsICookieManager.idl
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
/* -*- 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);
|
||||||
|
};
|
62
netwerk/cookie/public/nsICookieManager2.idl
Normal file
62
netwerk/cookie/public/nsICookieManager2.idl
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
/* -*- 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);
|
||||||
|
};
|
126
netwerk/cookie/public/nsICookiePermission.idl
Normal file
126
netwerk/cookie/public/nsICookiePermission.idl
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
/* ***** 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