Backed out changeset f78470faff8e (bug 1034627) Valgrind Test failures on a CLOSED TREE
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Fri, 11 Jul 2014 11:00:52 +0200
changeset 215489 71d8b5c5357b80cf7ccbb8b51fa3f8dc7845b2ff
parent 215488 384a5aede186996ac11a0462ea49a507462b27e3
child 215490 037da8d9b3c941c11f9cd7624d4b949efc94f0e7
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1034627
milestone33.0a1
backs outf78470faff8e3484af54d80a16ebc7bb63e0c4b3
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
Backed out changeset f78470faff8e (bug 1034627) Valgrind Test failures on a CLOSED TREE
js/xpconnect/src/XPCComponents.cpp
js/xpconnect/src/XPCWrappedJSClass.cpp
--- a/js/xpconnect/src/XPCComponents.cpp
+++ b/js/xpconnect/src/XPCComponents.cpp
@@ -552,20 +552,19 @@ nsXPCComponents_InterfacesByID::NewResol
 
     if (!JSID_IS_STRING(id))
         return NS_OK;
 
     RootedString str(cx, JSID_TO_STRING(id));
     if (38 != JS_GetStringLength(str))
         return NS_OK;
 
-    JSAutoByteString utf8str;
-    if (utf8str.encodeUtf8(cx, str)) {
+    if (const jschar *name = JS_GetInternedStringChars(str)) {
         nsID iid;
-        if (!iid.Parse(utf8str.ptr()))
+        if (!iid.Parse(NS_ConvertUTF16toUTF8(name).get()))
             return NS_OK;
 
         nsCOMPtr<nsIInterfaceInfo> info;
         XPTInterfaceInfoManager::GetSingleton()->
             GetInfoForIID(&iid, getter_AddRefs(info));
         if (!info)
             return NS_OK;
 
@@ -2601,22 +2600,23 @@ nsXPCComponents_Utils::ReportError(Handl
 
     nsString fileName;
     int32_t lineNo = 0;
     if (frame) {
         frame->GetFilename(fileName);
         frame->GetLineNumber(&lineNo);
     }
 
-    nsAutoJSString msg;
-    if (!msg.init(cx, msgstr))
+    const jschar *msgchars = JS_GetStringCharsZ(cx, msgstr);
+    if (!msgchars)
         return NS_OK;
 
     nsresult rv = scripterr->InitWithWindowID(
-            msg, fileName, EmptyString(), lineNo, 0, 0,
+            nsDependentString(static_cast<const char16_t *>(msgchars)),
+            fileName, EmptyString(), lineNo, 0, 0,
             "XPConnect JavaScript", innerWindowID);
     NS_ENSURE_SUCCESS(rv, NS_OK);
 
     console->LogMessage(scripterr);
     return NS_OK;
 }
 
 /* void evalInSandbox(in AString source, in nativeobj sandbox); */
--- a/js/xpconnect/src/XPCWrappedJSClass.cpp
+++ b/js/xpconnect/src/XPCWrappedJSClass.cpp
@@ -363,22 +363,23 @@ nsXPCWrappedJSClass::BuildPropertyEnumer
         RootedValue jsvalName(cx);
         if (!JS_IdToValue(cx, idName, &jsvalName))
             return NS_ERROR_FAILURE;
 
         JSString* name = ToString(cx, jsvalName);
         if (!name)
             return NS_ERROR_FAILURE;
 
-        nsAutoJSString autoStr;
-        if (!autoStr.init(cx, name))
+        size_t length;
+        const jschar *chars = JS_GetStringCharsAndLength(cx, name, &length);
+        if (!chars)
             return NS_ERROR_FAILURE;
 
         nsCOMPtr<nsIProperty> property =
-            new xpcProperty(autoStr.get(), (uint32_t)autoStr.Length(), value);
+            new xpcProperty(chars, (uint32_t) length, value);
 
         if (!propertyArray.AppendObject(property))
             return NS_ERROR_FAILURE;
     }
 
     return NS_NewArrayEnumerator(aEnumerate, propertyArray);
 }