Bug 1636991 - Add a comment about XPCWrappedNativeProto ownership. DONTBUILD r=peterv
authorAndrew McCreight <continuation@gmail.com>
Fri, 22 May 2020 23:02:27 +0000
changeset 531739 03d09cb05213745b92d6c4afb51d168ada95df4e
parent 531738 56423aee609ec894e9d7e1077d5cdb3751891376
child 531740 e3fca4a4cc7f86732fc05404b170f23ba92cb982
push id37442
push userncsoregi@mozilla.com
push dateSat, 23 May 2020 09:21:24 +0000
treeherdermozilla-central@bbcc193fe0f0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv
bugs1636991
milestone78.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 1636991 - Add a comment about XPCWrappedNativeProto ownership. DONTBUILD r=peterv Differential Revision: https://phabricator.services.mozilla.com/D74690
js/xpconnect/src/xpcprivate.h
--- a/js/xpconnect/src/xpcprivate.h
+++ b/js/xpconnect/src/xpcprivate.h
@@ -1174,18 +1174,23 @@ class XPCNativeSet final {
  private:
   uint16_t mInterfaceCount;
   // Always last - object sized for array.
   // These are strong references.
   XPCNativeInterface* mInterfaces[1];
 };
 
 /***********************************************/
-// XPCWrappedNativeProto hold the additional shared wrapper data
-// for XPCWrappedNative whose native objects expose nsIClassInfo.
+// XPCWrappedNativeProtos hold the additional shared wrapper data for
+// XPCWrappedNative whose native objects expose nsIClassInfo.
+// The XPCWrappedNativeProto is owned by its mJSProtoObject, until that object
+// is finalized. After that, it is owned by XPCJSRuntime's
+// mDyingWrappedNativeProtoMap. See
+// XPCWrappedNativeProto::JSProtoObjectFinalized and
+// XPCJSRuntime::FinalizeCallback.
 
 class XPCWrappedNativeProto final {
  public:
   static XPCWrappedNativeProto* GetNewOrUsed(JSContext* cx,
                                              XPCWrappedNativeScope* scope,
                                              nsIClassInfo* classInfo,
                                              nsIXPCScriptable* scriptable);