Bug 962393 - Don't use JS_InternString in MessageManager. r=bz, a=bajaj
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Wed, 22 Jan 2014 05:28:24 +0200
changeset 176018 20e10d9d645f776ff11c268fd70b9b0826191b5d
parent 176017 ddb0773a7ce8a80297a8f65b084f18a28f974ede
child 176019 0d3f6deebf430ba0a3432c176dd0537713f42d5d
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz, bajaj
bugs962393
milestone28.0a2
Bug 962393 - Don't use JS_InternString in MessageManager. r=bz, a=bajaj
content/base/src/nsFrameMessageManager.cpp
--- a/content/base/src/nsFrameMessageManager.cpp
+++ b/content/base/src/nsFrameMessageManager.cpp
@@ -957,17 +957,17 @@ nsFrameMessageManager::ReceiveMessage(ns
 
         JS::Rooted<JS::Value> appIdValue(ctx, INT_TO_JSVAL(appId));
         JS_DefineProperty(ctx, principalObj, "appId", appIdValue, nullptr, nullptr, JSPROP_ENUMERATE);
 
         nsCString origin;
         rv = aPrincipal->GetOrigin(getter_Copies(origin));
         NS_ENSURE_SUCCESS(rv, rv);
 
-        JS::Rooted<JSString*> originValue(ctx, JS_InternString(ctx, origin.get()));
+        JS::Rooted<JSString*> originValue(ctx, JS_NewStringCopyN(ctx, origin.get(), origin.Length()));
         JS_DefineProperty(ctx, principalObj, "origin", STRING_TO_JSVAL(originValue), nullptr, nullptr, JSPROP_ENUMERATE);
 
         bool browser;
         rv = aPrincipal->GetIsInBrowserElement(&browser);
         NS_ENSURE_SUCCESS(rv, rv);
 
         JS::Rooted<JS::Value> browserValue(ctx, BOOLEAN_TO_JSVAL(browser));
         JS_DefineProperty(ctx, principalObj, "isInBrowserElement", browserValue, nullptr, nullptr, JSPROP_ENUMERATE);