Bug 411952 - Cookie's creationTime needs to be exposed via nsICookie2; r=mconnor, sr=bzbarsky
authorEhsan Akhgari <ehsan.akhgari@gmail.com>
Fri, 31 Oct 2008 17:19:18 +0330
changeset 21146 4c45de52678232061c68812946ef4baf12081b2a
parent 21145 94209029c870e6d7293cc4cdd44112fd71e88c55
child 21147 75036e89468d82f0724e89cfdd224fcc7f4a2ac4
push id3353
push userehsan.akhgari@gmail.com
push dateFri, 31 Oct 2008 13:50:04 +0000
treeherdermozilla-central@4c45de526782 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconnor, bzbarsky
bugs411952
milestone1.9.1b2pre
Bug 411952 - Cookie's creationTime needs to be exposed via nsICookie2; r=mconnor, sr=bzbarsky
netwerk/cookie/public/nsICookie2.idl
netwerk/cookie/src/nsCookie.cpp
--- 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;