gecko-dev/ipc/mscom
Aaron Klotz 1559fd3d00 Bug 1433046: Use WeakReferenceSupport::StabilizeRefCount instead of regular kung-fu death grips when aggregating; r=Jamie
This fix is completely speculative, but I have strong reason to believe that
we are having lifetime issues, and that refcount stabilization might be coming
into play.

The situation is this:

Suppose we're aggregating an object, so we pass |this| as the outer IUnknown.
The inner object might perform AddRef() and Release() on |this| during its
initialization.

But if we're in the process of creating the outer object, that refcount might
not yet have been incremented by 1, so the inner object's invocation of the
outer object's Release() could trigger a deletion.

The way around this is to temporarily bump the refcount when aggregating another
object. The key, though, is to not do this via AddRef() and Release(), but by
direct maniuplation of the refcount variable, so that we don't trigger any of
the self-deletion stuff.

MozReview-Commit-ID: 3WA2AJvb6jY

--HG--
extra : rebase_source : ab05a52760541a4ab11f1245a5ddeae938998047
2018-01-25 13:45:21 -07:00
..
oop Bug 1416986 part 1: Allow an mscom Handler to signal that it knows an interface is definitely not available. r=aklotz 2017-11-15 09:59:44 +10:00
ActivationContext.cpp Bug 1399557: Add Environment to mscom::ProxyStream and define it for IAccessible; r=jimm 2017-09-29 15:41:28 -06:00
ActivationContext.h Bug 1399557: Add Environment to mscom::ProxyStream and define it for IAccessible; r=jimm 2017-09-29 15:41:28 -06:00
Aggregation.h
AgileReference.cpp Bug 1411001 - Remove the +x permissions on cpp & h files r=froydnj 2017-10-23 20:59:55 +02:00
AgileReference.h Bug 1381618: Make mscom::AgileReference::mIid be an IID instead of REFIID; r=jimm 2017-07-17 14:35:58 -06:00
AsyncInvoker.h
COMApartmentRegion.h
COMPtrHolder.h Bug 1402519 - Remove MOZ_CRASHREPORTER directives from ipc; r=billm 2017-10-10 12:06:35 +02:00
DispatchForwarder.cpp Bug 1372405 - Provide names for all runnables in the tree (r=froydnj) 2017-06-26 14:19:58 -07:00
DispatchForwarder.h
DynamicallyLinkedFunctionPtr.h
EnsureMTA.cpp Bug 1411001 - Remove the +x permissions on cpp & h files r=froydnj 2017-10-23 20:59:55 +02:00
EnsureMTA.h Bug 1379643: When running under sandbox level >= 3, parent should retain IStream of marshaled interface to be destroyed later; r=jimm 2017-07-19 12:07:45 -06:00
FastMarshaler.cpp Bug 1393589: Refactor NOPING marshaling into its own class, mscom::FastMarshaler, and use it with IGeckoBackChannel; r=jimm 2017-08-17 15:54:28 -06:00
FastMarshaler.h Bug 1393589: Refactor NOPING marshaling into its own class, mscom::FastMarshaler, and use it with IGeckoBackChannel; r=jimm 2017-08-17 15:54:28 -06:00
IHandlerProvider.h Bug 1411439: Pass reference to owning interceptor into HandlerProvider for payload creation; r=Jamie 2017-10-24 17:48:51 -06:00
Interceptor.cpp Bug 1433046: Use WeakReferenceSupport::StabilizeRefCount instead of regular kung-fu death grips when aggregating; r=Jamie 2018-01-25 13:45:21 -07:00
Interceptor.h Bug 1428759: Remove mutual exclusion from WeakReferenceSupport interface queries; r=Jamie 2018-01-12 14:17:18 -07:00
InterceptorLog.cpp Bug 1411391: Ensure mscom::InterceptorLog covers time spent wrapping outparams in mscom::MainThreadHandoff; r=jimm 2017-10-23 16:55:26 -06:00
InterceptorLog.h Bug 1411391: Ensure mscom::InterceptorLog covers time spent wrapping outparams in mscom::MainThreadHandoff; r=jimm 2017-10-23 16:55:26 -06:00
MainThreadClientInfo.cpp Bug 1323069: mscom changes to facilitate resolution of remote client thread ID; r=jimm 2017-06-19 16:43:24 -06:00
MainThreadClientInfo.h Bug 1323069: mscom changes to facilitate resolution of remote client thread ID; r=jimm 2017-06-19 16:43:24 -06:00
MainThreadHandoff.cpp Bug 1411391: Ensure mscom::InterceptorLog covers time spent wrapping outparams in mscom::MainThreadHandoff; r=jimm 2017-10-23 16:55:26 -06:00
MainThreadHandoff.h Bug 1411439: Pass reference to owning interceptor into HandlerProvider for payload creation; r=Jamie 2017-10-24 17:48:51 -06:00
MainThreadInvoker.cpp Bug 1428535 - Add missing override specifiers to overridden virtual functions. r=froydnj 2017-11-05 19:37:28 -08:00
MainThreadInvoker.h Bug 1409538: Add durations to MSCOM log; r=jimm 2017-07-25 15:57:18 -06:00
MainThreadRuntime.cpp Bug 1404482: Remove crash report annotation that was being made before the crash reporter initialized; r=Jamie 2018-01-23 12:06:58 -07:00
MainThreadRuntime.h Bug 1354077: Push a11y activation context during mscom::MainThreadRuntime initialization; r=jimm 2017-06-27 11:28:41 -07:00
Objref.cpp Bug 1403180: Fix StripHandlerFromOBJREF for VT_DISPATCH on Windows 7. r=aklotz 2017-10-23 15:37:24 +10:00
Objref.h Bug 1393600: Ensure that the handler sends a known interface to external clients; r=jimm 2017-09-24 14:32:36 -06:00
PassthruProxy.cpp Bug 1399557: Add Environment to mscom::ProxyStream and define it for IAccessible; r=jimm 2017-09-29 15:41:28 -06:00
PassthruProxy.h Bug 1406827: Do not wrap an interface with a passthru proxy unless sandboxing is enabled and >= level 3; r=jimm 2017-11-03 16:50:17 -06:00
ProxyStream.cpp Bug 1414421: Change some diagnostic asserts in mscom to stop firing on dev edition; r=Jamie 2017-11-29 14:50:17 -07:00
ProxyStream.h Bug 1399557: Add Environment to mscom::ProxyStream and define it for IAccessible; r=jimm 2017-09-29 15:41:28 -06:00
Ptr.h Bug 1390652: Part 2 - Add support for TABLESTRONG marshaling to mscom::ProxyStream; r=jimm 2017-08-16 16:31:07 -06:00
Registration.cpp Bug 1390652: Part 3 - Add proxy wrapper that passes its inner proxy through content as a blob; r=jimm 2017-08-21 15:47:44 -06:00
Registration.h
RegistrationAnnotator.cpp merge mozilla-inbound to mozilla-central. r=merge a=merge 2017-08-31 14:36:51 +02:00
RegistrationAnnotator.h Bug 1402519 - Remove MOZ_CRASHREPORTER directives from ipc; r=billm 2017-10-10 12:06:35 +02:00
SpinEvent.cpp
SpinEvent.h
StructStream.cpp
StructStream.h
Utils.cpp Bug 1394395 - Fix mscom build when ACCESSIBILITY is disabled. r=jimm 2017-08-28 12:27:28 -06:00
Utils.h Bug 1394395 - Fix mscom build when ACCESSIBILITY is disabled. r=jimm 2017-08-28 12:27:28 -06:00
VTableBuilder.c Bug 1390652: Part 3 - Add proxy wrapper that passes its inner proxy through content as a blob; r=jimm 2017-08-21 15:47:44 -06:00
VTableBuilder.h Bug 1394868 Fix include casing in VTableBuilder.h to fix MinGW build r=aklotz 2017-08-29 11:34:58 -05:00
WeakRef.cpp Bug 1433046: Use WeakReferenceSupport::StabilizeRefCount instead of regular kung-fu death grips when aggregating; r=Jamie 2018-01-25 13:45:21 -07:00
WeakRef.h Bug 1433046: Use WeakReferenceSupport::StabilizeRefCount instead of regular kung-fu death grips when aggregating; r=Jamie 2018-01-25 13:45:21 -07:00
moz.build Bug 1402519 - Remove MOZ_CRASHREPORTER directives from ipc; r=billm 2017-10-10 12:06:35 +02:00