Backed out changeset 427dc5894094 (bug 1197307) for bustage
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Tue, 01 Dec 2015 10:04:50 +0100
changeset 309021 301532805d409381b55b62309358b95e83f1c952
parent 309020 58b0f5d557a6a2129c7505697ec9b164d6577660
child 309022 7d589843e8b3acc3fd35d2805b719ba6ec3f7bdf
push id5513
push userraliiev@mozilla.com
push dateMon, 25 Jan 2016 13:55:34 +0000
treeherdermozilla-beta@5ee97dd05b5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1197307
milestone45.0a1
backs out427dc5894094f29a6613908769582c5fdf4c509a
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 427dc5894094 (bug 1197307) for bustage
layout/generic/nsBlockFrame.cpp
layout/generic/nsFrame.cpp
layout/generic/nsLineBox.cpp
layout/mathml/nsMathMLChar.cpp
layout/mathml/nsMathMLmactionFrame.cpp
layout/style/CounterStyleManager.cpp
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -26,17 +26,17 @@
 #include "nsFrameManager.h"
 #include "nsPresContext.h"
 #include "nsIPresShell.h"
 #include "nsStyleContext.h"
 #include "nsHTMLParts.h"
 #include "nsGkAtoms.h"
 #include "nsGenericHTMLElement.h"
 #include "nsAttrValueInlines.h"
-#include "mozilla/Snprintf.h"
+#include "prprf.h"
 #include "nsFloatManager.h"
 #include "prenv.h"
 #include "plstr.h"
 #include "nsError.h"
 #include "nsAutoPtr.h"
 #include "nsIScrollableFrame.h"
 #include <algorithm>
 #ifdef ACCESSIBILITY
@@ -1422,19 +1422,19 @@ nsBlockFrame::Reflow(nsPresContext*     
     if (!numLines) numLines = 1;
     PRTime delta, perLineDelta, lines;
     lines = int64_t(numLines);
     delta = end - start;
     perLineDelta = delta / lines;
 
     ListTag(stdout);
     char buf[400];
-    snprintf_literal(buf,
-                     ": %lld elapsed (%lld per line) (%d lines; %d new lines)",
-                     delta, perLineDelta, numLines, ectc - ctc);
+    PR_snprintf(buf, sizeof(buf),
+                ": %lld elapsed (%lld per line) (%d lines; %d new lines)",
+                delta, perLineDelta, numLines, ectc - ctc);
     printf("%s\n", buf);
   }
 #endif
 
   NS_FRAME_SET_TRUNCATION(aStatus, (*reflowState), aMetrics);
 }
 
 bool
@@ -6573,20 +6573,20 @@ nsBlockFrame::BuildDisplayList(nsDisplay
     if (!numLines) numLines = 1;
     PRTime lines, deltaPerLine, delta;
     lines = int64_t(numLines);
     delta = end - start;
     deltaPerLine = delta / lines;
 
     ListTag(stdout);
     char buf[400];
-    snprintf_literal(buf,
-                     ": %lld elapsed (%lld per line) lines=%d drawn=%d skip=%d",
-                     delta, deltaPerLine,
-                     numLines, drawnLines, numLines - drawnLines);
+    PR_snprintf(buf, sizeof(buf),
+                ": %lld elapsed (%lld per line) lines=%d drawn=%d skip=%d",
+                delta, deltaPerLine,
+                numLines, drawnLines, numLines - drawnLines);
     printf("%s\n", buf);
   }
 #endif
 }
 
 #ifdef ACCESSIBILITY
 a11y::AccType
 nsBlockFrame::AccessibleType()
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -31,17 +31,17 @@
 #include "nsTableOuterFrame.h"
 #include "nsView.h"
 #include "nsViewManager.h"
 #include "nsIScrollableFrame.h"
 #include "nsPresContext.h"
 #include "nsStyleConsts.h"
 #include "nsIPresShell.h"
 #include "mozilla/Logging.h"
-#include "mozilla/Snprintf.h"
+#include "prprf.h"
 #include "nsFrameManager.h"
 #include "nsLayoutUtils.h"
 #include "RestyleManager.h"
 
 #include "nsIDOMNode.h"
 #include "nsISelection.h"
 #include "nsISelectionPrivate.h"
 #include "nsFrameSelection.h"
@@ -5918,17 +5918,17 @@ nsFrame::MakeFrameName(const nsAString& 
       buf.AppendLiteral(" src=");
       buf.Append(src);
     }
     aResult.Append('(');
     aResult.Append(buf);
     aResult.Append(')');
   }
   char buf[40];
-  snprintf_literal(buf, "(%d)", ContentIndexInContainer(this));
+  PR_snprintf(buf, sizeof(buf), "(%d)", ContentIndexInContainer(this));
   AppendASCIItoUTF16(buf, aResult);
   return NS_OK;
 }
 
 void
 nsIFrame::DumpFrameTree() const
 {
   RootFrameList(PresContext(), stderr);
@@ -9149,21 +9149,21 @@ nsFrame::GetBoxName(nsAutoString& aName)
 #endif
 
 #ifdef DEBUG
 static void
 GetTagName(nsFrame* aFrame, nsIContent* aContent, int aResultSize,
            char* aResult)
 {
   if (aContent) {
-    snprintf(aResult, aResultSize, "%s@%p",
-             nsAtomCString(aContent->NodeInfo()->NameAtom()).get(), aFrame);
+    PR_snprintf(aResult, aResultSize, "%s@%p",
+                nsAtomCString(aContent->NodeInfo()->NameAtom()).get(), aFrame);
   }
   else {
-    snprintf(aResult, aResultSize, "@%p", aFrame);
+    PR_snprintf(aResult, aResultSize, "@%p", aFrame);
   }
 }
 
 void
 nsFrame::Trace(const char* aMethod, bool aEnter)
 {
   if (NS_FRAME_LOG_TEST(sFrameLogModule, NS_FRAME_TRACE_CALLS)) {
     char tagbuf[40];
--- a/layout/generic/nsLineBox.cpp
+++ b/layout/generic/nsLineBox.cpp
@@ -12,17 +12,17 @@
 #include "mozilla/Assertions.h"
 #include "mozilla/Likely.h"
 #include "mozilla/WritingModes.h"
 #include "nsBidiPresUtils.h"
 #include "nsFrame.h"
 #include "nsIFrameInlines.h"
 #include "nsPresArena.h"
 #include "nsPrintfCString.h"
-#include "mozilla/Snprintf.h"
+#include "prprf.h"
 
 #ifdef DEBUG
 static int32_t ctorCount;
 int32_t nsLineBox::GetCtorCount() { return ctorCount; }
 #endif
 
 #ifndef _MSC_VER
 // static nsLineBox constant; initialized in the header file.
@@ -208,25 +208,25 @@ BreakTypeToString(uint8_t aBreakType)
     break;
   }
   return "unknown";
 }
 
 char*
 nsLineBox::StateToString(char* aBuf, int32_t aBufSize) const
 {
-  snprintf_literal(aBuf, aBufSize, "%s,%s,%s,%s,%s,before:%s,after:%s[0x%x]",
-                   IsBlock() ? "block" : "inline",
-                   IsDirty() ? "dirty" : "clean",
-                   IsPreviousMarginDirty() ? "prevmargindirty" : "prevmarginclean",
-                   IsImpactedByFloat() ? "impacted" : "not impacted",
-                   IsLineWrapped() ? "wrapped" : "not wrapped",
-                   BreakTypeToString(GetBreakTypeBefore()),
-                   BreakTypeToString(GetBreakTypeAfter()),
-                   mAllFlags);
+  PR_snprintf(aBuf, aBufSize, "%s,%s,%s,%s,%s,before:%s,after:%s[0x%x]",
+              IsBlock() ? "block" : "inline",
+              IsDirty() ? "dirty" : "clean",
+              IsPreviousMarginDirty() ? "prevmargindirty" : "prevmarginclean",
+              IsImpactedByFloat() ? "impacted" : "not impacted",
+              IsLineWrapped() ? "wrapped" : "not wrapped",
+              BreakTypeToString(GetBreakTypeBefore()),
+              BreakTypeToString(GetBreakTypeAfter()),
+              mAllFlags);
   return aBuf;
 }
 
 void
 nsLineBox::List(FILE* out, int32_t aIndent, uint32_t aFlags) const
 {
   nsCString str;
   while (aIndent-- > 0) {
--- a/layout/mathml/nsMathMLChar.cpp
+++ b/layout/mathml/nsMathMLChar.cpp
@@ -25,17 +25,17 @@
 #include "nsIPersistentProperties2.h"
 #include "nsIObserverService.h"
 #include "nsIObserver.h"
 #include "nsNetUtil.h"
 #include "nsContentUtils.h"
 
 #include "mozilla/LookAndFeel.h"
 #include "nsCSSRendering.h"
-#include "mozilla/Snprintf.h"
+#include "prprf.h"         // For PR_snprintf()
 
 #include "nsDisplayList.h"
 
 #include "nsMathMLOperators.h"
 #include <algorithm>
 
 #include "gfxMathTable.h"
 #include "nsUnicodeScriptCodes.h"
@@ -309,17 +309,17 @@ nsPropertiesTable::ElementAt(gfxContext*
       mGlyphCodeFonts.AppendElement(FontFamilyName(value, eUnquotedName)); // i.e., mGlyphCodeFonts[i] holds this font name
     }
   }
 
   // Update our cache if it is not associated to this character
   if (mCharCache != aChar) {
     // The key in the property file is interpreted as ASCII and kept
     // as such ...
-    char key[10]; snprintf_literal(key, "\\u%04X", aChar);
+    char key[10]; PR_snprintf(key, sizeof(key), "\\u%04X", aChar);
     nsAutoString value;
     nsresult rv = mGlyphProperties->GetStringProperty(nsDependentCString(key),
                                                       value);
     if (NS_FAILED(rv)) return kNullGlyph;
     Clean(value);
     // See if this char uses external fonts; e.g., if the 2nd glyph is taken
     // from the external font '1', the property line looks like
     // \uNNNN = \uNNNN\uNNNN@1\uNNNN.
--- a/layout/mathml/nsMathMLmactionFrame.cpp
+++ b/layout/mathml/nsMathMLmactionFrame.cpp
@@ -2,16 +2,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsMathMLmactionFrame.h"
 #include "nsCOMPtr.h"
 #include "nsPresContext.h"
 #include "nsNameSpaceManager.h"
+#include "prprf.h"         // For PR_snprintf()
 #include "nsIDocShell.h"
 #include "nsIDocShellTreeOwner.h"
 #include "nsIWebBrowserChrome.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsTextFragment.h"
 #include "nsIDOMEvent.h"
 #include "mozilla/gfx/2D.h"
 
@@ -320,17 +321,19 @@ nsMathMLmactionFrame::MouseOut()
 
 void
 nsMathMLmactionFrame::MouseClick()
 {
   if (NS_MATHML_ACTION_TYPE_TOGGLE == mActionType) {
     if (mChildCount > 1) {
       int32_t selection = (mSelection == mChildCount)? 1 : mSelection + 1;
       nsAutoString value;
-      value.AppendInt(selection);
+      char cbuf[10];
+      PR_snprintf(cbuf, sizeof(cbuf), "%d", selection);
+      value.AssignASCII(cbuf);
       bool notify = false; // don't yet notify the document
       mContent->SetAttr(kNameSpaceID_None, nsGkAtoms::selection_, value, notify);
 
       // Now trigger a content-changed reflow...
       PresContext()->PresShell()->
         FrameNeedsReflow(mSelectedFrame, nsIPresShell::eTreeChange,
                          NS_FRAME_IS_DIRTY);
     }
--- a/layout/style/CounterStyleManager.cpp
+++ b/layout/style/CounterStyleManager.cpp
@@ -13,16 +13,17 @@
 #include "mozilla/Types.h"
 #include "mozilla/WritingModes.h"
 #include "nsCSSRules.h"
 #include "nsString.h"
 #include "nsStyleSet.h"
 #include "nsTArray.h"
 #include "nsTHashtable.h"
 #include "nsUnicodeProperties.h"
+#include "prprf.h"
 
 namespace mozilla {
 
 struct AdditiveSymbol
 {
   CounterValue weight;
   nsString symbol;
 };
@@ -206,17 +207,18 @@ GetAdditiveCounterText(CounterValue aOrd
   return aOrdinal == 0;
 }
 
 static bool
 DecimalToText(CounterValue aOrdinal, nsSubstring& aResult)
 {
   // 3 for additional digit, negative sign, and null
   char cbuf[std::numeric_limits<CounterValue>::digits10 + 3];
-  aResult.AppendInt(aOrdinal);
+  PR_snprintf(cbuf, sizeof(cbuf), "%ld", aOrdinal);
+  aResult.AssignASCII(cbuf);
   return true;
 }
 
 // We know cjk-ideographic need 31 characters to display 99,999,999,999,999,999
 // georgian needs 6 at most
 // armenian needs 12 at most
 // hebrew may need more...