Bug 411952 - Cookie's creationTime needs to be exposed via nsICookie2; r=mconnor, sr=bzbarsky
--- a/netwerk/cookie/public/nsICookie2.idl
+++ b/netwerk/cookie/public/nsICookie2.idl
@@ -39,17 +39,17 @@
#include "nsICookie.idl"
/**
* Main cookie object interface for use by consumers:
* extends nsICookie, a frozen interface for external
* access of cookie objects
*/
-[scriptable, uuid(736619fe-8d09-4e59-8223-32f176c22977)]
+[scriptable, uuid(8587f4e0-870c-11dd-ad8b-0800200c9a66)]
interface nsICookie2 : nsICookie
{
/**
* the host (possibly fully qualified) of the cookie,
* without a leading dot to represent if it is a
* domain cookie.
@@ -73,10 +73,16 @@ interface nsICookie2 : nsICookie
*/
readonly attribute PRInt64 expiry;
/**
* true if the cookie is an http only cookie
*/
readonly attribute boolean isHttpOnly;
+ /**
+ * the creation time of the cookie, in seconds
+ * since midnight (00:00:00), January 1, 1970 UTC.
+ */
+ readonly attribute PRInt64 creationTime;
+
};
--- a/netwerk/cookie/src/nsCookie.cpp
+++ b/netwerk/cookie/src/nsCookie.cpp
@@ -137,16 +137,17 @@ NS_IMETHODIMP nsCookie::GetRawHost(nsACS
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::GetIsHttpOnly(PRBool *aHttpOnly) { *aHttpOnly = IsHttpOnly(); return NS_OK; }
NS_IMETHODIMP nsCookie::GetStatus(nsCookieStatus *aStatus) { *aStatus = 0; return NS_OK; }
NS_IMETHODIMP nsCookie::GetPolicy(nsCookiePolicy *aPolicy) { *aPolicy = 0; return NS_OK; }
+NS_IMETHODIMP nsCookie::GetCreationTime(PRInt64 *aCreation){ *aCreation = CreationID(); 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;