netwerk/cookie/nsCookie.h

branch
TOR_BUG_3246
changeset 4
fc2d59ddac77
parent 0
6474c204b198
equal deleted inserted replaced
0:48441bd5886e 1:2f4c2ced3790
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,
45 bool aIsSecure, 46 bool aIsSecure,
46 bool aIsHttpOnly) 47 bool aIsHttpOnly)
47 : mName(aName) 48 : mName(aName)
48 , mValue(aValue) 49 , mValue(aValue)
49 , mHost(aHost) 50 , mHost(aHost)
51 , mOrigin(aOrigin)
50 , mPath(aPath) 52 , mPath(aPath)
51 , mEnd(aEnd) 53 , mEnd(aEnd)
52 , mExpiry(aExpiry) 54 , mExpiry(aExpiry)
53 , mLastAccessed(aLastAccessed) 55 , mLastAccessed(aLastAccessed)
54 , mCreationTime(aCreationTime) 56 , mCreationTime(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; }
111 // 115 //
112 // Please update SizeOfIncludingThis if this strategy changes. 116 // Please update SizeOfIncludingThis if this strategy changes.
113 const char *mName; 117 const char *mName;
114 const char *mValue; 118 const char *mValue;
115 const char *mHost; 119 const char *mHost;
120 const char *mOrigin;
116 const char *mPath; 121 const char *mPath;
117 const char *mEnd; 122 const char *mEnd;
118 int64_t mExpiry; 123 int64_t mExpiry;
119 int64_t mLastAccessed; 124 int64_t mLastAccessed;
120 int64_t mCreationTime; 125 int64_t mCreationTime;

mercurial