Bug 660536 Remove useless uses of PromiseFlat(C)String r=smaug
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Thu, 09 Jun 2011 21:17:58 +0100
changeset 71533 f68c52f253e77c3787ccf05412490d9916b3009b
parent 71532 10f50879c454482c0dbf5e9057d0a09b7afc0d54
child 71534 b65e22bc0c281612fedfc8f9b6f575a55c34d440
push id159
push usereakhgari@mozilla.com
push dateTue, 16 Aug 2011 17:53:11 +0000
treeherdermozilla-beta@8786e3e49240 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs660536
milestone7.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 660536 Remove useless uses of PromiseFlat(C)String r=smaug
content/base/src/nsDocument.cpp
content/canvas/src/DocumentRendererChild.cpp
content/html/content/src/nsHTMLCanvasElement.cpp
dom/plugins/base/nsPluginDirServiceProvider.cpp
--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -5230,17 +5230,17 @@ nsDocument::DoNotifyPossibleTitleChange(
   GetTitle(title);
 
   nsCOMPtr<nsIPresShell> shell = GetShell();
   if (shell) {
     nsCOMPtr<nsISupports> container = shell->GetPresContext()->GetContainer();
     if (container) {
       nsCOMPtr<nsIBaseWindow> docShellWin = do_QueryInterface(container);
       if (docShellWin) {
-        docShellWin->SetTitle(PromiseFlatString(title).get());
+        docShellWin->SetTitle(title.get());
       }
     }
   }
 
   // Fire a DOM event for the title change.
   nsContentUtils::DispatchChromeEvent(this, static_cast<nsIDocument*>(this),
                                       NS_LITERAL_STRING("DOMTitleChanged"),
                                       PR_TRUE, PR_TRUE);
--- a/content/canvas/src/DocumentRendererChild.cpp
+++ b/content/canvas/src/DocumentRendererChild.cpp
@@ -85,18 +85,17 @@ DocumentRendererChild::RenderDocument(ns
             docshell->GetPresContext(getter_AddRefs(presContext));
         }
     }
     if (!presContext)
         return false;
 
     nscolor bgColor;
     nsCSSParser parser;
-    nsresult rv = parser.ParseColorString(PromiseFlatString(bgcolor),
-                                          nsnull, 0, &bgColor);
+    nsresult rv = parser.ParseColorString(bgcolor, nsnull, 0, &bgColor);
     if (NS_FAILED(rv))
         return false;
 
     nsIPresShell* presShell = presContext->PresShell();
 
     // Draw directly into the output array.
     data.SetLength(renderSize.width * renderSize.height * 4);
 
--- a/content/html/content/src/nsHTMLCanvasElement.cpp
+++ b/content/html/content/src/nsHTMLCanvasElement.cpp
@@ -226,25 +226,25 @@ nsHTMLCanvasElement::ExtractData(const n
   nsresult rv;
 
   // get image bytes
   nsCOMPtr<nsIInputStream> imgStream;
   NS_ConvertUTF16toUTF8 encoderType(aType);
 
  try_again:
   if (mCurrentContext) {
-    rv = mCurrentContext->GetInputStream(nsPromiseFlatCString(encoderType).get(),
+    rv = mCurrentContext->GetInputStream(encoderType.get(),
                                          nsPromiseFlatString(aOptions).get(),
                                          getter_AddRefs(imgStream));
   } else {
     // no context, so we have to encode the empty image we created above
     nsCString enccid("@mozilla.org/image/encoder;2?type=");
     enccid += encoderType;
 
-    nsCOMPtr<imgIEncoder> encoder = do_CreateInstance(nsPromiseFlatCString(enccid).get(), &rv);
+    nsCOMPtr<imgIEncoder> encoder = do_CreateInstance(enccid.get(), &rv);
     if (NS_SUCCEEDED(rv) && encoder) {
       rv = encoder->InitFromData(emptyCanvas->Data(),
                                  size.width * size.height * 4,
                                  size.width,
                                  size.height,
                                  size.width * 4,
                                  imgIEncoder::INPUT_FORMAT_HOSTARGB,
                                  aOptions);
@@ -393,17 +393,17 @@ nsHTMLCanvasElement::GetContextHelper(co
     }
   }
 
   nsCString ctxString("@mozilla.org/content/canvas-rendering-context;1?id=");
   ctxString.Append(ctxId);
 
   nsresult rv;
   nsCOMPtr<nsICanvasRenderingContextInternal> ctx =
-    do_CreateInstance(nsPromiseFlatCString(ctxString).get(), &rv);
+    do_CreateInstance(ctxString.get(), &rv);
   if (rv == NS_ERROR_OUT_OF_MEMORY) {
     *aContext = nsnull;
     return NS_ERROR_OUT_OF_MEMORY;
   }
   if (NS_FAILED(rv)) {
     *aContext = nsnull;
     // XXX ERRMSG we need to report an error to developers here! (bug 329026)
     return NS_OK;
--- a/dom/plugins/base/nsPluginDirServiceProvider.cpp
+++ b/dom/plugins/base/nsPluginDirServiceProvider.cpp
@@ -280,17 +280,17 @@ nsPluginDirServiceProvider::GetFile(cons
         nsCOMPtr<nsIWindowsRegKey> childKey;
         rv = regKey->OpenChild(childName, nsIWindowsRegKey::ACCESS_QUERY_VALUE,
                                getter_AddRefs(childKey));
         if (NS_SUCCEEDED(rv) && childKey) {
           nsAutoString path;
           rv = childKey->ReadStringValue(NS_LITERAL_STRING("JavaHome"), path);
           if (NS_SUCCEEDED(rv)) {
             verBlock curVer;
-            TranslateVersionStr(PromiseFlatString(childName).get(), &curVer);
+            TranslateVersionStr(childName.get(), &curVer);
             if (CompareVersion(curVer, minVer) >= 0) {
               if (browserJavaVersion == childName) {
                 newestPath = path;
                 break;
               }
 
               if (CompareVersion(curVer, maxVer) >= 0) {
                 newestPath = path;
@@ -346,17 +346,17 @@ nsPluginDirServiceProvider::GetFile(cons
     // the EXE's version table
     rv = regKey->Open(nsIWindowsRegKey::ROOT_KEY_LOCAL_MACHINE,
                       NS_LITERAL_STRING("software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\QuickTimePlayer.exe"),
                       nsIWindowsRegKey::ACCESS_READ);
     if (NS_SUCCEEDED(rv)) {
       nsAutoString path;
       rv = regKey->ReadStringValue(NS_LITERAL_STRING(""), path);
       if (NS_SUCCEEDED(rv)) {
-        GetFileVersion(PromiseFlatString(path).get(), &qtVer);
+        GetFileVersion(path.get(), &qtVer);
       }
       regKey->Close();
     }
     if (CompareVersion(qtVer, minVer) < 0)
       return rv;
 
     rv = regKey->Open(nsIWindowsRegKey::ROOT_KEY_LOCAL_MACHINE,
                       NS_LITERAL_STRING("software\\Apple Computer, Inc.\\QuickTime"),
@@ -384,17 +384,17 @@ nsPluginDirServiceProvider::GetFile(cons
     // First we need to check the version of WMP
     rv = regKey->Open(nsIWindowsRegKey::ROOT_KEY_LOCAL_MACHINE,
                       NS_LITERAL_STRING("software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\wmplayer.exe"),
                       nsIWindowsRegKey::ACCESS_READ);
     if (NS_SUCCEEDED(rv)) {
       nsAutoString path;
       rv = regKey->ReadStringValue(NS_LITERAL_STRING(""), path);
       if (NS_SUCCEEDED(rv)) {
-        GetFileVersion(PromiseFlatString(path).get(), &wmpVer);
+        GetFileVersion(path.get(), &wmpVer);
       }
       regKey->Close();
     }
     if (CompareVersion(wmpVer, minVer) < 0)
       return rv;
 
     rv = regKey->Open(nsIWindowsRegKey::ROOT_KEY_LOCAL_MACHINE,
                       NS_LITERAL_STRING("software\\Microsoft\\MediaPlayer"),
@@ -440,17 +440,17 @@ nsPluginDirServiceProvider::GetFile(cons
     PRUint32 childCount = 0;
     regKey->GetChildCount(&childCount);
 
     for (PRUint32 index = 0; index < childCount; ++index) {
       nsAutoString childName;
       rv = regKey->GetChildName(index, childName);
       if (NS_SUCCEEDED(rv)) {
         verBlock curVer;
-        TranslateVersionStr(PromiseFlatString(childName).get(), &curVer);
+        TranslateVersionStr(childName.get(), &curVer);
 
         childName += NS_LITERAL_STRING("\\InstallPath");
 
         nsCOMPtr<nsIWindowsRegKey> childKey;
         rv = regKey->OpenChild(childName, nsIWindowsRegKey::ACCESS_QUERY_VALUE,
                                getter_AddRefs(childKey));
         if (NS_SUCCEEDED(rv)) {
           // We have a sub key