Bug 1481229 part 2 - Always use the unwrapped object in Logging::formatObject. r=evilpie
authorJan de Mooij <jdemooij@mozilla.com>
Tue, 07 Aug 2018 14:06:45 +0200
changeset 430344 7791fe11b664cf5a1a19e99b32c92e228d8d0c27
parent 430343 de88f2fd6d4d8895a8c3d174e630fbec58e628d1
child 430345 936c5d6bd40b08188993cbd08e8622820398687a
child 430377 47cfdd30d8d334f3b142bf2ca8982050ec4e84e8
push id34401
push useraiakab@mozilla.com
push dateTue, 07 Aug 2018 15:42:55 +0000
treeherdermozilla-central@936c5d6bd40b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersevilpie
bugs1481229
milestone63.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 1481229 part 2 - Always use the unwrapped object in Logging::formatObject. r=evilpie
js/ipc/JavaScriptLogging.h
--- a/js/ipc/JavaScriptLogging.h
+++ b/js/ipc/JavaScriptLogging.h
@@ -100,25 +100,22 @@ class Logging
     void formatObject(bool incoming, bool local, ObjectId id, nsCString& out) {
         const char* side;
         const char* objDesc;
         void* ptr;
 
         if (local == incoming) {
             JS::RootedObject obj(cx);
             obj = shared->objects_.find(id);
-            if (obj) {
-                JSAutoRealmAllowCCW ar(cx, obj);
-                objDesc = js::ObjectClassName(cx, obj);
-            } else {
-                objDesc = "<dead object>";
-            }
+            obj = js::UncheckedUnwrap(obj, true);
 
+            JSAutoRealm ar(cx, obj);
+            objDesc = js::ObjectClassName(cx, obj);
             side = shared->isParent() ? "parent" : "child";
-            ptr = js::UncheckedUnwrap(obj, true);
+            ptr = obj;
         } else {
             objDesc = "<cpow>";
             side = shared->isParent() ? "child" : "parent";
             ptr = nullptr;
         }
 
         out = nsPrintfCString("<%s %s:%" PRIu64 ":%p>", side, objDesc, id.serialNumber(), ptr);
     }