diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp index 2f4bdced37106..d2967dfe84dac 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp @@ -3724,7 +3724,7 @@ nsresult nsContentUtils::ReportToConsoleByWindowID( NS_ENSURE_SUCCESS(rv, rv); } - nsAutoCString spec; + nsAutoString spec; if (!aLineNumber && aLocationMode == eUSE_CALLING_LOCATION) { JSContext* cx = GetCurrentJSContext(); if (cx) { @@ -3737,11 +3737,10 @@ nsresult nsContentUtils::ReportToConsoleByWindowID( NS_ENSURE_SUCCESS(rv, rv); if (!spec.IsEmpty()) { - rv = - errorObject->InitWithWindowID(aErrorText, - NS_ConvertUTF8toUTF16(spec), // file name - aSourceLine, aLineNumber, aColumnNumber, - aErrorFlags, aCategory, aInnerWindowID); + rv = errorObject->InitWithWindowID(aErrorText, + spec, // file name + aSourceLine, aLineNumber, aColumnNumber, + aErrorFlags, aCategory, aInnerWindowID); } else { rv = errorObject->InitWithSourceURI(aErrorText, aURI, aSourceLine, aLineNumber, aColumnNumber, aErrorFlags, diff --git a/dom/bindings/BindingUtils.cpp b/dom/bindings/BindingUtils.cpp index 1974b1785daaa..b05f2daf92e25 100644 --- a/dom/bindings/BindingUtils.cpp +++ b/dom/bindings/BindingUtils.cpp @@ -4003,7 +4003,7 @@ void DeprecationWarning(const GlobalObject& aGlobal, if (window && window->GetExtantDoc()) { window->GetExtantDoc()->WarnOnceAbout(aOperation); - nsAutoCString fileName; + nsAutoString fileName; Nullable lineNumber; Nullable columnNumber; uint32_t line = 0; @@ -4014,8 +4014,7 @@ void DeprecationWarning(const GlobalObject& aGlobal, columnNumber.SetValue(column); } - MaybeReportDeprecation(window, aOperation, - NS_ConvertUTF8toUTF16(fileName), lineNumber, + MaybeReportDeprecation(window, aOperation, fileName, lineNumber, columnNumber); } diff --git a/dom/media/webaudio/WebAudioUtils.cpp b/dom/media/webaudio/WebAudioUtils.cpp index 3107d0d64bf6c..4ededeb145285 100644 --- a/dom/media/webaudio/WebAudioUtils.cpp +++ b/dom/media/webaudio/WebAudioUtils.cpp @@ -110,7 +110,7 @@ void WebAudioUtils::LogToDeveloperConsole(uint64_t aWindowID, return; } - nsAutoCString spec; + nsAutoString spec; uint32_t aLineNumber, aColumnNumber; JSContext* cx = nsContentUtils::GetCurrentJSContext(); if (cx) { @@ -134,9 +134,9 @@ void WebAudioUtils::LogToDeveloperConsole(uint64_t aWindowID, return; } - errorObject->InitWithWindowID( - result, NS_ConvertUTF8toUTF16(spec), EmptyString(), aLineNumber, - aColumnNumber, nsIScriptError::warningFlag, "Web Audio", aWindowID); + errorObject->InitWithWindowID(result, spec, EmptyString(), aLineNumber, + aColumnNumber, nsIScriptError::warningFlag, + "Web Audio", aWindowID); console->LogMessage(errorObject); } diff --git a/dom/security/featurepolicy/FeaturePolicyUtils.cpp b/dom/security/featurepolicy/FeaturePolicyUtils.cpp index 20a0dfa147ec6..6b4e94f7a06e2 100644 --- a/dom/security/featurepolicy/FeaturePolicyUtils.cpp +++ b/dom/security/featurepolicy/FeaturePolicyUtils.cpp @@ -136,7 +136,7 @@ void FeaturePolicyUtils::ReportViolation(Document* aDocument, return; } - nsAutoCString fileName; + nsAutoString fileName; Nullable lineNumber; Nullable columnNumber; uint32_t line = 0; @@ -152,9 +152,9 @@ void FeaturePolicyUtils::ReportViolation(Document* aDocument, } RefPtr body = - new FeaturePolicyViolationReportBody( - window, aFeatureName, NS_ConvertUTF8toUTF16(fileName), lineNumber, - columnNumber, NS_LITERAL_STRING("enforce")); + new FeaturePolicyViolationReportBody(window, aFeatureName, fileName, + lineNumber, columnNumber, + NS_LITERAL_STRING("enforce")); ReportingUtils::Report(window, nsGkAtoms::featurePolicyViolation, NS_LITERAL_STRING("default"), diff --git a/dom/security/nsCSPContext.cpp b/dom/security/nsCSPContext.cpp index 33ff6887c20e5..0df8d69010be6 100644 --- a/dom/security/nsCSPContext.cpp +++ b/dom/security/nsCSPContext.cpp @@ -213,7 +213,7 @@ bool nsCSPContext::permitsInternal( if (!aIsPreload && aSendViolationReports) { uint32_t lineNumber = 0; uint32_t columnNumber = 0; - nsAutoCString spec; + nsAutoString spec; JSContext* cx = nsContentUtils::GetCurrentJSContext(); if (cx) { nsJSUtils::GetCallingLocation(cx, spec, &lineNumber, &columnNumber); @@ -229,10 +229,10 @@ bool nsCSPContext::permitsInternal( null */ violatedDirective, p, /* policy index */ EmptyString(), /* no observer subject */ - NS_ConvertUTF8toUTF16(spec), /* source file */ - EmptyString(), /* no script sample */ - lineNumber, /* line number */ - columnNumber); /* column number */ + spec, /* source file */ + EmptyString(), /* no script sample */ + lineNumber, /* line number */ + columnNumber); /* column number */ } } }