Add api Cookie_RemoveAllCookies

This commit is contained in:
neeti%netscape.com 1999-08-09 18:36:55 +00:00
parent 5294289135
commit 284ae1a72f
4 changed files with 22 additions and 1 deletions

View File

@ -573,6 +573,14 @@ cookie_RemoveAllCookies() {
cookie_UnlockCookieList();
}
PUBLIC void
COOKIE_RemoveAllCookies()
{
cookie_RemoveAllPermissions();
cookie_RemoveAllCookies();
}
PRIVATE void
cookie_RemoveOldestCookie(void) {
cookie_CookieStruct * cookie_s;
@ -2138,7 +2146,7 @@ cookie_FindValueInArgs(nsAutoString results, char* name) {
PRInt32 start, length;
start = results.Find(name);
// XP_ASSERT(start >= 0);
NS_ASSERTION(start < 0, "bad data");
NS_ASSERTION(start >= 0, "bad data");
if (start < 0) {
return nsAutoString("").ToNewCString();
}

View File

@ -33,6 +33,7 @@ extern char * COOKIE_GetCookie(char * address);
extern void COOKIE_SetCookieString(char * cur_url, char * set_cookie_header);
extern int COOKIE_ReadCookies();
extern void COOKIE_RegisterCookiePrefCallbacks(void);
extern void COOKIE_RemoveAllCookies(void);
extern void COOKIE_SetCookieStringFromHttp(char * cur_url, char * set_cookie_header, char * server_date);
extern void COOKIE_GetCookieListForViewer (nsString& aCookieList);
extern void COOKIE_GetPermissionListForViewer (nsString& aPermissionList);

View File

@ -47,6 +47,7 @@ public:
NS_IMETHOD GetCookieString(nsIURI *aURL, nsString& aCookie);
NS_IMETHOD SetCookieString(nsIURI *aURL, const nsString& aCookie);
NS_IMETHOD Cookie_RemoveAllCookies(void);
NS_IMETHOD Cookie_CookieViewerReturn(nsAutoString results);
NS_IMETHOD Cookie_GetCookieListForViewer(nsString& aCookieList);
NS_IMETHOD Cookie_GetPermissionListForViewer(nsString& aPermissionList);
@ -176,6 +177,11 @@ nsCookieService::SetCookieString(nsIURI *aURL, const nsString& aCookie) {
return NS_OK;
}
NS_IMETHODIMP nsCookieService::Cookie_RemoveAllCookies(void) {
::COOKIE_RemoveAllCookies();
return NS_OK;
}
NS_IMETHODIMP nsCookieService::Cookie_CookieViewerReturn(nsAutoString results) {
::COOKIE_CookieViewerReturn(results);
return NS_OK;

View File

@ -54,6 +54,12 @@ public:
*/
NS_IMETHOD SetCookieString(nsIURI *aURL, const nsString& aCookie)=0;
/*
* Blows away all permissions currently in the cookie permissions list,
* and then blows away all cookies currently in the cookie list.
*/
NS_IMETHOD Cookie_RemoveAllCookies(void)=0;
/*
* Interface routines for cookie viewer
*/