Bug 1102637 - [e10s] Log the address of objects sent using CPOWs (r=mrbkap)

This commit is contained in:
Bill McCloskey 2014-12-18 17:34:24 -08:00
Родитель 7b93042a28
Коммит 35ea98153d
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -11,6 +11,7 @@
#include "nsString.h" #include "nsString.h"
#include "nsPrintfCString.h" #include "nsPrintfCString.h"
#include "jsfriendapi.h" #include "jsfriendapi.h"
#include "jswrapper.h"
namespace mozilla { namespace mozilla {
namespace jsipc { namespace jsipc {
@ -98,6 +99,7 @@ class Logging
void formatObject(bool incoming, bool local, ObjectId id, nsCString &out) { void formatObject(bool incoming, bool local, ObjectId id, nsCString &out) {
const char *side, *objDesc; const char *side, *objDesc;
void *ptr;
if (local == incoming) { if (local == incoming) {
JS::RootedObject obj(cx); JS::RootedObject obj(cx);
@ -110,12 +112,14 @@ class Logging
} }
side = shared->isParent() ? "parent" : "child"; side = shared->isParent() ? "parent" : "child";
ptr = js::UncheckedUnwrap(obj, true);
} else { } else {
objDesc = "<cpow>"; objDesc = "<cpow>";
side = shared->isParent() ? "child" : "parent"; side = shared->isParent() ? "child" : "parent";
ptr = nullptr;
} }
out = nsPrintfCString("<%s %s:%d>", side, objDesc, id); out = nsPrintfCString("<%s %s:%d:%p>", side, objDesc, id, ptr);
} }