зеркало из https://github.com/mozilla/gecko-dev.git
bug 113143, cookie module to call compact-policy parser, r=sgehani,harishd, sr=jag
This commit is contained in:
Родитель
699521a101
Коммит
b898d4522b
|
@ -3,3 +3,4 @@ nsICookieManager.idl
|
|||
nsIImgManager.idl
|
||||
nsIPermission.idl
|
||||
nsIPermissionManager.idl
|
||||
nsICookieConsent.idl
|
||||
|
|
|
@ -64,6 +64,7 @@ CPPSRCS = \
|
|||
|
||||
XPIDLSRCS = \
|
||||
nsICookieManager.idl \
|
||||
nsICookieConsent.idl \
|
||||
nsIImgManager.idl \
|
||||
nsIPermissionManager.idl \
|
||||
nsICookie.idl \
|
||||
|
|
|
@ -40,6 +40,7 @@ REQUIRES = xpcom \
|
|||
EXPORTS = nsCookieHTTPNotify.h
|
||||
|
||||
XPIDLSRCS= .\nsICookieManager.idl \
|
||||
.\nsICookieConsent.idl \
|
||||
.\nsIImgManager.idl \
|
||||
.\nsIPermissionManager.idl \
|
||||
.\nsICookie.idl \
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
#include "nsTextFormatter.h"
|
||||
#include "nsAppDirectoryServiceDefs.h"
|
||||
#include "nsIObserverService.h"
|
||||
//!!!!!#include "nsIP3PService.h"
|
||||
#include "nsICookieConsent.h"
|
||||
|
||||
#define MAX_NUMBER_OF_COOKIES 300
|
||||
#define MAX_COOKIES_PER_SERVER 20
|
||||
|
@ -131,6 +131,7 @@ PRIVATE char* cookie_P3P = nsnull;
|
|||
* The following defines are used to refer to these character positions and values
|
||||
*/
|
||||
|
||||
#define P3P_UnknownPolicy -1
|
||||
#define P3P_NoPolicy 0
|
||||
#define P3P_NoConsent 2
|
||||
#define P3P_ImplicitConsent 4
|
||||
|
@ -404,12 +405,6 @@ cookie_BehaviorPrefChanged(const char * newpref, void * data) {
|
|||
n = PERMISSION_Accept;
|
||||
}
|
||||
|
||||
if (n == PERMISSION_P3P) {
|
||||
// load p3p dll
|
||||
//!!!!! nsCOMPtr<nsIP3PService> p3p(do_GetService(NS_P3PSERVICE_CONTRACTID));
|
||||
//!!!!! if (!p3p) return 0;
|
||||
}
|
||||
|
||||
cookie_SetBehaviorPref((PERMISSION_BehaviorEnum)n);
|
||||
return 0;
|
||||
}
|
||||
|
@ -516,12 +511,6 @@ COOKIE_RegisterPrefCallbacks(void) {
|
|||
n = PERMISSION_Accept;
|
||||
}
|
||||
|
||||
if (n == PERMISSION_P3P) {
|
||||
// load p3p dll
|
||||
//!!!!! nsCOMPtr<nsIP3PService> p3p(do_GetService(NS_P3PSERVICE_CONTRACTID));
|
||||
//!!!!! if (!p3p) return;
|
||||
}
|
||||
|
||||
cookie_SetBehaviorPref((PERMISSION_BehaviorEnum)n);
|
||||
prefs->RegisterCallback(cookie_behaviorPref, cookie_BehaviorPrefChanged, nsnull);
|
||||
|
||||
|
@ -856,7 +845,7 @@ cookie_GetPolicy(int policy) {
|
|||
case P3P_NoIdentInfo:
|
||||
return nsICookie::POLICY_NO_II;
|
||||
}
|
||||
return nsICookie::POLICY_NONE;
|
||||
return nsICookie::POLICY_UNKNOWN;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -865,11 +854,13 @@ cookie_GetPolicy(int policy) {
|
|||
*/
|
||||
int
|
||||
P3P_SitePolicy(char * curURL, nsIHttpChannel* aHttpChannel) {
|
||||
int consent = P3P_NoPolicy;
|
||||
//!!!!! nsCOMPtr<nsIP3PService> p3p(do_GetService(NS_P3PSERVICE_CONTRACTID));
|
||||
//!!!!! if (p3p) {
|
||||
//!!!!! p3p->GetConsent(curURL,aHttpChannel,&consent);
|
||||
//!!!!! }
|
||||
int consent = P3P_UnknownPolicy;
|
||||
if (cookie_GetBehaviorPref() == PERMISSION_P3P) {
|
||||
nsCOMPtr<nsICookieConsent> p3p(do_GetService(NS_COOKIECONSENT_CONTRACTID));
|
||||
if (p3p) {
|
||||
p3p->GetConsent(curURL,aHttpChannel,&consent);
|
||||
}
|
||||
}
|
||||
return consent;
|
||||
}
|
||||
|
||||
|
|
|
@ -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"
|
||||
%}
|
|
@ -37,6 +37,7 @@ REQUIRES = xpcom \
|
|||
string \
|
||||
necko \
|
||||
pref \
|
||||
cookie \
|
||||
$(NULL)
|
||||
|
||||
CPPSRCS = \
|
||||
|
|
|
@ -46,6 +46,7 @@ REQUIRES = xpcom \
|
|||
string \
|
||||
necko \
|
||||
pref \
|
||||
cookie \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\config.mak>
|
||||
|
|
|
@ -51,7 +51,7 @@ static nsModuleComponentInfo gP3PComponents[] =
|
|||
{
|
||||
{"P3P Service",
|
||||
NS_P3PSERVICE_CID,
|
||||
NS_P3PSERVICE_CONTRACTID,
|
||||
NS_COOKIECONSENT_CONTRACTID,
|
||||
nsP3PServiceConstructor,
|
||||
}
|
||||
};
|
||||
|
|
|
@ -83,7 +83,7 @@ StopListeningToHeaders(nsP3PService* aService) {
|
|||
***********************************/
|
||||
|
||||
NS_IMPL_ISUPPORTS3(nsP3PService,
|
||||
nsIP3PService,
|
||||
nsICookieConsent,
|
||||
nsIHttpNotify,
|
||||
nsINetNotify);
|
||||
|
||||
|
|
|
@ -39,14 +39,14 @@
|
|||
#ifndef NS_P3PSERVICE_H__
|
||||
#define NS_P3PSERVICE_H__
|
||||
|
||||
#include "nsIP3PService.h"
|
||||
#include "nsICookieConsent.h"
|
||||
#include "nsIHttpNotify.h"
|
||||
#include "nsCompactPolicy.h"
|
||||
#include "nsIObserver.h"
|
||||
|
||||
class nsIPrefBranch;
|
||||
|
||||
class nsP3PService : public nsIP3PService,
|
||||
class nsP3PService : public nsICookieConsent,
|
||||
public nsIHttpNotify,
|
||||
public nsIObserver
|
||||
{
|
||||
|
@ -55,15 +55,15 @@ public:
|
|||
NS_DECL_ISUPPORTS
|
||||
// nsIHttpNotify
|
||||
NS_DECL_NSIHTTPNOTIFY
|
||||
// nsIP3PService
|
||||
NS_DECL_NSIP3PSERVICE
|
||||
// nsICookieConsent
|
||||
NS_DECL_NSICOOKIECONSENT
|
||||
// nsIObserver
|
||||
NS_DECL_NSIOBSERVER
|
||||
|
||||
nsP3PService( );
|
||||
virtual ~nsP3PService( );
|
||||
|
||||
// nsP3PService
|
||||
// P3PService
|
||||
nsresult Init();
|
||||
protected:
|
||||
nsresult ProcessResponseHeader(nsIHttpChannel* aHttpChannel);
|
||||
|
|
Загрузка…
Ссылка в новой задаче