34 private: |
34 private: |
35 // for internal use only. see nsCookie::Create(). |
35 // for internal use only. see nsCookie::Create(). |
36 nsCookie(const char *aName, |
36 nsCookie(const char *aName, |
37 const char *aValue, |
37 const char *aValue, |
38 const char *aHost, |
38 const char *aHost, |
|
39 const char *aOrigin, |
39 const char *aPath, |
40 const char *aPath, |
40 const char *aEnd, |
41 const char *aEnd, |
41 int64_t aExpiry, |
42 int64_t aExpiry, |
42 int64_t aLastAccessed, |
43 int64_t aLastAccessed, |
43 int64_t aCreationTime, |
44 int64_t aCreationTime, |
66 // public helper to create an nsCookie object. use |operator delete| |
68 // public helper to create an nsCookie object. use |operator delete| |
67 // to destroy an object created by this method. |
69 // to destroy an object created by this method. |
68 static nsCookie * Create(const nsACString &aName, |
70 static nsCookie * Create(const nsACString &aName, |
69 const nsACString &aValue, |
71 const nsACString &aValue, |
70 const nsACString &aHost, |
72 const nsACString &aHost, |
|
73 const nsACString &aOrigin, |
71 const nsACString &aPath, |
74 const nsACString &aPath, |
72 int64_t aExpiry, |
75 int64_t aExpiry, |
73 int64_t aLastAccessed, |
76 int64_t aLastAccessed, |
74 int64_t aCreationTime, |
77 int64_t aCreationTime, |
75 bool aIsSession, |
78 bool aIsSession, |
81 size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const; |
84 size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const; |
82 |
85 |
83 // fast (inline, non-xpcom) getters |
86 // fast (inline, non-xpcom) getters |
84 inline const nsDependentCString Name() const { return nsDependentCString(mName, mValue - 1); } |
87 inline const nsDependentCString Name() const { return nsDependentCString(mName, mValue - 1); } |
85 inline const nsDependentCString Value() const { return nsDependentCString(mValue, mHost - 1); } |
88 inline const nsDependentCString Value() const { return nsDependentCString(mValue, mHost - 1); } |
86 inline const nsDependentCString Host() const { return nsDependentCString(mHost, mPath - 1); } |
89 inline const nsDependentCString Host() const { return nsDependentCString(mHost, mOrigin - 1); } |
87 inline const nsDependentCString RawHost() const { return nsDependentCString(IsDomain() ? mHost + 1 : mHost, mPath - 1); } |
90 inline const nsDependentCString RawHost() const { return nsDependentCString(IsDomain() ? mHost + 1 : mHost, mOrigin - 1); } |
|
91 inline const nsDependentCString Origin() const { return nsDependentCString(mOrigin, mPath - 1); } |
88 inline const nsDependentCString Path() const { return nsDependentCString(mPath, mEnd); } |
92 inline const nsDependentCString Path() const { return nsDependentCString(mPath, mEnd); } |
89 inline int64_t Expiry() const { return mExpiry; } // in seconds |
93 inline int64_t Expiry() const { return mExpiry; } // in seconds |
90 inline int64_t LastAccessed() const { return mLastAccessed; } // in microseconds |
94 inline int64_t LastAccessed() const { return mLastAccessed; } // in microseconds |
91 inline int64_t CreationTime() const { return mCreationTime; } // in microseconds |
95 inline int64_t CreationTime() const { return mCreationTime; } // in microseconds |
92 inline bool IsSession() const { return mIsSession; } |
96 inline bool IsSession() const { return mIsSession; } |