Bug 704820 - Simplify nsContentUtils::ReportToConsole. r=smaug
authorMasatoshi Kimura <VYV03354@nifty.ne.jp>
Thu, 15 Dec 2011 14:47:03 +0000
changeset 84288 e8659eb419fbff376015ef5c4ab83c7dccbaabc5
parent 84287 1385112d84f625b4e98bd1219383e36672c53b3a
child 84289 5df2a353f393712d994dd419cd076098e4f96f4a
push id519
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 00:38:35 +0000
treeherdermozilla-beta@788ea1ef610b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs704820
milestone11.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 704820 - Simplify nsContentUtils::ReportToConsole. r=smaug
content/base/public/nsContentUtils.h
content/base/src/nsCSPService.cpp
content/base/src/nsContentUtils.cpp
content/base/src/nsDocument.cpp
content/base/src/nsGenericElement.cpp
content/base/src/nsXMLHttpRequest.cpp
content/canvas/src/nsCanvasRenderingContext2D.cpp
content/canvas/src/nsCanvasRenderingContext2DAzure.cpp
content/events/src/nsDOMEvent.cpp
content/html/content/src/nsFormSubmission.cpp
content/html/content/src/nsGenericHTMLElement.cpp
content/html/content/src/nsHTMLSharedObjectElement.cpp
content/html/document/src/nsHTMLDocument.cpp
content/xbl/src/nsXBLContentSink.cpp
content/xbl/src/nsXBLPrototypeBinding.cpp
content/xbl/src/nsXBLPrototypeHandler.cpp
content/xbl/src/nsXBLService.cpp
content/xml/document/src/nsXMLDocument.cpp
content/xul/document/src/nsXULDocument.cpp
dom/base/nsGlobalWindow.cpp
dom/src/json/nsJSON.cpp
layout/base/nsCSSFrameConstructor.cpp
layout/generic/nsImageMap.cpp
layout/style/Loader.cpp
layout/svg/base/src/nsSVGUtils.cpp
parser/html/nsHtml5StreamParser.cpp
--- a/content/base/public/nsContentUtils.h
+++ b/content/base/public/nsContentUtils.h
@@ -734,83 +734,59 @@ public:
    */
   static nsIXPConnect *XPConnect()
   {
     return sXPConnect;
   }
 
   /**
    * Report a localized error message to the error console.
+   *   @param aErrorFlags See nsIScriptError.
+   *   @param aCategory Name of module reporting error.
+   *   @param aDocument Reference to the document which triggered the message.
    *   @param aFile Properties file containing localized message.
    *   @param aMessageName Name of localized message.
-   *   @param aParams Parameters to be substituted into localized message.
-   *   @param aParamsLength Length of aParams.
-   *   @param aURI URI of resource containing error (may be null).
-   *   @param aSourceLine The text of the line that contains the error (may be
-              empty).
-   *   @param aLineNumber Line number within resource containing error.
-   *   @param aColumnNumber Column number within resource containing error.
-   *   @param aErrorFlags See nsIScriptError.
-   *   @param aCategory Name of module reporting error.
-   *   @param [aInnerWindowId=0] (Optional) The window ID of the inner window
-   *          the message originates from.
+   *   @param [aParams=nsnull] (Optional) Parameters to be substituted into
+              localized message.
+   *   @param [aParamsLength=0] (Optional) Length of aParams.
+   *   @param [aURI=nsnull] (Optional) URI of resource containing error.
+   *   @param [aSourceLine=EmptyString()] (Optional) The text of the line that
+              contains the error (may be empty).
+   *   @param [aLineNumber=0] (Optional) Line number within resource
+              containing error.
+   *   @param [aColumnNumber=0] (Optional) Column number within resource
+              containing error.
+              If aURI is null, then aDocument->GetDocumentURI() is used.
    */
   enum PropertiesFile {
     eCSS_PROPERTIES,
     eXBL_PROPERTIES,
     eXUL_PROPERTIES,
     eLAYOUT_PROPERTIES,
     eFORMS_PROPERTIES,
     ePRINTING_PROPERTIES,
     eDOM_PROPERTIES,
     eHTMLPARSER_PROPERTIES,
     eSVG_PROPERTIES,
     eBRAND_PROPERTIES,
     eCOMMON_DIALOG_PROPERTIES,
     PropertiesFile_COUNT
   };
-  static nsresult ReportToConsole(PropertiesFile aFile,
-                                  const char *aMessageName,
-                                  const PRUnichar **aParams,
-                                  PRUint32 aParamsLength,
-                                  nsIURI* aURI,
-                                  const nsAFlatString& aSourceLine,
-                                  PRUint32 aLineNumber,
-                                  PRUint32 aColumnNumber,
-                                  PRUint32 aErrorFlags,
+  static nsresult ReportToConsole(PRUint32 aErrorFlags,
                                   const char *aCategory,
-                                  PRUint64 aInnerWindowId = 0);
-
-  /**
-   * Report a localized error message to the error console.
-   *   @param aFile Properties file containing localized message.
-   *   @param aMessageName Name of localized message.
-   *   @param aParams Parameters to be substituted into localized message.
-   *   @param aParamsLength Length of aParams.
-   *   @param aURI URI of resource containing error (may be null).
-   *   @param aSourceLine The text of the line that contains the error (may be
-              empty).
-   *   @param aLineNumber Line number within resource containing error.
-   *   @param aColumnNumber Column number within resource containing error.
-   *   @param aErrorFlags See nsIScriptError.
-   *   @param aCategory Name of module reporting error.
-   *   @param aDocument Reference to the document which triggered the message.
-              If aURI is null, then aDocument->GetDocumentURI() is used.
-   */
-  static nsresult ReportToConsole(PropertiesFile aFile,
+                                  nsIDocument* aDocument,
+                                  PropertiesFile aFile,
                                   const char *aMessageName,
-                                  const PRUnichar **aParams,
-                                  PRUint32 aParamsLength,
-                                  nsIURI* aURI,
-                                  const nsAFlatString& aSourceLine,
-                                  PRUint32 aLineNumber,
-                                  PRUint32 aColumnNumber,
-                                  PRUint32 aErrorFlags,
-                                  const char *aCategory,
-                                  nsIDocument* aDocument);
+                                  const PRUnichar **aParams = nsnull,
+                                  PRUint32 aParamsLength = 0,
+                                  nsIURI* aURI = nsnull,
+                                  const nsAFlatString& aSourceLine
+                                    = EmptyString(),
+                                  PRUint32 aLineNumber = 0,
+                                  PRUint32 aColumnNumber = 0);
 
   /**
    * Get the localized string named |aKey| in properties file |aFile|.
    */
   static nsresult GetLocalizedString(PropertiesFile aFile,
                                      const char* aKey,
                                      nsXPIDLString& aResult);
 
--- a/content/base/src/nsCSPService.cpp
+++ b/content/base/src/nsCSPService.cpp
@@ -296,17 +296,17 @@ CSPService::AsyncOnChannelRedirect(nsICh
   }
 
   // The redirecting channel isn't a writable property bag, we won't be able
   // to enforce the load policy if it redirects again, so we stop it now.
   nsCAutoString newUriSpec;
   newUri->GetSpec(newUriSpec);
   const PRUnichar *formatParams[] = { NS_ConvertUTF8toUTF16(newUriSpec).get() };
   if (NS_SUCCEEDED(rv)) {
-    nsContentUtils::ReportToConsole(nsContentUtils::eDOM_PROPERTIES,
-                                   "InvalidRedirectChannelWarning",
-                                    formatParams, 1, nsnull, EmptyString(),
-                                    0, 0, nsIScriptError::warningFlag,
-                                    "Redirect Error");
+    nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
+                                    "Redirect Error", nsnull,
+                                    nsContentUtils::eDOM_PROPERTIES,
+                                    "InvalidRedirectChannelWarning",
+                                    formatParams, 1);
   }
 
   return NS_BINDING_FAILED;
 }
--- a/content/base/src/nsContentUtils.cpp
+++ b/content/base/src/nsContentUtils.cpp
@@ -2780,32 +2780,40 @@ nsresult nsContentUtils::FormatLocalized
   nsIStringBundle *bundle = sStringBundles[aFile];
 
   return bundle->FormatStringFromName(NS_ConvertASCIItoUTF16(aKey).get(),
                                       aParams, aParamsLength,
                                       getter_Copies(aResult));
 }
 
 /* static */ nsresult
-nsContentUtils::ReportToConsole(PropertiesFile aFile,
+nsContentUtils::ReportToConsole(PRUint32 aErrorFlags,
+                                const char *aCategory,
+                                nsIDocument* aDocument,
+                                PropertiesFile aFile,
                                 const char *aMessageName,
                                 const PRUnichar **aParams,
                                 PRUint32 aParamsLength,
                                 nsIURI* aURI,
                                 const nsAFlatString& aSourceLine,
                                 PRUint32 aLineNumber,
-                                PRUint32 aColumnNumber,
-                                PRUint32 aErrorFlags,
-                                const char *aCategory,
-                                PRUint64 aInnerWindowId)
+                                PRUint32 aColumnNumber)
 {
   NS_ASSERTION((aParams && aParamsLength) || (!aParams && !aParamsLength),
                "Supply either both parameters and their number or no"
                "parameters and 0.");
 
+  PRUint64 innerWindowID = 0;
+  if (aDocument) {
+    if (!aURI) {
+      aURI = aDocument->GetDocumentURI();
+    }
+    innerWindowID = aDocument->InnerWindowID();
+  }
+
   nsresult rv;
   if (!sConsoleService) { // only need to bother null-checking here
     rv = CallGetService(NS_CONSOLESERVICE_CONTRACTID, &sConsoleService);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   nsXPIDLString errorText;
   if (aParams) {
@@ -2825,50 +2833,23 @@ nsContentUtils::ReportToConsole(Properti
       do_CreateInstance(NS_SCRIPTERROR_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = errorObject->InitWithWindowID(errorText.get(),
                                      NS_ConvertUTF8toUTF16(spec).get(), // file name
                                      aSourceLine.get(),
                                      aLineNumber, aColumnNumber,
                                      aErrorFlags, aCategory,
-                                     aInnerWindowId);
+                                     innerWindowID);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIScriptError> logError = do_QueryInterface(errorObject);
   return sConsoleService->LogMessage(logError);
 }
 
-/* static */ nsresult
-nsContentUtils::ReportToConsole(PropertiesFile aFile,
-                                const char *aMessageName,
-                                const PRUnichar **aParams,
-                                PRUint32 aParamsLength,
-                                nsIURI* aURI,
-                                const nsAFlatString& aSourceLine,
-                                PRUint32 aLineNumber,
-                                PRUint32 aColumnNumber,
-                                PRUint32 aErrorFlags,
-                                const char *aCategory,
-                                nsIDocument* aDocument)
-{
-  nsIURI* uri = aURI;
-  PRUint64 innerWindowID = 0;
-  if (aDocument) {
-    if (!uri) {
-      uri = aDocument->GetDocumentURI();
-    }
-    innerWindowID = aDocument->InnerWindowID();
-  }
-
-  return ReportToConsole(aFile, aMessageName, aParams, aParamsLength, uri,
-                         aSourceLine, aLineNumber, aColumnNumber, aErrorFlags,
-                         aCategory, innerWindowID);
-}
-
 bool
 nsContentUtils::IsChromeDoc(nsIDocument *aDocument)
 {
   if (!aDocument) {
     return false;
   }
   
   nsCOMPtr<nsIPrincipal> systemPrincipal;
--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -4013,23 +4013,20 @@ nsDocument::BeginLoad()
   }
 
   NS_DOCUMENT_NOTIFY_OBSERVERS(BeginLoad, (this));
 }
 
 void
 nsDocument::ReportEmptyGetElementByIdArg()
 {
-  nsContentUtils::ReportToConsole(nsContentUtils::eDOM_PROPERTIES,
-                                  "EmptyGetElementByIdParam",
-                                  nsnull, 0,
-                                  nsnull,
-                                  EmptyString(), 0, 0,
-                                  nsIScriptError::warningFlag,
-                                  "DOM", this);
+  nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
+                                  "DOM", this,
+                                  nsContentUtils::eDOM_PROPERTIES,
+                                  "EmptyGetElementByIdParam");
 }
 
 Element*
 nsDocument::GetElementById(const nsAString& aElementId)
 {
   if (!CheckGetElementByIdArg(aElementId)) {
     return nsnull;
   }
@@ -5302,23 +5299,20 @@ nsDocument::GetBoxObjectFor(nsIDOMElemen
   nsCOMPtr<nsIContent> content(do_QueryInterface(aElement));
   NS_ENSURE_TRUE(content, NS_ERROR_UNEXPECTED);
 
   nsIDocument* doc = content->OwnerDoc();
   NS_ENSURE_TRUE(doc == this, NS_ERROR_DOM_WRONG_DOCUMENT_ERR);
 
   if (!mHasWarnedAboutBoxObjects && !content->IsXUL()) {
     mHasWarnedAboutBoxObjects = true;
-    nsContentUtils::ReportToConsole(nsContentUtils::eDOM_PROPERTIES,
-                                    "UseOfGetBoxObjectForWarning",
-                                    nsnull, 0,
-                                    nsnull,
-                                    EmptyString(), 0, 0,
-                                    nsIScriptError::warningFlag,
-                                    "BoxObjects", this);
+    nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
+                                    "BoxObjects", this,
+                                    nsContentUtils::eDOM_PROPERTIES,
+                                    "UseOfGetBoxObjectForWarning");
   }
 
   *aResult = nsnull;
 
   if (!mBoxObjectTable) {
     mBoxObjectTable = new nsInterfaceHashtable<nsVoidPtrHashKey, nsPIBoxObject>;
     if (mBoxObjectTable && !mBoxObjectTable->Init(12)) {
       mBoxObjectTable = nsnull;
@@ -8192,23 +8186,20 @@ static const char* kWarnings[] = {
 void
 nsIDocument::WarnOnceAbout(DeprecatedOperations aOperation)
 {
   PR_STATIC_ASSERT(eDeprecatedOperationCount <= 64);
   if (mWarnedAbout & (1 << aOperation)) {
     return;
   }
   mWarnedAbout |= (1 << aOperation);
-  nsContentUtils::ReportToConsole(nsContentUtils::eDOM_PROPERTIES,
-                                  kWarnings[aOperation],
-                                  nsnull, 0,
-                                  nsnull,
-                                  EmptyString(), 0, 0,
-                                  nsIScriptError::warningFlag,
-                                  "DOM Core", this);
+  nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
+                                  "DOM Core", this,
+                                  nsContentUtils::eDOM_PROPERTIES,
+                                  kWarnings[aOperation]);
 }
 
 nsresult
 nsDocument::AddImage(imgIRequest* aImage)
 {
   NS_ENSURE_ARG_POINTER(aImage);
 
   // See if the image is already in the hashtable. If it is, get the old count.
@@ -8712,22 +8703,20 @@ LogFullScreenDenied(bool aLogFailure, co
     return;
   }
   nsRefPtr<nsPLDOMEvent> e =
     new nsPLDOMEvent(aDoc,
                      NS_LITERAL_STRING("mozfullscreenerror"),
                      true,
                      false);
   e->PostDOMEvent();
-  nsContentUtils::ReportToConsole(nsContentUtils::eDOM_PROPERTIES,
-                                  aMessage,
-                                  nsnull, 0, nsnull,
-                                  EmptyString(), 0, 0,
-                                  nsIScriptError::warningFlag,
-                                  "DOM", aDoc);
+  nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
+                                  "DOM", aDoc,
+                                  nsContentUtils::eDOM_PROPERTIES,
+                                  aMessage);
 }
 
 void
 nsDocument::ClearFullScreenStack()
 {
   if (mFullScreenStack.IsEmpty()) {
     return;
   }
--- a/content/base/src/nsGenericElement.cpp
+++ b/content/base/src/nsGenericElement.cpp
@@ -3076,22 +3076,20 @@ nsGenericElement::UnbindFromTree(bool aD
   // Make sure to unbind this node before doing the kids
   nsIDocument *document =
     HasFlag(NODE_FORCE_XBL_BINDINGS) ? OwnerDoc() : GetCurrentDoc();
 
   if (aNullParent) {
     if (IsFullScreenAncestor()) {
       // The element being removed is an ancestor of the full-screen element,
       // exit full-screen state.
-      nsContentUtils::ReportToConsole(nsContentUtils::eDOM_PROPERTIES,
-                                      "RemovedFullScreenElement",
-                                      nsnull, 0, nsnull,
-                                      EmptyString(), 0, 0,
-                                      nsIScriptError::warningFlag,
-                                      "DOM", OwnerDoc());
+      nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
+                                      "DOM", OwnerDoc(),
+                                      nsContentUtils::eDOM_PROPERTIES,
+                                      "RemovedFullScreenElement");
       // Fully exit full-screen.
       nsIDocument::ExitFullScreen(false);
     }
     if (GetParent()) {
       NS_RELEASE(mParent);
     } else {
       mParent = nsnull;
     }
--- a/content/base/src/nsXMLHttpRequest.cpp
+++ b/content/base/src/nsXMLHttpRequest.cpp
@@ -702,27 +702,20 @@ nsXMLHttpRequest::GetChannel(nsIChannel 
 }
 
 static void LogMessage(const char* aWarning, nsPIDOMWindow* aWindow)
 {
   nsCOMPtr<nsIDocument> doc;
   if (aWindow) {
     doc = do_QueryInterface(aWindow->GetExtantDocument());
   }
-  nsContentUtils::ReportToConsole(nsContentUtils::eDOM_PROPERTIES,
-                                  aWarning,
-                                  nsnull,
-                                  0,
-                                  nsnull, // Response URL not kept around
-                                  EmptyString(),
-                                  0,
-                                  0,
-                                  nsIScriptError::warningFlag,
-                                  "DOM",
-                                  doc);
+  nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
+                                  "DOM", doc,
+                                  nsContentUtils::eDOM_PROPERTIES,
+                                  aWarning);
 }
 
 /* readonly attribute nsIDOMDocument responseXML; */
 NS_IMETHODIMP
 nsXMLHttpRequest::GetResponseXML(nsIDOMDocument **aResponseXML)
 {
   NS_ENSURE_ARG_POINTER(aResponseXML);
   *aResponseXML = nsnull;
--- a/content/canvas/src/nsCanvasRenderingContext2D.cpp
+++ b/content/canvas/src/nsCanvasRenderingContext2D.cpp
@@ -901,24 +901,21 @@ nsCanvasRenderingContext2D::SetStyleFrom
         if (pattern) {
             CurrentState().SetPatternStyle(aWhichStyle, pattern);
             mDirtyStyle[aWhichStyle] = true;
             return NS_OK;
         }
     }
 
     nsContentUtils::ReportToConsole(
-        nsContentUtils::eDOM_PROPERTIES,
-        "UnexpectedCanvasVariantStyle",
-        nsnull, 0,
-        nsnull,
-        EmptyString(), 0, 0,
         nsIScriptError::warningFlag,
         "Canvas",
-        mCanvasElement ? HTMLCanvasElement()->OwnerDoc() : nsnull);
+        mCanvasElement ? HTMLCanvasElement()->OwnerDoc() : nsnull,
+        nsContentUtils::eDOM_PROPERTIES,
+        "UnexpectedCanvasVariantStyle");
 
     return NS_OK;
 }
 
 nsresult
 nsCanvasRenderingContext2D::GetStyleAsStringOrInterface(nsAString& aStr,
                                                         nsISupports **aInterface,
                                                         PRInt32 *aType,
--- a/content/canvas/src/nsCanvasRenderingContext2DAzure.cpp
+++ b/content/canvas/src/nsCanvasRenderingContext2DAzure.cpp
@@ -1091,24 +1091,21 @@ nsCanvasRenderingContext2DAzure::SetStyl
     nsCOMPtr<nsCanvasPatternAzure> pattern(do_QueryInterface(aInterface));
     if (pattern) {
       CurrentState().SetPatternStyle(aWhichStyle, pattern);
       return NS_OK;
     }
   }
 
   nsContentUtils::ReportToConsole(
-    nsContentUtils::eDOM_PROPERTIES,
-    "UnexpectedCanvasVariantStyle",
-    nsnull, 0,
-    nsnull,
-    EmptyString(), 0, 0,
     nsIScriptError::warningFlag,
     "Canvas",
-    mCanvasElement ? HTMLCanvasElement()->OwnerDoc() : nsnull);
+    mCanvasElement ? HTMLCanvasElement()->OwnerDoc() : nsnull,
+    nsContentUtils::eDOM_PROPERTIES,
+    "UnexpectedCanvasVariantStyle");
 
   return NS_OK;
 }
 
 nsresult
 nsCanvasRenderingContext2DAzure::GetStyleAsStringOrInterface(nsAString& aStr,
                                                              nsISupports **aInterface,
                                                              PRInt32 *aType,
--- a/content/events/src/nsDOMEvent.cpp
+++ b/content/events/src/nsDOMEvent.cpp
@@ -514,23 +514,21 @@ static void
 ReportUseOfDeprecatedMethod(nsEvent* aEvent, nsIDOMEvent* aDOMEvent,
                             const char* aWarning)
 {
   nsCOMPtr<nsIDocument> doc(GetDocumentForReport(aEvent));
 
   nsAutoString type;
   aDOMEvent->GetType(type);
   const PRUnichar *strings[] = { type.get() };
-  nsContentUtils::ReportToConsole(nsContentUtils::eDOM_PROPERTIES,
+  nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
+                                  "DOM Events", doc,
+                                  nsContentUtils::eDOM_PROPERTIES,
                                   aWarning,
-                                  strings, ArrayLength(strings),
-                                  nsnull,
-                                  EmptyString(), 0, 0,
-                                  nsIScriptError::warningFlag,
-                                  "DOM Events", doc);
+                                  strings, ArrayLength(strings));
 }
 
 NS_IMETHODIMP
 nsDOMEvent::PreventBubble()
 {
   ReportUseOfDeprecatedMethod(mEvent, this, "UseOfPreventBubbleWarning");
   return NS_OK;
 }
--- a/content/html/content/src/nsFormSubmission.cpp
+++ b/content/html/content/src/nsFormSubmission.cpp
@@ -75,23 +75,21 @@
 
 using namespace mozilla;
 
 static void
 SendJSWarning(nsIDocument* aDocument,
               const char* aWarningName,
               const PRUnichar** aWarningArgs, PRUint32 aWarningArgsLen)
 {
-  nsContentUtils::ReportToConsole(nsContentUtils::eFORMS_PROPERTIES,
+  nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
+                                  "HTML", aDocument,
+                                  nsContentUtils::eFORMS_PROPERTIES,
                                   aWarningName,
-                                  aWarningArgs, aWarningArgsLen,
-                                  nsnull,
-                                  EmptyString(), 0, 0,
-                                  nsIScriptError::warningFlag,
-                                  "HTML", aDocument);
+                                  aWarningArgs, aWarningArgsLen);
 }
 
 // --------------------------------------------------------------------------
 
 class nsFSURLEncoded : public nsEncodingFormSubmission
 {
 public:
   /**
--- a/content/html/content/src/nsGenericHTMLElement.cpp
+++ b/content/html/content/src/nsGenericHTMLElement.cpp
@@ -3465,22 +3465,20 @@ nsGenericHTMLElement::Focus()
 nsresult nsGenericHTMLElement::MozRequestFullScreen()
 {
   // Only grant full-screen requests if this is called from inside a trusted
   // event handler (i.e. inside an event handler for a user initiated event).
   // This stops the full-screen from being abused similar to the popups of old,
   // and it also makes it harder for bad guys' script to go full-screen and
   // spoof the browser chrome/window and phish logins etc.
   if (!nsContentUtils::IsRequestFullScreenAllowed()) {
-    nsContentUtils::ReportToConsole(nsContentUtils::eDOM_PROPERTIES,
-                                    "FullScreenDeniedNotInputDriven",
-                                    nsnull, 0, nsnull,
-                                    EmptyString(), 0, 0,
-                                    nsIScriptError::warningFlag,
-                                    "DOM", OwnerDoc());
+    nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
+                                    "DOM", OwnerDoc(),
+                                    nsContentUtils::eDOM_PROPERTIES,
+                                    "FullScreenDeniedNotInputDriven");
     nsRefPtr<nsPLDOMEvent> e =
       new nsPLDOMEvent(OwnerDoc(),
                        NS_LITERAL_STRING("mozfullscreenerror"),
                        true,
                        false);
     e->PostDOMEvent();
     return NS_OK;
   }
--- a/content/html/content/src/nsHTMLSharedObjectElement.cpp
+++ b/content/html/content/src/nsHTMLSharedObjectElement.cpp
@@ -293,22 +293,20 @@ nsHTMLSharedObjectElement::BindToTree(ns
 #ifndef XP_MACOSX
   if (aDocument &&
       aDocument->IsFullScreenDoc() &&
       nsContentUtils::HasPluginWithUncontrolledEventDispatch(this)) {
     // This content contains a windowed plugin for which we don't control
     // event dispatch, and we're in full-screen mode. Exit full-screen mode
     // to prevent phishing attacks.
     nsIDocument::ExitFullScreen(true);
-    nsContentUtils::ReportToConsole(nsContentUtils::eDOM_PROPERTIES,
-                                    "AddedWindowedPluginWhileFullScreen",
-                                    nsnull, 0, nsnull,
-                                    EmptyString(), 0, 0,
-                                    nsIScriptError::warningFlag,
-                                    "DOM", aDocument);           
+    nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
+                                    "DOM", aDocument,
+                                    nsContentUtils::eDOM_PROPERTIES,
+                                    "AddedWindowedPluginWhileFullScreen");
   }
 #endif
   return NS_OK;
 }
 
 void
 nsHTMLSharedObjectElement::UnbindFromTree(bool aDeep,
                                           bool aNullParent)
--- a/content/html/document/src/nsHTMLDocument.cpp
+++ b/content/html/document/src/nsHTMLDocument.cpp
@@ -204,23 +204,20 @@ MyPrefChangedCallback(const char*aPrefNa
 }
 
 // ==================================================================
 // =
 // ==================================================================
 static void
 ReportUseOfDeprecatedMethod(nsHTMLDocument* aDoc, const char* aWarning)
 {
-  nsContentUtils::ReportToConsole(nsContentUtils::eDOM_PROPERTIES,
-                                  aWarning,
-                                  nsnull, 0,
-                                  nsnull,
-                                  EmptyString(), 0, 0,
-                                  nsIScriptError::warningFlag,
-                                  "DOM Events", aDoc);
+  nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
+                                  "DOM Events", aDoc,
+                                  nsContentUtils::eDOM_PROPERTIES,
+                                  aWarning);
 }
 
 static nsresult
 RemoveFromAgentSheets(nsCOMArray<nsIStyleSheet> &aAgentSheets, const nsAString& url)
 {
   nsCOMPtr<nsIURI> uri;
   nsresult rv = NS_NewURI(getter_AddRefs(uri), url);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -1912,40 +1909,38 @@ nsHTMLDocument::WriteCommon(JSContext *c
 
   void *key = GenerateParserKey();
   if (mWriteState == eDocumentClosed ||
       (mWriteState == ePendingClose &&
        !mPendingScripts.Contains(key)) ||
       (mParser && !mParser->IsInsertionPointDefined())) {
     if (mExternalScriptsBeingEvaluated) {
       // Instead of implying a call to document.open(), ignore the call.
-      nsContentUtils::ReportToConsole(nsContentUtils::eDOM_PROPERTIES,
+      nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
+                                      "DOM Events", this,
+                                      nsContentUtils::eDOM_PROPERTIES,
                                       "DocumentWriteIgnored",
                                       nsnull, 0,
-                                      mDocumentURI,
-                                      EmptyString(), 0, 0,
-                                      nsIScriptError::warningFlag,
-                                      "DOM Events", this);
+                                      mDocumentURI);
       return NS_OK;
     }
     mWriteState = eDocumentClosed;
     mParser->Terminate();
     NS_ASSERTION(!mParser, "mParser should have been null'd out");
   }
 
   if (!mParser) {
     if (mExternalScriptsBeingEvaluated) {
       // Instead of implying a call to document.open(), ignore the call.
-      nsContentUtils::ReportToConsole(nsContentUtils::eDOM_PROPERTIES,
+      nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
+                                      "DOM Events", this,
+                                      nsContentUtils::eDOM_PROPERTIES,
                                       "DocumentWriteIgnored",
                                       nsnull, 0,
-                                      mDocumentURI,
-                                      EmptyString(), 0, 0,
-                                      nsIScriptError::warningFlag,
-                                      "DOM Events", this);
+                                      mDocumentURI);
       return NS_OK;
     }
     nsCOMPtr<nsISupports> ignored;
     rv = Open(NS_LITERAL_STRING("text/html"), EmptyString(), EmptyString(), cx,
               1, getter_AddRefs(ignored));
 
     // If Open() fails, or if it didn't create a parser (as it won't
     // if the user chose to not discard the current document through
--- a/content/xbl/src/nsXBLContentSink.cpp
+++ b/content/xbl/src/nsXBLContentSink.cpp
@@ -242,25 +242,25 @@ nsXBLContentSink::ReportUnexpectedElemen
   // instead of just letting the XML sink build the content model like
   // we do...
   mState = eXBL_Error;
   nsAutoString elementName;
   aElementName->ToString(elementName);
 
   const PRUnichar* params[] = { elementName.get() };
 
-  return nsContentUtils::ReportToConsole(nsContentUtils::eXBL_PROPERTIES,
+  return nsContentUtils::ReportToConsole(nsIScriptError::errorFlag,
+                                         "XBL Content Sink",
+                                         mDocument,
+                                         nsContentUtils::eXBL_PROPERTIES,
                                          "UnexpectedElement",
                                          params, ArrayLength(params),
                                          nsnull,
                                          EmptyString() /* source line */,
-                                         aLineNumber, 0 /* column number */,
-                                         nsIScriptError::errorFlag,
-                                         "XBL Content Sink",
-                                         mDocument);
+                                         aLineNumber);
 }
 
 void
 nsXBLContentSink::AddMember(nsXBLProtoImplMember* aMember)
 {
   // Add this member to our chain.
   if (mImplMember)
     mImplMember->SetNext(aMember); // Already have a chain. Just append to the end.
@@ -582,23 +582,23 @@ nsXBLContentSink::ConstructBinding(PRUin
         mDocInfo->SetFirstPrototypeBinding(mBinding);
       }
       binding->UnsetAttr(kNameSpaceID_None, nsGkAtoms::id, false);
     } else {
       delete mBinding;
       mBinding = nsnull;
     }
   } else {
-    nsContentUtils::ReportToConsole(nsContentUtils::eXBL_PROPERTIES,
+    nsContentUtils::ReportToConsole(nsIScriptError::errorFlag,
+                                    "XBL Content Sink", nsnull,
+                                    nsContentUtils::eXBL_PROPERTIES,
                                     "MissingIdAttr", nsnull, 0,
                                     mDocumentURI,
                                     EmptyString(),
-                                    aLineNumber, 0,
-                                    nsIScriptError::errorFlag,
-                                    "XBL Content Sink");
+                                    aLineNumber);
   }
 
   return rv;
 }
 
 static bool
 FindValue(const PRUnichar **aAtts, nsIAtom *aAtom, const PRUnichar **aResult)
 {
@@ -671,24 +671,24 @@ nsXBLContentSink::ConstructHandler(const
     else if (localName == nsGkAtoms::allowuntrusted)
       allowuntrusted = aAtts[1];
   }
 
   if (command && !mIsChromeOrResource) {
     // Make sure the XBL doc is chrome or resource if we have a command
     // shorthand syntax.
     mState = eXBL_Error;
-    nsContentUtils::ReportToConsole(nsContentUtils::eXBL_PROPERTIES,
+    nsContentUtils::ReportToConsole(nsIScriptError::errorFlag,
+                                    "XBL Content Sink",
+                                    mDocument,
+                                    nsContentUtils::eXBL_PROPERTIES,
                                     "CommandNotInChrome", nsnull, 0,
                                     nsnull,
                                     EmptyString() /* source line */,
-                                    aLineNumber, 0 /* column number */,
-                                    nsIScriptError::errorFlag,
-                                    "XBL Content Sink",
-                                    mDocument);
+                                    aLineNumber);
     return; // Don't even make this handler.
   }
 
   // All of our pointers are now filled in. Construct our handler with all of
   // these parameters.
   nsXBLPrototypeHandler* newHandler;
   newHandler = new nsXBLPrototypeHandler(event, phase, action, command,
                                          keycode, charcode, modifiers, button,
--- a/content/xbl/src/nsXBLPrototypeBinding.cpp
+++ b/content/xbl/src/nsXBLPrototypeBinding.cpp
@@ -2350,23 +2350,22 @@ nsXBLPrototypeBinding::ResolveBaseBindin
     if (!nameSpace.IsEmpty()) {
       PRInt32 nameSpaceID =
         nsContentUtils::NameSpaceManager()->GetNameSpaceID(nameSpace);
 
       nsCOMPtr<nsIAtom> tagName = do_GetAtom(display);
       // Check the white list
       if (!CheckTagNameWhiteList(nameSpaceID, tagName)) {
         const PRUnichar* params[] = { display.get() };
-        nsContentUtils::ReportToConsole(nsContentUtils::eXBL_PROPERTIES,
+        nsContentUtils::ReportToConsole(nsIScriptError::errorFlag,
+                                        "XBL", nsnull,
+                                        nsContentUtils::eXBL_PROPERTIES,
                                        "InvalidExtendsBinding",
-                                        params, NS_ARRAY_LENGTH(params),
-                                        doc->GetDocumentURI(),
-                                        EmptyString(), 0, 0,
-                                        nsIScriptError::errorFlag,
-                                        "XBL");
+                                        params, ArrayLength(params),
+                                        doc->GetDocumentURI());
         NS_ASSERTION(!nsXBLService::IsChromeOrResourceURI(doc->GetDocumentURI()),
                      "Invalid extends value");
         return NS_ERROR_ILLEGAL_VALUE;
       }
 
       SetBaseTag(nameSpaceID, tagName);
     }
   }
--- a/content/xbl/src/nsXBLPrototypeHandler.cpp
+++ b/content/xbl/src/nsXBLPrototypeHandler.cpp
@@ -987,22 +987,22 @@ nsXBLPrototypeHandler::ReportKeyConflict
     if (docInfo) {
       doc = docInfo->GetDocument();
     }
   } else if (aKeyElement) {
     doc = aKeyElement->OwnerDoc();
   }
 
   const PRUnichar* params[] = { aKey, aModifiers };
-  nsContentUtils::ReportToConsole(nsContentUtils::eXBL_PROPERTIES,
+  nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
+                                  "XBL Prototype Handler", doc,
+                                  nsContentUtils::eXBL_PROPERTIES,
                                   aMessageName,
                                   params, ArrayLength(params),
-                                  nsnull, EmptyString(), mLineNumber, 0,
-                                  nsIScriptError::warningFlag,
-                                  "XBL Prototype Handler", doc);
+                                  nsnull, EmptyString(), mLineNumber);
 }
 
 bool
 nsXBLPrototypeHandler::ModifiersMatchMask(nsIDOMUIEvent* aEvent,
                                           bool aIgnoreShiftKey)
 {
   nsCOMPtr<nsIDOMKeyEvent> key(do_QueryInterface(aEvent));
   nsCOMPtr<nsIDOMMouseEvent> mouse(do_QueryInterface(aEvent));
--- a/content/xbl/src/nsXBLService.cpp
+++ b/content/xbl/src/nsXBLService.cpp
@@ -121,23 +121,21 @@ IsAncestorBinding(nsIDocument* aDocument
       ++bindingRecursion;
       if (bindingRecursion < NS_MAX_XBL_BINDING_RECURSION) {
         continue;
       }
       nsCAutoString spec;
       aChildBindingURI->GetSpec(spec);
       NS_ConvertUTF8toUTF16 bindingURI(spec);
       const PRUnichar* params[] = { bindingURI.get() };
-      nsContentUtils::ReportToConsole(nsContentUtils::eXBL_PROPERTIES,
+      nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
+                                      "XBL", aDocument,
+                                      nsContentUtils::eXBL_PROPERTIES,
                                       "TooDeepBindingRecursion",
-                                      params, ArrayLength(params),
-                                      nsnull,
-                                      EmptyString(), 0, 0,
-                                      nsIScriptError::warningFlag,
-                                      "XBL", aDocument);
+                                      params, ArrayLength(params));
       return true;
     }
   }
 
   return false;
 }
 
 // Individual binding requests.
@@ -414,22 +412,21 @@ nsXBLStreamListener::HandleEvent(nsIDOME
     nsBindingManager *xblDocBindingManager = bindingDocument->BindingManager();
     nsRefPtr<nsXBLDocumentInfo> info =
       xblDocBindingManager->GetXBLDocumentInfo(documentURI);
     xblDocBindingManager->RemoveXBLDocumentInfo(info); // Break the self-imposed cycle.
     if (!info) {
       if (nsXBLService::IsChromeOrResourceURI(documentURI)) {
         NS_WARNING("An XBL file is malformed. Did you forget the XBL namespace on the bindings tag?");
       }
-      nsContentUtils::ReportToConsole(nsContentUtils::eXBL_PROPERTIES,
+      nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
+                                      "XBL", nsnull,
+                                      nsContentUtils::eXBL_PROPERTIES,
                                       "MalformedXBL",
-                                      nsnull, 0, documentURI,
-                                      EmptyString(), 0, 0,
-                                      nsIScriptError::warningFlag,
-                                      "XBL");
+                                      nsnull, 0, documentURI);
       return NS_ERROR_FAILURE;
     }
 
     // If the doc is a chrome URI, then we put it into the XUL cache.
 #ifdef MOZ_XUL
     if (nsXBLService::IsChromeOrResourceURI(documentURI)) {
       nsXULPrototypeCache* cache = nsXULPrototypeCache::GetInstance();
       if (cache && cache->IsEnabled())
@@ -882,23 +879,22 @@ nsXBLService::GetBinding(nsIContent* aBo
         NS_ENSURE_SUCCESS(rv, rv);
         if (equal) {
           nsCAutoString spec, basespec;
           protoBinding->BindingURI()->GetSpec(spec);
           NS_ConvertUTF8toUTF16 protoSpec(spec);
           baseBindingURI->GetSpec(basespec);
           NS_ConvertUTF8toUTF16 baseSpecUTF16(basespec);
           const PRUnichar* params[] = { protoSpec.get(), baseSpecUTF16.get() };
-          nsContentUtils::ReportToConsole(nsContentUtils::eXBL_PROPERTIES,
+          nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
+                                          "XBL", nsnull,
+                                          nsContentUtils::eXBL_PROPERTIES,
                                           "CircularExtendsBinding",
-                                          params, NS_ARRAY_LENGTH(params),
-                                          boundDocument->GetDocumentURI(),
-                                          EmptyString(), 0, 0,
-                                          nsIScriptError::warningFlag,
-                                          "XBL");
+                                          params, ArrayLength(params),
+                                          boundDocument->GetDocumentURI());
           return NS_ERROR_ILLEGAL_VALUE;
         }
       }
     }
   }
 
   nsRefPtr<nsXBLBinding> baseBinding;
   if (baseBindingURI) {
--- a/content/xml/document/src/nsXMLDocument.cpp
+++ b/content/xml/document/src/nsXMLDocument.cpp
@@ -318,23 +318,20 @@ nsXMLDocument::SetAsync(bool aAsync)
 {
   mAsync = aAsync;
   return NS_OK;
 }
 
 static void
 ReportUseOfDeprecatedMethod(nsIDocument *aDoc, const char* aWarning)
 {
-  nsContentUtils::ReportToConsole(nsContentUtils::eDOM_PROPERTIES,
-                                  aWarning,
-                                  nsnull, 0,
-                                  nsnull,
-                                  EmptyString(), 0, 0,
-                                  nsIScriptError::warningFlag,
-                                  "DOM3 Load", aDoc);
+  nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
+                                  "DOM3 Load", aDoc,
+                                  nsContentUtils::eDOM_PROPERTIES,
+                                  aWarning);
 }
 
 NS_IMETHODIMP
 nsXMLDocument::Load(const nsAString& aUrl, bool *aReturn)
 {
   bool hasHadScriptObject = true;
   nsIScriptGlobalObject* scriptObject =
     GetScriptHandlingObject(hasHadScriptObject);
--- a/content/xul/document/src/nsXULDocument.cpp
+++ b/content/xul/document/src/nsXULDocument.cpp
@@ -3030,25 +3030,22 @@ nsXULDocument::ResumeWalk()
                 // outside the prolog, like they used to. Issue a warning.
 
                 if (piProto->mTarget.EqualsLiteral("xml-stylesheet") ||
                     piProto->mTarget.EqualsLiteral("xul-overlay")) {
 
                     const PRUnichar* params[] = { piProto->mTarget.get() };
 
                     nsContentUtils::ReportToConsole(
+                                        nsIScriptError::warningFlag,
+                                        "XUL Document", nsnull,
                                         nsContentUtils::eXUL_PROPERTIES,
                                         "PINotInProlog",
                                         params, ArrayLength(params),
-                                        overlayURI,
-                                        EmptyString(), /* source line */
-                                        0, /* line number */
-                                        0, /* column number */
-                                        nsIScriptError::warningFlag,
-                                        "XUL Document");
+                                        overlayURI);
                 }
 
                 nsIContent* parent = processingOverlayHookupNodes ?
                     GetRootElement() : element.get();
 
                 if (parent) {
                     // an inline script could have removed the root element
                     rv = CreateAndInsertPI(piProto, parent,
@@ -3327,25 +3324,21 @@ nsXULDocument::ReportMissingOverlay(nsIU
 {
     NS_PRECONDITION(aURI, "Must have a URI");
     
     nsCAutoString spec;
     aURI->GetSpec(spec);
 
     NS_ConvertUTF8toUTF16 utfSpec(spec);
     const PRUnichar* params[] = { utfSpec.get() };
-    nsContentUtils::ReportToConsole(nsContentUtils::eXUL_PROPERTIES,
+    nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
+                                    "XUL Document", this,
+                                    nsContentUtils::eXUL_PROPERTIES,
                                     "MissingOverlay",
-                                    params, ArrayLength(params),
-                                    nsnull,
-                                    EmptyString(), /* source line */
-                                    0, /* line number */
-                                    0, /* column number */
-                                    nsIScriptError::warningFlag,
-                                    "XUL Document", this);
+                                    params, ArrayLength(params));
 }
 
 nsresult
 nsXULDocument::LoadScript(nsXULPrototypeScript* aScriptProto, bool* aBlock)
 {
     // Load a transcluded script
     nsresult rv;
 
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -1371,21 +1371,20 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(
   // Make sure this matches the cast in nsGlobalWindow::FromWrapper()
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIScriptGlobalObject)
   NS_INTERFACE_MAP_ENTRY(nsIDOMWindow)
   NS_INTERFACE_MAP_ENTRY(nsIDOMJSWindow)
   if (aIID.Equals(NS_GET_IID(nsIDOMWindowInternal))) {
     foundInterface = static_cast<nsIDOMWindowInternal*>(this);
     if (!sWarnedAboutWindowInternal) {
       sWarnedAboutWindowInternal = true;
-      nsContentUtils::ReportToConsole(nsContentUtils::eDOM_PROPERTIES,
-                                      "nsIDOMWindowInternalWarning",
-                                      nsnull, 0, nsnull, EmptyString(), 0, 0,
-                                      nsIScriptError::warningFlag,
-                                      "Extensions", mWindowID);
+      nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
+                                      "Extensions", mDoc,
+                                      nsContentUtils::eDOM_PROPERTIES,
+                                      "nsIDOMWindowInternalWarning");
     }
   } else
   NS_INTERFACE_MAP_ENTRY(nsIScriptGlobalObject)
   NS_INTERFACE_MAP_ENTRY(nsIScriptObjectPrincipal)
   NS_INTERFACE_MAP_ENTRY(nsIDOMEventTarget)
   NS_INTERFACE_MAP_ENTRY(nsPIDOMWindow)
   NS_INTERFACE_MAP_ENTRY(nsIDOMStorageIndexedDB)
   NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
@@ -5539,23 +5538,20 @@ nsGlobalWindow::SetResizable(bool aResiz
 
   return NS_OK;
 }
 
 static void
 ReportUseOfDeprecatedMethod(nsGlobalWindow* aWindow, const char* aWarning)
 {
   nsCOMPtr<nsIDocument> doc = do_QueryInterface(aWindow->GetExtantDocument());
-  nsContentUtils::ReportToConsole(nsContentUtils::eDOM_PROPERTIES,
-                                  aWarning,
-                                  nsnull, 0,
-                                  nsnull,
-                                  EmptyString(), 0, 0,
-                                  nsIScriptError::warningFlag,
-                                  "DOM Events", doc);
+  nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
+                                  "DOM Events", doc,
+                                  nsContentUtils::eDOM_PROPERTIES,
+                                  aWarning);
 }
 
 NS_IMETHODIMP
 nsGlobalWindow::CaptureEvents(PRInt32 aEventFlags)
 {
   ReportUseOfDeprecatedMethod(this, "UseOfCaptureEventsWarning");
   return NS_OK;
 }
@@ -6397,23 +6393,20 @@ nsGlobalWindow::Close()
   // that were not opened by script
   if (!mHadOriginalOpener && !nsContentUtils::IsCallerTrustedForWrite()) {
     bool allowClose =
       Preferences::GetBool("dom.allow_scripts_to_close_windows", true);
     if (!allowClose) {
       // We're blocking the close operation
       // report localized error msg in JS console
       nsContentUtils::ReportToConsole(
+          nsIScriptError::warningFlag,
+          "DOM Window", mDoc,  // Better name for the category?
           nsContentUtils::eDOM_PROPERTIES,
-          "WindowCloseBlockedWarning",
-          nsnull, 0, // No params
-          nsnull,
-          EmptyString(), 0, 0, // No source, or column/line number
-          nsIScriptError::warningFlag,
-          "DOM Window", mDoc);  // Better name for the category?
+          "WindowCloseBlockedWarning");
 
       return NS_OK;
     }
   }
 
   if (!mInClose && !mIsClosed && !CanClose())
     return NS_OK;
 
--- a/dom/src/json/nsJSON.cpp
+++ b/dom/src/json/nsJSON.cpp
@@ -77,25 +77,22 @@ nsJSON::~nsJSON()
 {
 }
 
 enum DeprecationWarning { EncodeWarning, DecodeWarning };
 
 static nsresult
 WarnDeprecatedMethod(DeprecationWarning warning)
 {
-  return nsContentUtils::ReportToConsole(nsContentUtils::eDOM_PROPERTIES,
+  return nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
+                                         "DOM Core", nsnull,
+                                         nsContentUtils::eDOM_PROPERTIES,
                                          warning == EncodeWarning
                                          ? "nsIJSONEncodeDeprecatedWarning"
-                                         : "nsIJSONDecodeDeprecatedWarning",
-                                         nsnull, 0,
-                                         nsnull,
-                                         EmptyString(), 0, 0,
-                                         nsIScriptError::warningFlag,
-                                         "DOM Core");
+                                         : "nsIJSONDecodeDeprecatedWarning");
 }
 
 NS_IMETHODIMP
 nsJSON::Encode(const JS::Value& aValue, JSContext* cx, PRUint8 aArgc, nsAString &aJSON)
 {
   // This function should only be called from JS.
   nsresult rv = WarnDeprecatedMethod(EncodeWarning);
   if (NS_FAILED(rv))
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -9649,23 +9649,21 @@ nsCSSFrameConstructor::ProcessChildren(n
     nsIContent *badKid = AnyKidsNeedBlockParent(aFrameItems.FirstChild());
     nsDependentAtomString parentTag(aContent->Tag()), kidTag(badKid->Tag());
     const PRUnichar* params[] = { parentTag.get(), kidTag.get() };
     nsStyleContext *frameStyleContext = aFrame->GetStyleContext();
     const nsStyleDisplay *display = frameStyleContext->GetStyleDisplay();
     const char *message =
       (display->mDisplay == NS_STYLE_DISPLAY_INLINE_BOX)
         ? "NeededToWrapXULInlineBox" : "NeededToWrapXUL";
-    nsContentUtils::ReportToConsole(nsContentUtils::eXUL_PROPERTIES,
+    nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
+                                    "FrameConstructor", mDocument,
+                                    nsContentUtils::eXUL_PROPERTIES,
                                     message,
-                                    params, ArrayLength(params),
-                                    nsnull,
-                                    EmptyString(), 0, 0, // not useful
-                                    nsIScriptError::warningFlag,
-                                    "FrameConstructor", mDocument);
+                                    params, ArrayLength(params));
 
     nsRefPtr<nsStyleContext> blockSC = mPresShell->StyleSet()->
       ResolveAnonymousBoxStyle(nsCSSAnonBoxes::mozXULAnonymousBlock,
                                frameStyleContext);
     nsIFrame *blockFrame = NS_NewBlockFrame(mPresShell, blockSC);
     // We might, in theory, want to set NS_BLOCK_FLOAT_MGR and
     // NS_BLOCK_MARGIN_ROOT, but I think it's a bad idea given that
     // a real block placed here wouldn't get those set on it.
--- a/layout/generic/nsImageMap.cpp
+++ b/layout/generic/nsImageMap.cpp
@@ -116,28 +116,25 @@ is_space(char c)
 
 static void logMessage(nsIContent*      aContent,
                        const nsAString& aCoordsSpec,
                        PRInt32          aFlags,
                        const char* aMessageName) {
   nsIDocument* doc = aContent->OwnerDoc();
 
   nsContentUtils::ReportToConsole(
+     aFlags, "ImageMap", doc,
      nsContentUtils::eLAYOUT_PROPERTIES,
      aMessageName,
      nsnull,  /* params */
      0, /* params length */
      nsnull,
      PromiseFlatString(NS_LITERAL_STRING("coords=\"") +
                        aCoordsSpec +
-                       NS_LITERAL_STRING("\"")), /* source line */
-     0, /* line number */
-     0, /* column number */
-     aFlags,
-     "ImageMap", doc);
+                       NS_LITERAL_STRING("\""))); /* source line */
 }
 
 void Area::ParseCoords(const nsAString& aSpec)
 {
   char* cp = ToNewCString(aSpec);
   if (cp) {
     char *tptr;
     char *n_str;
--- a/layout/style/Loader.cpp
+++ b/layout/style/Loader.cpp
@@ -964,21 +964,22 @@ SheetLoadData::OnStreamComplete(nsIUnich
     nsCAutoString spec;
     channelURI->GetSpec(spec);
 
     const nsAFlatString& specUTF16 = NS_ConvertUTF8toUTF16(spec);
     const nsAFlatString& ctypeUTF16 = NS_ConvertASCIItoUTF16(contentType);
     const PRUnichar *strings[] = { specUTF16.get(), ctypeUTF16.get() };
 
     nsCOMPtr<nsIURI> referrer = GetReferrerURI();
-    nsContentUtils::ReportToConsole(nsContentUtils::eCSS_PROPERTIES,
+    nsContentUtils::ReportToConsole(errorFlag,
+                                    "CSS Loader", mLoader->mDocument,
+                                    nsContentUtils::eCSS_PROPERTIES,
                                     errorMessage,
                                     strings, ArrayLength(strings),
-                                    referrer, EmptyString(), 0, 0, errorFlag,
-                                    "CSS Loader", mLoader->mDocument);
+                                    referrer);
 
     if (errorFlag == nsIScriptError::errorFlag) {
       LOG_WARN(("  Ignoring sheet with improper MIME type %s",
                 contentType.get()));
       mLoader->SheetComplete(this, NS_ERROR_NOT_AVAILABLE);
       return NS_OK;
     }
   }
--- a/layout/svg/base/src/nsSVGUtils.cpp
+++ b/layout/svg/base/src/nsSVGUtils.cpp
@@ -385,23 +385,21 @@ nsSVGUtils::ConvertImageDataFromLinearRG
 }
 
 nsresult
 nsSVGUtils::ReportToConsole(nsIDocument* doc,
                             const char* aWarning,
                             const PRUnichar **aParams,
                             PRUint32 aParamsLength)
 {
-  return nsContentUtils::ReportToConsole(nsContentUtils::eSVG_PROPERTIES,
+  return nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
+                                         "SVG", doc,
+                                         nsContentUtils::eSVG_PROPERTIES,
                                          aWarning,
-                                         aParams, aParamsLength,
-                                         nsnull,
-                                         EmptyString(), 0, 0,
-                                         nsIScriptError::warningFlag,
-                                         "SVG", doc);
+                                         aParams, aParamsLength);
 }
 
 float
 nsSVGUtils::CoordToFloat(nsPresContext *aPresContext,
                          nsSVGElement *aContent,
                          const nsStyleCoord &aCoord)
 {
   switch (aCoord.GetUnit()) {
--- a/parser/html/nsHtml5StreamParser.cpp
+++ b/parser/html/nsHtml5StreamParser.cpp
@@ -1435,26 +1435,25 @@ nsHtml5StreamParser::ContinueAfterScript
     if (speculationFailed) {
       // Rewind the stream
       mAtEOF = false;
       nsHtml5Speculation* speculation = mSpeculations.ElementAt(0);
       mFirstBuffer = speculation->GetBuffer();
       mFirstBuffer->setStart(speculation->GetStart());
       mTokenizer->setLineNumber(speculation->GetStartLineNumber());
 
-      nsContentUtils::ReportToConsole(nsContentUtils::eDOM_PROPERTIES,
+      nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
+                                      "DOM Events",
+                                      mExecutor->GetDocument(),
+                                      nsContentUtils::eDOM_PROPERTIES,
                                       "SpeculationFailed",
                                       nsnull, 0,
                                       nsnull,
                                       EmptyString(),
-                                      speculation->GetStartLineNumber(),
-                                      0,
-                                      nsIScriptError::warningFlag,
-                                      "DOM Events",
-                                      mExecutor->GetDocument());
+                                      speculation->GetStartLineNumber());
 
       nsHtml5OwningUTF16Buffer* buffer = mFirstBuffer->next;
       while (buffer) {
         buffer->setStart(0);
         buffer = buffer->next;
       }
       
       mSpeculations.Clear(); // potentially a huge number of destructors