gecko-dev/netwerk/cache
Nathan Froyd e7b3b3140d Bug 1415980 - make hash keys movable and not copyable; r=erahm
Everything that goes in a PLDHashtable (and its derivatives, like
nsTHashtable) needs to inherit from PLDHashEntryHdr. But through a lack
of enforcement, copy constructors for these derived classes didn't
explicitly invoke the copy constructor for PLDHashEntryHdr (and the
compiler didn't invoke the copy constructor for us). Instead,
PLDHashTable explicitly copied around the bits that the copy constructor
would have.

The current setup has two problems:

1) Derived classes should be using move construction, not copy
   construction, since anything that's shuffling hash table keys/entries
   around will be using move construction.

2) Derived classes should take responsibility for transferring bits of
   superclass state around, and not rely on something else to handle that.

The second point is not a huge problem for PLDHashTable (PLDHashTable
only has to copy PLDHashEntryHdr's bits in a single place), but future
hash table implementations that might move entries around more
aggressively would have to insert compensation code all over the
place. Additionally, if moving entries is implemented via memcpy (which
is quite common), PLDHashTable copying around bits *again* is
inefficient.

Let's fix all these problems in one go, by:

1) Explicitly declaring the set of constructors that PLDHashEntryHdr
   implements (and does not implement). In particular, the copy
   constructor is deleted, so any derived classes that attempt to make
   themselves copyable will be detected at compile time: the compiler
   will complain that the superclass type is not copyable.

This change on its own will result in many compiler errors, so...

2) Change any derived classes to implement move constructors instead of
   copy constructors. Note that some of these move constructors are,
   strictly speaking, unnecessary, since the relevant classes are moved
   via memcpy in nsTHashtable and its derivatives.
2018-09-20 11:20:36 -04:00
..
moz.build Bug 1488236 - Remove the XPCOM component registration for nsApplicationCacheNamespace; r=valentin 2018-09-03 14:28:40 -04:00
nsApplicationCache.h Bug 1488238 - Remove the XPCOM component registration for nsApplicationCache; r=valentin 2018-09-03 14:01:03 -04:00
nsApplicationCacheService.cpp Bug 1457411 - Update netwerk module to make use of newer methods introduced with c++11 and c++14. r=valentin 2018-04-30 19:46:04 +03:00
nsApplicationCacheService.h Bug 1457411 - Update netwerk module to make use of newer methods introduced with c++11 and c++14. r=valentin 2018-04-30 19:46:04 +03:00
nsCache.cpp Bug 685236 - Stop using GetNativePath in netwerk/. r=mayhemer 2017-12-15 20:21:19 +09:00
nsCache.h Bug 1410620 - Change CacheInfo interfaces in network to use ACString. r=michal,froydnj 2017-10-29 12:19:48 +01:00
nsCacheDevice.h Bug 1391803 - Use nsStringFwd.h for forward declaring string classes. r=froydnj 2017-08-16 16:48:52 -07:00
nsCacheEntry.cpp Bug 1415980 - make hash keys movable and not copyable; r=erahm 2018-09-20 11:20:36 -04:00
nsCacheEntry.h Bug 1475461 - part 2: Make callers of PLDHashTable::Search() const methods if possible r=Ehsan 2018-07-13 19:01:53 +09:00
nsCacheEntryDescriptor.cpp Bug 1486690 - Rename NS_str{,}dup and remove unnecessary checks after calls to them. r=glandium 2018-08-28 15:58:54 +10:00
nsCacheEntryDescriptor.h Bug 1453795 - Necko - Initialize member fields in classes/ structures. r=michal 2018-06-14 11:19:07 +03:00
nsCacheMetaData.cpp Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
nsCacheMetaData.h Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
nsCacheRequest.h Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
nsCacheService.cpp Bug 1473631: Part 14 - Replace pref observers with callbacks in nsCacheService. r=njn 2018-07-05 15:21:20 -07:00
nsCacheService.h Bug 1372405 - Provide names for all runnables in the tree (r=froydnj) 2017-06-26 14:19:58 -07:00
nsCacheSession.cpp Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
nsCacheSession.h Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
nsCacheUtils.cpp Bug 1457411 - Update netwerk module to make use of newer methods introduced with c++11 and c++14. r=valentin 2018-04-30 19:46:04 +03:00
nsCacheUtils.h Bug 1457411 - Update netwerk module to make use of newer methods introduced with c++11 and c++14. r=valentin 2018-04-30 19:46:04 +03:00
nsDeleteDir.cpp Bug 1462937: Update callers to use nsIFile::GetDirectoryEntries as a nsIDirectoryEnumerator. r=froydnj 2018-05-19 20:17:45 -07:00
nsDeleteDir.h
nsDiskCache.h Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
nsDiskCacheBinding.cpp Bug 1415980 - make hash keys movable and not copyable; r=erahm 2018-09-20 11:20:36 -04:00
nsDiskCacheBinding.h Bug 1475461 - part 2: Make callers of PLDHashTable::Search() const methods if possible r=Ehsan 2018-07-13 19:01:53 +09:00
nsDiskCacheBlockFile.cpp Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
nsDiskCacheBlockFile.h Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
nsDiskCacheDevice.cpp Bug 1457411 - Update netwerk module to make use of newer methods introduced with c++11 and c++14. r=valentin 2018-04-30 19:46:04 +03:00
nsDiskCacheDevice.h Bug 1428535 - Add missing override specifiers to overridden virtual functions. r=froydnj 2017-11-05 19:37:28 -08:00
nsDiskCacheDeviceSQL.cpp Bug 1486690 - Rename NS_str{,}dup and remove unnecessary checks after calls to them. r=glandium 2018-08-28 15:58:54 +10:00
nsDiskCacheDeviceSQL.h Bug 1457411 - Update netwerk module to make use of newer methods introduced with c++11 and c++14. r=valentin 2018-04-30 19:46:04 +03:00
nsDiskCacheEntry.cpp Bug 1410620 - Change CacheInfo interfaces in network to use ACString. r=michal,froydnj 2017-10-29 12:19:48 +01:00
nsDiskCacheEntry.h Bug 1457411 - Update netwerk module to make use of newer methods introduced with c++11 and c++14. r=valentin 2018-04-30 19:46:04 +03:00
nsDiskCacheMap.cpp Bug 1469769 - Part 6: Replace non-failing NS_NOTREACHED with MOZ_ASSERT_UNREACHABLE. r=froydnj 2018-06-17 22:43:11 -07:00
nsDiskCacheMap.h Bug 1378712 - Remove all trailing whitespaces r=Ehsan 2017-07-06 14:00:35 +02:00
nsDiskCacheStreams.cpp Bug 1469769 - Part 6: Replace non-failing NS_NOTREACHED with MOZ_ASSERT_UNREACHABLE. r=froydnj 2018-06-17 22:43:11 -07:00
nsDiskCacheStreams.h Bug 1469769 - Part 6: Replace non-failing NS_NOTREACHED with MOZ_ASSERT_UNREACHABLE. r=froydnj 2018-06-17 22:43:11 -07:00
nsICache.idl Bug 1451063 - nsICache does not inherit from nsISupports r=michal 2018-04-05 16:58:44 +03:00
nsICacheEntryDescriptor.idl
nsICacheListener.idl
nsICacheService.idl
nsICacheSession.idl
nsICacheVisitor.idl Bug 1410620 - Change CacheInfo interfaces in network to use ACString. r=michal,froydnj 2017-10-29 12:19:48 +01:00
nsMemoryCacheDevice.cpp Bug 1457411 - Update netwerk module to make use of newer methods introduced with c++11 and c++14. r=valentin 2018-04-30 19:46:04 +03:00
nsMemoryCacheDevice.h Bug 1457411 - Update netwerk module to make use of newer methods introduced with c++11 and c++14. r=valentin 2018-04-30 19:46:04 +03:00