Bug 1160368 - Part 2: Clean up some cruft in nsCookie.h from PRBool/bool conversions. r=jdm
authorChris Peterson <cpeterson@mozilla.com>
Sat, 20 Feb 2016 22:22:35 -0800
changeset 332331 3558dbf6f998834768f57c7c5c57a6472923a3a8
parent 332330 d2dc79c8d77cd1a0fe01ad01b07a0d026397a440
child 332332 3135bc1a480aebdf1dc0cce13efef61e82303f52
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdm
bugs1160368
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1160368 - Part 2: Clean up some cruft in nsCookie.h from PRBool/bool conversions. r=jdm Also make nsCookie's member variables private.
netwerk/cookie/nsCookie.h
--- a/netwerk/cookie/nsCookie.h
+++ b/netwerk/cookie/nsCookie.h
@@ -51,19 +51,19 @@ class nsCookie : public nsICookie2
      : mName(aName)
      , mValue(aValue)
      , mHost(aHost)
      , mPath(aPath)
      , mEnd(aEnd)
      , mExpiry(aExpiry)
      , mLastAccessed(aLastAccessed)
      , mCreationTime(aCreationTime)
-     , mIsSession(aIsSession != false)
-     , mIsSecure(aIsSecure != false)
-     , mIsHttpOnly(aIsHttpOnly != false)
+     , mIsSession(aIsSession)
+     , mIsSecure(aIsSecure)
+     , mIsHttpOnly(aIsHttpOnly)
      , mOriginAttributes(aOriginAttributes)
     {
     }
 
   public:
     // Generate a unique and monotonically increasing creation time. See comment
     // in nsCookie.cpp.
     static int64_t GenerateUniqueCreationTime(int64_t aCreationTime);
@@ -96,26 +96,27 @@ class nsCookie : public nsICookie2
     inline bool IsSession()               const { return mIsSession; }
     inline bool IsDomain()                const { return *mHost == '.'; }
     inline bool IsSecure()                const { return mIsSecure; }
     inline bool IsHttpOnly()              const { return mIsHttpOnly; }
 
     // setters
     inline void SetExpiry(int64_t aExpiry)        { mExpiry = aExpiry; }
     inline void SetLastAccessed(int64_t aTime)    { mLastAccessed = aTime; }
-    inline void SetIsSession(bool aIsSession)   { mIsSession = (bool) aIsSession; }
+    inline void SetIsSession(bool aIsSession)     { mIsSession = aIsSession; }
     // Set the creation time manually, overriding the monotonicity checks in
     // Create(). Use with caution!
     inline void SetCreationTime(int64_t aTime)    { mCreationTime = aTime; }
 
     bool IsStale() const;
 
   protected:
     virtual ~nsCookie() {}
 
+  private:
     // member variables
     // we use char* ptrs to store the strings in a contiguous block,
     // so we save on the overhead of using nsCStrings. However, we
     // store a terminating null for each string, so we can hand them
     // out as nsAFlatCStrings.
     //
     // Please update SizeOfIncludingThis if this strategy changes.
     const char  *mName;