gecko-dev/xpcom/base
Andrew McCreight e2ebefc242 Bug 1207368 - Use swap() instead of forget() to remove MessageElement::mMessage. r=froydnj
Using forget() to extract mMessage from MessageElement ends up going
from nsCOMPtr<T> to already_AddRefed<T> to nsCOMPtr<T>. For the second
step, the compiler can't tell that the already_AddRefed<T> came from a
canonical nsCOMPtr, so it calls Assert_NoQueryNeeded() in debug
builds. This in turn causes a QI, which does an AddRef. That is bad
because we're not on the main thread, and mMessage is
main-thread-only, so we get an assertion.

This patch works around that by using swap directly between two
nsCOMPtr<>, which avoids the Assert_NoQueryNeeded().

I called the method "swapMessage" rather than "swap" to emphasize that
we are not swapping the whole MessageElement, but just one part of
it. I find the existing forget() name to be confusing.
2015-10-02 14:47:13 -07:00
..
AvailableMemoryTracker.cpp Bug 1182996 - Fix and add missing namespace comments. rs=ehsan 2015-07-13 08:25:42 -07:00
AvailableMemoryTracker.h
ClearOnShutdown.cpp
ClearOnShutdown.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
CodeAddressService.h Bug 1172216 - Move nsStackwalk to mozglue. r=glandium 2015-06-10 16:32:45 -04:00
CountingAllocatorBase.h
CycleCollectedJSRuntime.cpp Bug 1199843 - Part 3: Strongly type JS::TraceChildren; r=jonco r=mccr8 2015-09-02 11:34:36 -07:00
CycleCollectedJSRuntime.h Bug 1203840 - Trigger dirty pages purge after CC. r=njn,r=smaug,r=mccr8 2015-09-20 17:43:43 +09:00
Debug.cpp
Debug.h
DebuggerOnGCRunnable.cpp Bug 1150253 - Part 2: Gecko should provide a callback for SpiderMonkey to 2015-04-22 09:43:02 -07:00
DebuggerOnGCRunnable.h Bug 1150253 - Part 2: Gecko should provide a callback for SpiderMonkey to 2015-04-22 09:43:02 -07:00
DeferredFinalize.cpp Bug 1137536, part 3 - Move the top level DeferredFinalize functions into their own file. r=smaug 2015-03-18 11:36:03 -07:00
DeferredFinalize.h Bug 1174796 - Make sure ReleaseNow releases everything. r=smaug 2015-06-16 14:19:07 -07:00
ErrorList.h Bug 1198230 - Respect FetchEvent.preventDefault(). r=jdm 2015-09-04 12:00:24 -07:00
ErrorNames.cpp Bug 1151541, part 2 - Fix mode lines in xpcom/. r=froydnj 2015-04-09 10:25:05 -07:00
ErrorNames.h Bug 1182996 - Fix and add missing namespace comments. rs=ehsan 2015-07-13 08:25:42 -07:00
HoldDropJSObjects.cpp Bug 1119482, part 4 - Move IsJSHolder into HoldDropJSObjects. r=smaug 2015-03-10 16:41:38 -07:00
HoldDropJSObjects.h Bug 1119482, part 4 - Move IsJSHolder into HoldDropJSObjects. r=smaug 2015-03-10 16:41:38 -07:00
JSObjectHolder.cpp Bug 1179924 - Create a more modern JS object holder for cross-thread references to JS objects. r=smaug 2015-07-21 11:31:44 -07:00
JSObjectHolder.h Bug 1179924 - Create a more modern JS object holder for cross-thread references to JS objects. r=smaug 2015-07-21 11:31:44 -07:00
LinuxUtils.cpp
LinuxUtils.h
MacHelpers.h Bug 1131325 - Move system country code from nsIGfxInfo2 to a more appropriate location. r=aklotz,smichaud 2015-07-28 15:45:34 -07:00
MacHelpers.mm Bug 1131325 - Move system country code from nsIGfxInfo2 to a more appropriate location. r=aklotz,smichaud 2015-07-28 15:45:34 -07:00
OwningNonNull.h Bug 1190823 - Move OwningNonNull.h to xpcom/base/; r=froydnj 2015-08-05 15:28:27 +03:00
StaticMutex.h Bug 1151541, part 2 - Fix mode lines in xpcom/. r=froydnj 2015-04-09 10:25:05 -07:00
StaticPtr.h Bug 1120062 - Part 1: Remove most Nullptr.h includes. r=waldo 2015-01-11 11:34:52 +09:00
SystemMemoryReporter.cpp Bug 1204403 - Fix -Wshadow warnings in xpcom. r=mccr8 2015-09-07 23:56:16 -07:00
SystemMemoryReporter.h
moz.build Bug 1204403 - Fix -Wshadow warnings in xpcom. r=mccr8 2015-09-07 23:56:16 -07:00
nsAgg.h Bug 1122999 - Mark the fOuter member defined by NS_DECL_AGGREGATED as unsafe; r=froydnj 2015-01-19 10:00:32 -05:00
nsAlgorithm.h Bug 1182996 - Fix and add missing namespace comments. rs=ehsan 2015-07-13 08:25:42 -07:00
nsAllocator.h
nsAutoPtr.h Bug 1196050 - Replace NSCAP_Zero usage with decltype(nullptr). r=froydnj 2015-08-20 10:30:10 +10:00
nsAutoRef.h Bug 1118486 - Part 1: Use `= delete` instead of MOZ_DELETE directly; r=Waldo 2015-01-08 23:19:05 -05:00
nsCom.h
nsConsoleMessage.cpp Bug 1060171 - Part 1: Add log levels to nsIConsoleMessage. r=froydnj 2014-09-22 15:32:21 -07:00
nsConsoleMessage.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
nsConsoleService.cpp Bug 1207368 - Use swap() instead of forget() to remove MessageElement::mMessage. r=froydnj 2015-10-02 14:47:13 -07:00
nsConsoleService.h Bug 1207368 - Use swap() instead of forget() to remove MessageElement::mMessage. r=froydnj 2015-10-02 14:47:13 -07:00
nsCrashOnException.cpp
nsCrashOnException.h
nsCycleCollector.cpp Bug 1208157, part 2 - Make the fields of nsCycleCollector private. r=smaug 2015-09-25 10:43:21 -07:00
nsCycleCollector.h Bug 1203840 - Trigger dirty pages purge after CC. r=njn,r=smaug,r=mccr8 2015-09-20 17:43:43 +09:00
nsDebugImpl.cpp Bug 1171931 - Refactor duplicated code using XRE_IsParent/ContentProcess. r=froydnj 2015-07-03 18:29:00 -07:00
nsDebugImpl.h Bug 1163916 (part 1) - Avoid a static nsDebugImpl constructor. r=froydnj. 2015-05-13 16:47:55 -07:00
nsDumpUtils.cpp Bug 1154435 - [nsDumpUtil] Refine nsDumpUtils::OpenTempFile to make this function more flexible. r=dhylands 2015-06-04 14:47:09 +08:00
nsDumpUtils.h Bug 1154435 - [nsDumpUtil] Refine nsDumpUtils::OpenTempFile to make this function more flexible. r=dhylands 2015-06-04 14:47:09 +08:00
nsError.h Bug 1128273 - Stop using |typedef enum class tag_nsresult { ... } nsresult;| trick. r=froydnj 2015-02-02 23:44:25 +09:00
nsErrorService.cpp
nsErrorService.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
nsGZFileWriter.cpp Bug 1154435 - [nsGZFileWriter] Add one more mode for writing a GZFile (Create/Append). r=froydnj 2015-06-05 11:20:16 +08:00
nsGZFileWriter.h Bug 1154435 - [nsGZFileWriter] Add one more mode for writing a GZFile (Create/Append). r=froydnj 2015-06-05 11:20:16 +08:00
nsIConsoleListener.idl
nsIConsoleMessage.idl Bug 1060171 - Part 1: Add log levels to nsIConsoleMessage. r=froydnj 2014-09-22 15:32:21 -07:00
nsIConsoleService.idl Bug 1152574: Fix console service discarding to run when it is actually safe to do so (off of inner-window-destroyed). Also add a backstop at xpcom-shutdown to discard any cycle collected messages before it is too late. r=froydnj 2015-07-31 06:49:27 -07:00
nsICycleCollectorListener.idl Bug 1163006, part 4 - De-COM the nsICycleCollectorListener methods we only call from C++. r=smaug 2015-06-04 14:41:31 -07:00
nsIDebug2.idl Bug 1155643 - Removed nsIDebug.idl, moved methods of nsIDebug to nsIDebug2. r=paolo 2015-05-07 10:58:37 +05:30
nsIErrorService.idl
nsIException.idl Bug 1140435 - Part 2 - Allow JS code to provide an async stack when calling a function. r=bz 2015-03-07 13:30:34 +00:00
nsIGZFileWriter.idl
nsIID.h
nsIInterfaceRequestor.idl
nsIMacUtils.idl
nsIMemory.idl Bug 1181518 - Change the reason for memory-pressure fired during priority change. r=gsvelto 2015-07-15 17:07:39 +08:00
nsIMemoryInfoDumper.idl Bug 1044709 - Improve the comment describing the memory report file format. r=mccr8. 2014-09-28 18:35:14 -07:00
nsIMemoryReporter.idl Bug 986302 - Add memory reporting for HPACK tables r=hurley r=njn 2015-07-17 14:38:10 -07:00
nsIMessageLoop.idl
nsIMutable.idl
nsIProgrammingLanguage.idl Bug 1150917 - Remove all values from nsIProgrammingLanguage except UNKNOWN and JAVASCRIPT. r=froydnj 2015-04-08 17:16:30 -07:00
nsISecurityConsoleMessage.idl
nsISizeOf.h
nsIStatusReporter.idl Bug 1148527 - Indentation fix after bug 1145631, r=ehsan 2015-03-27 18:52:19 +00:00
nsISupports.idl
nsISupportsBase.h
nsIUUIDGenerator.idl
nsIVersionComparator.idl
nsIWeakReference.idl
nsInterfaceRequestorAgg.cpp Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
nsInterfaceRequestorAgg.h
nsMacUtilsImpl.cpp Bug 1191100 - Remove XPIDL signature comments in .cpp files. r=ehsan 2015-08-04 16:17:36 -07:00
nsMacUtilsImpl.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
nsMemoryImpl.cpp Bug 1134923 - Remove NS_Alloc/NS_Realloc/NS_Free. r=nfroyd 2015-05-01 09:40:30 +09:00
nsMemoryImpl.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
nsMemoryInfoDumper.cpp Bug 1182996 - Fix and add missing namespace comments. rs=ehsan 2015-07-13 08:25:42 -07:00
nsMemoryInfoDumper.h Bug 1156632 - Remove unused forward class declarations - patch 6 - the rest of the tree, r=ehsan 2015-04-22 08:29:24 +02:00
nsMemoryReporterManager.cpp Bug 1203840 - Trigger dirty pages purge after CC. r=njn,r=smaug,r=mccr8 2015-09-20 17:43:43 +09:00
nsMemoryReporterManager.h Bug 1182996 - Fix and add missing namespace comments. rs=ehsan 2015-07-13 08:25:42 -07:00
nsMessageLoop.cpp Bug 1182996 - Fix and add missing namespace comments. rs=ehsan 2015-07-13 08:25:42 -07:00
nsMessageLoop.h
nsObjCExceptions.h
nsQueryObject.h Bug 1188696 - Hoist nsRefPtr.h into MFBT. r=froydnj 2015-07-29 10:44:59 -07:00
nsSecurityConsoleMessage.cpp
nsSecurityConsoleMessage.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
nsSetDllDirectory.h
nsStatusReporterManager.cpp Bug 1204403 - Fix -Wshadow warnings in xpcom. r=mccr8 2015-09-07 23:56:16 -07:00
nsStatusReporterManager.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
nsSystemInfo.cpp Bug 1128472 - Part 2. Linux support. r=gfritzsche 2015-09-08 14:35:00 +02:00
nsSystemInfo.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
nsTraceRefcnt.cpp Bug 1196430 follow-up: Hide the usage of gCodeAddressService behind #ifdef MOZ_STACKWALKING 2015-09-11 00:06:40 -04:00
nsTraceRefcnt.h
nsUUIDGenerator.cpp Bug 1134923 - Remove NS_Alloc/NS_Realloc/NS_Free. r=nfroyd 2015-05-01 09:40:30 +09:00
nsUUIDGenerator.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
nsVersionComparatorImpl.cpp
nsVersionComparatorImpl.h Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj 2015-03-21 12:28:04 -04:00
nsWeakPtr.h
nsWindowsHelpers.h Bug 1106321 - Serialize DEVMODE down to the content process when printing on Windows. r=jimm 2015-08-06 17:36:54 -04:00
nscore.h Bug 1024259: Use NS_FREE_PERMANENT_DATA more consistently. r=mccr8 2015-07-31 12:11:48 -07:00
nsrootidl.idl