зеркало из https://github.com/mozilla/gecko-dev.git
polish the nsICookieManager2::Add interface a tad.
b=222343, r=danm, sr=darin.
This commit is contained in:
Родитель
c7754ba02e
Коммит
b6f814cb06
|
@ -49,6 +49,7 @@
|
|||
#include "plstr.h"
|
||||
#include "prio.h"
|
||||
#include "prmem.h"
|
||||
#include "prlong.h"
|
||||
#include "nsICookieManager2.h"
|
||||
#include "nsICookieService.h"
|
||||
#include "nsIFile.h"
|
||||
|
@ -600,7 +601,9 @@ nsTridentPreferencesWin::CopyCookiesFromBuffer(
|
|||
nsDependentCString(path),
|
||||
nsDependentCString(name),
|
||||
nsDependentCString(value),
|
||||
flagsValue & 0x1, expirationDate);
|
||||
flagsValue & 0x1,
|
||||
PR_FALSE,
|
||||
PRInt64(expirationDate));
|
||||
if (NS_FAILED(onerv)) {
|
||||
rv = onerv;
|
||||
break;
|
||||
|
|
|
@ -51,7 +51,9 @@ interface nsICookieManager2 : nsICookieManager
|
|||
* method is something of a backdoor.
|
||||
*
|
||||
* @param aDomain
|
||||
* the host or domain for which the cookie is set
|
||||
* the host or domain for which the cookie is set. presence of a
|
||||
* leading dot indicates a domain cookie; otherwise, the cookie
|
||||
* is treated as a non-domain cookie. see RFC2109.
|
||||
* @param aPath
|
||||
* path within the domain for which the cookie is valid
|
||||
* @param aName
|
||||
|
@ -59,9 +61,12 @@ interface nsICookieManager2 : nsICookieManager
|
|||
* @param aValue
|
||||
* cookie data
|
||||
* @param aSecure
|
||||
* true if the cookie should be secure
|
||||
* @param aExpires
|
||||
* expiration date. 0 means none; a session cookie.
|
||||
* true if the cookie should only be sent over a secure connection.
|
||||
* @param aIsSession
|
||||
* true if the cookie should exist for the current session only.
|
||||
* @param aExpiry
|
||||
* expiration date, in seconds since the epoch. only relevant if
|
||||
* aIsSession is false.
|
||||
*/
|
||||
[noscript]
|
||||
void add(in AUTF8String aDomain,
|
||||
|
@ -69,7 +74,8 @@ interface nsICookieManager2 : nsICookieManager
|
|||
in ACString aName,
|
||||
in ACString aValue,
|
||||
in boolean aSecure,
|
||||
in PRInt32 aExpires);
|
||||
in boolean aIsSession,
|
||||
in PRInt64 aExpiry);
|
||||
|
||||
/**
|
||||
* Find whether a matching cookie already exists, and how many cookies
|
||||
|
|
|
@ -922,15 +922,18 @@ nsCookieService::Add(const nsACString &aDomain,
|
|||
const nsACString &aPath,
|
||||
const nsACString &aName,
|
||||
const nsACString &aValue,
|
||||
PRBool aIsSecure,
|
||||
PRInt32 aExpires)
|
||||
PRBool aIsSecure,
|
||||
PRBool aIsSession,
|
||||
PRInt64 aExpiry)
|
||||
{
|
||||
nsInt64 currentTime = NOW_IN_SECONDS;
|
||||
|
||||
nsRefPtr<nsCookie> cookie =
|
||||
new nsCookie(aName, aValue, aDomain, aPath,
|
||||
nsInt64(aExpires), currentTime,
|
||||
nsInt64(aExpires) == nsInt64(0), aIsSecure,
|
||||
nsInt64(aExpiry),
|
||||
currentTime,
|
||||
aIsSession,
|
||||
aIsSecure,
|
||||
nsICookie::STATUS_UNKNOWN,
|
||||
nsICookie::POLICY_UNKNOWN);
|
||||
if (!cookie) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче