author | Ms2ger <ms2ger@gmail.com> |
Thu, 23 Jun 2011 16:36:56 +0200 | |
changeset 71590 | 00a5700edf6b31505fbfd676ea9ee410f886ac2c |
parent 71588 | c931c8b1d8f623693c4d630777a63447cd7de417 (current diff) |
parent 71589 | 97dbe5dc67c890c1eb6537c7f0f1fdeff19adb6c (diff) |
child 71591 | 3e54c496db92d1199306da1131ba105cfdcdb510 |
child 71626 | dc22cd5173d9b0390429868a13cb9404758e6647 |
push id | 20569 |
push user | Ms2ger@gmail.com |
push date | Thu, 23 Jun 2011 14:38:08 +0000 |
treeherder | mozilla-central@00a5700edf6b [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
milestone | 7.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
|
--- a/content/base/src/nsFrameMessageManager.cpp +++ b/content/base/src/nsFrameMessageManager.cpp @@ -364,33 +364,29 @@ nsFrameMessageManager::ReceiveMessage(ns // The parameter for the listener function. JSObject* param = JS_NewObject(ctx, NULL, NULL, NULL); NS_ENSURE_TRUE(param, NS_ERROR_OUT_OF_MEMORY); jsval targetv; nsContentUtils::WrapNative(ctx, JS_GetGlobalForObject(ctx, object), - aTarget, &targetv, nsnull, PR_TRUE); + aTarget, &targetv); // To keep compatibility with e10s message manager, // define empty objects array. if (!aObjectsArray) { // Because we want JS messages to have always the same properties, // create array even if len == 0. aObjectsArray = JS_NewArrayObject(ctx, 0, NULL); if (!aObjectsArray) { return NS_ERROR_OUT_OF_MEMORY; } } - jsval objectsv; - if (!JS_WrapValue(ctx, &objectsv)) - return NS_ERROR_UNEXPECTED; - jsval json = JSVAL_NULL; if (!aJSON.IsEmpty()) { if (!JS_ParseJSON(ctx, (jschar*)nsString(aJSON).get(), (uint32)aJSON.Length(), &json)) { json = JSVAL_NULL; } } JSString* jsMessage = @@ -399,17 +395,18 @@ nsFrameMessageManager::ReceiveMessage(ns aMessage.Length()); NS_ENSURE_TRUE(jsMessage, NS_ERROR_OUT_OF_MEMORY); JS_DefineProperty(ctx, param, "target", targetv, NULL, NULL, JSPROP_ENUMERATE); JS_DefineProperty(ctx, param, "name", STRING_TO_JSVAL(jsMessage), NULL, NULL, JSPROP_ENUMERATE); JS_DefineProperty(ctx, param, "sync", BOOLEAN_TO_JSVAL(aSync), NULL, NULL, JSPROP_ENUMERATE); JS_DefineProperty(ctx, param, "json", json, NULL, NULL, JSPROP_ENUMERATE); - JS_DefineProperty(ctx, param, "objects", objectsv, NULL, NULL, JSPROP_ENUMERATE); + JS_DefineProperty(ctx, param, "objects", OBJECT_TO_JSVAL(aObjectsArray), + NULL, NULL, JSPROP_ENUMERATE); jsval thisValue = JSVAL_VOID; jsval funval = JSVAL_VOID; if (JS_ObjectIsFunction(ctx, object)) { // If the listener is a JS function: funval = OBJECT_TO_JSVAL(object); @@ -419,17 +416,17 @@ nsFrameMessageManager::ReceiveMessage(ns if (mChrome) { defaultThisValue = do_QueryInterface(static_cast<nsIContentFrameMessageManager*>(this)); } else { defaultThisValue = aTarget; } nsContentUtils::WrapNative(ctx, JS_GetGlobalForObject(ctx, object), - defaultThisValue, &thisValue, nsnull, PR_TRUE); + defaultThisValue, &thisValue); } else { // If the listener is a JS object which has receiveMessage function: NS_ENSURE_STATE(JS_GetProperty(ctx, object, "receiveMessage", &funval) && JSVAL_IS_OBJECT(funval) && !JSVAL_IS_NULL(funval)); JSObject* funobject = JSVAL_TO_OBJECT(funval); NS_ENSURE_STATE(JS_ObjectIsFunction(ctx, funobject));