Bug 941598 - constify PLDHashTableOps in netwerk/; r=jduell
authorNathan Froyd <froydnj@mozilla.com>
Wed, 20 Nov 2013 13:17:01 -0500
changeset 157043 6f5bf94c608c1e0cd317c216b6deb18ab16b4c4c
parent 157042 d1f4fda9c0aa144c5cb88db682b4734adb9abe65
child 157044 8c65b69f6d5f52543659500e874456c0c7b8276e
push id25697
push userryanvm@gmail.com
push dateFri, 22 Nov 2013 20:18:23 +0000
treeherdermozilla-central@e9796b650e93 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjduell
bugs941598
milestone28.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 941598 - constify PLDHashTableOps in netwerk/; r=jduell
netwerk/base/src/nsLoadGroup.cpp
netwerk/cache/nsCacheEntry.cpp
netwerk/cache/nsCacheEntry.h
netwerk/cache/nsDiskCacheBinding.cpp
netwerk/cache/nsDiskCacheBinding.h
netwerk/cache2/CacheFileIOManager.cpp
netwerk/cache2/CacheFileIOManager.h
netwerk/dns/nsHostResolver.cpp
--- a/netwerk/base/src/nsLoadGroup.cpp
+++ b/netwerk/base/src/nsLoadGroup.cpp
@@ -1151,17 +1151,17 @@ NS_IMETHODIMP
 nsLoadGroupConnectionInfo::SetSpdyPushCache(mozilla::net::SpdyPushCache *aSpdyPushCache)
 {
     mSpdyCache = aSpdyPushCache;
     return NS_OK;
 }
 
 nsresult nsLoadGroup::Init()
 {
-    static PLDHashTableOps hash_table_ops =
+    static const PLDHashTableOps hash_table_ops =
     {
         PL_DHashAllocTable,
         PL_DHashFreeTable,
         PL_DHashVoidPtrKeyStub,
         RequestHashMatchEntry,
         PL_DHashMoveEntryStub,
         RequestHashClearEntry,
         PL_DHashFinalizeStub,
--- a/netwerk/cache/nsCacheEntry.cpp
+++ b/netwerk/cache/nsCacheEntry.cpp
@@ -369,17 +369,17 @@ nsCacheEntryInfo::IsStreamBased(bool * r
     return NS_OK;
 }
 
 
 /******************************************************************************
  *  nsCacheEntryHashTable
  *****************************************************************************/
 
-PLDHashTableOps
+const PLDHashTableOps
 nsCacheEntryHashTable::ops =
 {
     PL_DHashAllocTable,
     PL_DHashFreeTable,
     HashKey,
     MatchEntry,
     MoveEntry,
     ClearEntry,
--- a/netwerk/cache/nsCacheEntry.h
+++ b/netwerk/cache/nsCacheEntry.h
@@ -298,14 +298,14 @@ private:
                                            void *            arg);
     static
     PLDHashOperator       VisitEntry(PLDHashTable *         table,
                                      PLDHashEntryHdr *      hdr,
                                      uint32_t               number,
                                      void *                 arg);
                                      
     // member variables
-    static PLDHashTableOps ops;
-    PLDHashTable           table;
-    bool                   initialized;
+    static const PLDHashTableOps ops;
+    PLDHashTable                 table;
+    bool                         initialized;
 };
 
 #endif // _nsCacheEntry_h_
--- a/netwerk/cache/nsDiskCacheBinding.cpp
+++ b/netwerk/cache/nsDiskCacheBinding.cpp
@@ -117,17 +117,17 @@ nsDiskCacheBinding::EnsureStreamIO()
 
 /******************************************************************************
  *  nsDiskCacheBindery
  *
  *  Keeps track of bound disk cache entries to detect for collisions.
  *
  *****************************************************************************/
 
-PLDHashTableOps nsDiskCacheBindery::ops =
+const PLDHashTableOps nsDiskCacheBindery::ops =
 {
     PL_DHashAllocTable,
     PL_DHashFreeTable,
     HashKey,
     MatchEntry,
     MoveEntry,
     ClearEntry,
     PL_DHashFinalizeStub
--- a/netwerk/cache/nsDiskCacheBinding.h
+++ b/netwerk/cache/nsDiskCacheBinding.h
@@ -107,14 +107,14 @@ public:
     bool                    ActiveBindings();
 
     size_t                 SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf);
 
 private:
     nsresult                AddBinding(nsDiskCacheBinding * binding);
 
     // member variables
-    static PLDHashTableOps ops;
+    static const PLDHashTableOps ops;
     PLDHashTable           table;
     bool                   initialized;
 };
 
 #endif /* _nsDiskCacheBinding_h_ */
--- a/netwerk/cache2/CacheFileIOManager.cpp
+++ b/netwerk/cache2/CacheFileIOManager.cpp
@@ -94,17 +94,17 @@ CacheFileHandle::~CacheFileHandle()
 
 class CacheFileHandlesEntry : public PLDHashEntryHdr
 {
 public:
   PRCList      *mHandles;
   SHA1Sum::Hash mHash;
 };
 
-PLDHashTableOps CacheFileHandles::mOps =
+const PLDHashTableOps CacheFileHandles::mOps =
 {
   PL_DHashAllocTable,
   PL_DHashFreeTable,
   HashKey,
   MatchEntry,
   MoveEntry,
   ClearEntry,
   PL_DHashFinalizeStub
--- a/netwerk/cache2/CacheFileIOManager.h
+++ b/netwerk/cache2/CacheFileIOManager.h
@@ -78,19 +78,19 @@ private:
   static bool          MatchEntry(PLDHashTable *table,
                                   const PLDHashEntryHdr *entry,
                                   const void *key);
   static void          MoveEntry(PLDHashTable *table,
                                  const PLDHashEntryHdr *from,
                                  PLDHashEntryHdr *to);
   static void          ClearEntry(PLDHashTable *table, PLDHashEntryHdr *entry);
 
-  static PLDHashTableOps mOps;
-  PLDHashTable           mTable;
-  bool                   mInitialized;
+  static const PLDHashTableOps mOps;
+  PLDHashTable                 mTable;
+  bool                         mInitialized;
 };
 
 ////////////////////////////////////////////////////////////////////////////////
 
 class OpenFileEvent;
 class CloseFileEvent;
 class ReadEvent;
 class WriteEvent;
--- a/netwerk/dns/nsHostResolver.cpp
+++ b/netwerk/dns/nsHostResolver.cpp
@@ -347,17 +347,17 @@ HostDB_InitEntry(PLDHashTable *table,
                  PLDHashEntryHdr *entry,
                  const void *key)
 {
     nsHostDBEnt *he = static_cast<nsHostDBEnt *>(entry);
     nsHostRecord::Create(static_cast<const nsHostKey *>(key), &he->rec);
     return true;
 }
 
-static PLDHashTableOps gHostDB_ops =
+static const PLDHashTableOps gHostDB_ops =
 {
     PL_DHashAllocTable,
     PL_DHashFreeTable,
     HostDB_HashKey,
     HostDB_MatchEntry,
     HostDB_MoveEntry,
     HostDB_ClearEntry,
     PL_DHashFinalizeStub,