Bug 1184400, part 3 - Use HasExternalReference in XPCWrappedNative::Traverse. r=bholley
authorAndrew McCreight <continuation@gmail.com>
Thu, 16 Jul 2015 17:50:43 -0700
changeset 285077 29d1819dc8471cbbe64f6f0b7069c1e4e89031c4
parent 285076 099178a4ef0add75881bf0868f2b474fbeef173f
child 285078 751d493a4f255ceeb49e2857df2ac3fea2537e9c
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs1184400
milestone42.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 1184400, part 3 - Use HasExternalReference in XPCWrappedNative::Traverse. r=bholley This is just for consistency.
js/xpconnect/src/XPCWrappedNative.cpp
--- a/js/xpconnect/src/XPCWrappedNative.cpp
+++ b/js/xpconnect/src/XPCWrappedNative.cpp
@@ -63,17 +63,17 @@ NS_CYCLE_COLLECTION_CLASSNAME(XPCWrapped
         else
             JS_snprintf(name, sizeof(name), "XPCWrappedNative");
 
         cb.DescribeRefCountedNode(tmp->mRefCnt.get(), name);
     } else {
         NS_IMPL_CYCLE_COLLECTION_DESCRIBE(XPCWrappedNative, tmp->mRefCnt.get())
     }
 
-    if (tmp->mRefCnt.get() > 1) {
+    if (tmp->HasExternalReference()) {
 
         // If our refcount is > 1, our reference to the flat JS object is
         // considered "strong", and we're going to traverse it.
         //
         // If our refcount is <= 1, our reference to the flat JS object is
         // considered "weak", and we're *not* going to traverse it.
         //
         // This reasoning is in line with the slightly confusing lifecycle rules