bug 949821 - use MOZ_UTF16 more and NS_LITERAL_STRING less r=froydnj

This commit is contained in:
Trevor Saunders 2013-12-12 20:50:01 -05:00
parent e3d76f3d34
commit d43c55ca0e
97 changed files with 284 additions and 284 deletions

View File

@ -3267,12 +3267,12 @@ KeyBinding::ToPlatformFormat(nsAString& aValue) const
return;
nsAutoString separator;
keyStringBundle->GetStringFromName(NS_LITERAL_STRING("MODIFIER_SEPARATOR").get(),
keyStringBundle->GetStringFromName(MOZ_UTF16("MODIFIER_SEPARATOR"),
getter_Copies(separator));
nsAutoString modifierName;
if (mModifierMask & kControl) {
keyStringBundle->GetStringFromName(NS_LITERAL_STRING("VK_CONTROL").get(),
keyStringBundle->GetStringFromName(MOZ_UTF16("VK_CONTROL"),
getter_Copies(modifierName));
aValue.Append(modifierName);
@ -3280,7 +3280,7 @@ KeyBinding::ToPlatformFormat(nsAString& aValue) const
}
if (mModifierMask & kAlt) {
keyStringBundle->GetStringFromName(NS_LITERAL_STRING("VK_ALT").get(),
keyStringBundle->GetStringFromName(MOZ_UTF16("VK_ALT"),
getter_Copies(modifierName));
aValue.Append(modifierName);
@ -3288,7 +3288,7 @@ KeyBinding::ToPlatformFormat(nsAString& aValue) const
}
if (mModifierMask & kShift) {
keyStringBundle->GetStringFromName(NS_LITERAL_STRING("VK_SHIFT").get(),
keyStringBundle->GetStringFromName(MOZ_UTF16("VK_SHIFT"),
getter_Copies(modifierName));
aValue.Append(modifierName);
@ -3296,7 +3296,7 @@ KeyBinding::ToPlatformFormat(nsAString& aValue) const
}
if (mModifierMask & kMeta) {
keyStringBundle->GetStringFromName(NS_LITERAL_STRING("VK_META").get(),
keyStringBundle->GetStringFromName(MOZ_UTF16("VK_META"),
getter_Copies(modifierName));
aValue.Append(modifierName);

View File

@ -82,7 +82,7 @@ ApplicationAccessible::Name(nsString& aName)
return eNameOK;
nsXPIDLString appName;
rv = bundle->GetStringFromName(NS_LITERAL_STRING("brandShortName").get(),
rv = bundle->GetStringFromName(MOZ_UTF16("brandShortName"),
getter_Copies(appName));
if (NS_FAILED(rv) || appName.IsEmpty()) {
NS_WARNING("brandShortName not found, using default app name");

View File

@ -285,7 +285,7 @@ nsGNOMEShellService::SetDefaultBrowser(bool aClaimAllTypes,
NS_ENSURE_SUCCESS(rv, rv);
nsString brandShortName;
brandBundle->GetStringFromName(NS_LITERAL_STRING("brandShortName").get(),
brandBundle->GetStringFromName(MOZ_UTF16("brandShortName"),
getter_Copies(brandShortName));
// use brandShortName as the application id.
@ -430,7 +430,7 @@ nsGNOMEShellService::SetDesktopBackground(nsIDOMElement* aElement,
rv = bundleService->CreateBundle(BRAND_PROPERTIES,
getter_AddRefs(brandBundle));
if (NS_SUCCEEDED(rv) && brandBundle) {
rv = brandBundle->GetStringFromName(NS_LITERAL_STRING("brandShortName").get(),
rv = brandBundle->GetStringFromName(MOZ_UTF16("brandShortName"),
getter_Copies(brandName));
NS_ENSURE_SUCCESS(rv, rv);
}

View File

@ -867,7 +867,7 @@ nsWindowsShellService::SetDesktopBackground(nsIDOMElement* aElement,
// e.g. "Desktop Background.bmp"
nsString fileLeafName;
rv = shellBundle->GetStringFromName
(NS_LITERAL_STRING("desktopBackgroundLeafNameWin").get(),
(MOZ_UTF16("desktopBackgroundLeafNameWin"),
getter_Copies(fileLeafName));
NS_ENSURE_SUCCESS(rv, rv);

View File

@ -1172,7 +1172,7 @@ nsScriptSecurityManager::CheckLoadURIWithPrincipal(nsIPrincipal* aPrincipal,
NS_ConvertASCIItoUTF16 ucsTargetScheme(targetScheme);
const PRUnichar* formatStrings[] = { ucsTargetScheme.get() };
rv = sStrBundle->
FormatStringFromName(NS_LITERAL_STRING("ProtocolFlagError").get(),
FormatStringFromName(MOZ_UTF16("ProtocolFlagError"),
formatStrings,
ArrayLength(formatStrings),
getter_Copies(message));

View File

@ -987,11 +987,11 @@ EventSource::ConsoleError()
if (mReadyState == CONNECTING && !mInterrupted) {
rv = PrintErrorOnConsole("chrome://global/locale/appstrings.properties",
NS_LITERAL_STRING("connectionFailure").get(),
MOZ_UTF16("connectionFailure"),
formatStrings, ArrayLength(formatStrings));
} else {
rv = PrintErrorOnConsole("chrome://global/locale/appstrings.properties",
NS_LITERAL_STRING("netInterrupt").get(),
MOZ_UTF16("netInterrupt"),
formatStrings, ArrayLength(formatStrings));
}
NS_ENSURE_SUCCESS(rv, rv);

View File

@ -176,11 +176,11 @@ WebSocket::ConsoleError()
if (mReadyState < WebSocket::OPEN) {
PrintErrorOnConsole("chrome://global/locale/appstrings.properties",
NS_LITERAL_STRING("connectionFailure").get(),
MOZ_UTF16("connectionFailure"),
formatStrings, ArrayLength(formatStrings));
} else {
PrintErrorOnConsole("chrome://global/locale/appstrings.properties",
NS_LITERAL_STRING("netInterrupt").get(),
MOZ_UTF16("netInterrupt"),
formatStrings, ArrayLength(formatStrings));
}
}

View File

@ -531,12 +531,12 @@ nsContentUtils::InitializeModifierStrings()
nsXPIDLString modifierSeparator;
if (bundle) {
//macs use symbols for each modifier key, so fetch each from the bundle, which also covers i18n
bundle->GetStringFromName(NS_LITERAL_STRING("VK_SHIFT").get(), getter_Copies(shiftModifier));
bundle->GetStringFromName(NS_LITERAL_STRING("VK_META").get(), getter_Copies(metaModifier));
bundle->GetStringFromName(NS_LITERAL_STRING("VK_WIN").get(), getter_Copies(osModifier));
bundle->GetStringFromName(NS_LITERAL_STRING("VK_ALT").get(), getter_Copies(altModifier));
bundle->GetStringFromName(NS_LITERAL_STRING("VK_CONTROL").get(), getter_Copies(controlModifier));
bundle->GetStringFromName(NS_LITERAL_STRING("MODIFIER_SEPARATOR").get(), getter_Copies(modifierSeparator));
bundle->GetStringFromName(MOZ_UTF16("VK_SHIFT"), getter_Copies(shiftModifier));
bundle->GetStringFromName(MOZ_UTF16("VK_META"), getter_Copies(metaModifier));
bundle->GetStringFromName(MOZ_UTF16("VK_WIN"), getter_Copies(osModifier));
bundle->GetStringFromName(MOZ_UTF16("VK_ALT"), getter_Copies(altModifier));
bundle->GetStringFromName(MOZ_UTF16("VK_CONTROL"), getter_Copies(controlModifier));
bundle->GetStringFromName(MOZ_UTF16("MODIFIER_SEPARATOR"), getter_Copies(modifierSeparator));
}
//if any of these don't exist, we get an empty string
sShiftText = new nsString(shiftModifier);
@ -6006,12 +6006,12 @@ nsContentUtils::PlatformToDOMLineBreaks(nsString &aString)
{
if (aString.FindChar(PRUnichar('\r')) != -1) {
// Windows linebreaks: Map CRLF to LF:
aString.ReplaceSubstring(NS_LITERAL_STRING("\r\n").get(),
NS_LITERAL_STRING("\n").get());
aString.ReplaceSubstring(MOZ_UTF16("\r\n"),
MOZ_UTF16("\n"));
// Mac linebreaks: Map any remaining CR to LF:
aString.ReplaceSubstring(NS_LITERAL_STRING("\r").get(),
NS_LITERAL_STRING("\n").get());
aString.ReplaceSubstring(MOZ_UTF16("\r"),
MOZ_UTF16("\n"));
}
}

View File

@ -570,7 +570,7 @@ nsPlainTextSerializer::DoOpenContainer(nsIAtom* aTag)
// importable, we use a TAB.
if (GetLastBool(mHasWrittenCellsForRow)) {
// Bypass |Write| so that the TAB isn't compressed away.
AddToLine(NS_LITERAL_STRING("\t").get(), 1);
AddToLine(MOZ_UTF16("\t"), 1);
mInWhitespace = true;
}
else if (mHasWrittenCellsForRow.IsEmpty()) {
@ -1173,7 +1173,7 @@ static bool
IsSpaceStuffable(const PRUnichar *s)
{
if (s[0] == '>' || s[0] == ' ' || s[0] == kNBSP ||
nsCRT::strncmp(s, NS_LITERAL_STRING("From ").get(), 5) == 0)
nsCRT::strncmp(s, MOZ_UTF16("From "), 5) == 0)
return true;
else
return false;

View File

@ -83,7 +83,7 @@ WebGLMemoryPressureObserver::Observe(nsISupports* aSubject,
ProcessPriorityManager::CurrentProcessIsForeground())
wantToLoseContext = false;
else if (!nsCRT::strcmp(aSomeData,
NS_LITERAL_STRING("heap-minimize").get()))
MOZ_UTF16("heap-minimize")))
wantToLoseContext = mContext->mLoseContextOnHeapMinimize;
if (wantToLoseContext)

View File

@ -7026,15 +7026,15 @@ HTMLInputElement::SetFilePickerFiltersFromAccept(nsIFilePicker* filePicker)
// First, check for image/audio/video filters...
if (token.EqualsLiteral("image/*")) {
filterMask = nsIFilePicker::filterImages;
filterBundle->GetStringFromName(NS_LITERAL_STRING("imageFilter").get(),
filterBundle->GetStringFromName(MOZ_UTF16("imageFilter"),
getter_Copies(extensionListStr));
} else if (token.EqualsLiteral("audio/*")) {
filterMask = nsIFilePicker::filterAudio;
filterBundle->GetStringFromName(NS_LITERAL_STRING("audioFilter").get(),
filterBundle->GetStringFromName(MOZ_UTF16("audioFilter"),
getter_Copies(extensionListStr));
} else if (token.EqualsLiteral("video/*")) {
filterMask = nsIFilePicker::filterVideo;
filterBundle->GetStringFromName(NS_LITERAL_STRING("videoFilter").get(),
filterBundle->GetStringFromName(MOZ_UTF16("videoFilter"),
getter_Copies(extensionListStr));
} else {
//... if no image/audio/video filter is found, check mime types filters

View File

@ -744,7 +744,7 @@ ImageDocument::UpdateTitleAndCharset()
ratioStr.AppendInt(NSToCoordFloor(GetRatio() * 100));
const PRUnichar* formatString[1] = { ratioStr.get() };
mStringBundle->FormatStringFromName(NS_LITERAL_STRING("ScaledImage").get(),
mStringBundle->FormatStringFromName(MOZ_UTF16("ScaledImage"),
formatString, 1,
getter_Copies(status));
}

View File

@ -165,7 +165,7 @@ PluginDocument::StartDocumentLoad(const char* aCommand,
nsCOMPtr<nsIDocShellTreeItem> dsti (do_QueryInterface(aContainer));
if (dsti) {
bool isMsgPane = false;
dsti->NameEquals(NS_LITERAL_STRING("messagepane").get(), &isMsgPane);
dsti->NameEquals(MOZ_UTF16("messagepane"), &isMsgPane);
if (isMsgPane) {
return NS_ERROR_FAILURE;
}

View File

@ -740,7 +740,7 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand,
NS_ASSERTION(NS_SUCCEEDED(rv) && bundle, "chrome://global/locale/browser.properties could not be loaded");
nsXPIDLString title;
if (bundle) {
bundle->GetStringFromName(NS_LITERAL_STRING("plainText.wordWrap").get(), getter_Copies(title));
bundle->GetStringFromName(MOZ_UTF16("plainText.wordWrap"), getter_Copies(title));
}
SetSelectedStyleSheetSet(title);
}

View File

@ -1074,8 +1074,8 @@ nsMathMLElement::SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
(aNameSpaceID == kNameSpaceID_None ||
aNameSpaceID == kNameSpaceID_XLink)) {
if (aNameSpaceID == kNameSpaceID_XLink) {
WarnDeprecated(NS_LITERAL_STRING("xlink:href").get(),
NS_LITERAL_STRING("href").get(), OwnerDoc());
WarnDeprecated(MOZ_UTF16("xlink:href"),
MOZ_UTF16("href"), OwnerDoc());
}
Link::ResetLinkState(!!aNotify, true);
}

View File

@ -24,7 +24,7 @@ SVGLength::GetValueAsString(nsAString &aValue) const
{
PRUnichar buf[24];
nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar),
NS_LITERAL_STRING("%g").get(),
MOZ_UTF16("%g"),
(double)mValue);
aValue.Assign(buf);

View File

@ -34,7 +34,7 @@ SVGNumberList::GetValueAsString(nsAString& aValue) const
// Would like to use aValue.AppendPrintf("%f", mNumbers[i]), but it's not
// possible to always avoid trailing zeros.
nsTextFormatter::snprintf(buf, ArrayLength(buf),
NS_LITERAL_STRING("%g").get(),
MOZ_UTF16("%g"),
double(mNumbers[i]));
// We ignore OOM, since it's not useful for us to return an error.
aValue.Append(buf);

View File

@ -36,7 +36,7 @@ SVGPathSegUtils::GetValueAsString(const float* aSeg, nsAString& aValue)
bool largeArcFlag = aSeg[4] != 0.0f;
bool sweepFlag = aSeg[5] != 0.0f;
nsTextFormatter::ssprintf(aValue,
NS_LITERAL_STRING("%c%g,%g %g %d,%d %g,%g").get(),
MOZ_UTF16("%c%g,%g %g %d,%d %g,%g"),
typeAsChar, aSeg[1], aSeg[2], aSeg[3],
largeArcFlag, sweepFlag, aSeg[6], aSeg[7]);
} else {
@ -47,30 +47,30 @@ SVGPathSegUtils::GetValueAsString(const float* aSeg, nsAString& aValue)
break;
case 1:
nsTextFormatter::ssprintf(aValue, NS_LITERAL_STRING("%c%g").get(),
nsTextFormatter::ssprintf(aValue, MOZ_UTF16("%c%g"),
typeAsChar, aSeg[1]);
break;
case 2:
nsTextFormatter::ssprintf(aValue, NS_LITERAL_STRING("%c%g,%g").get(),
nsTextFormatter::ssprintf(aValue, MOZ_UTF16("%c%g,%g"),
typeAsChar, aSeg[1], aSeg[2]);
break;
case 4:
nsTextFormatter::ssprintf(aValue, NS_LITERAL_STRING("%c%g,%g %g,%g").get(),
nsTextFormatter::ssprintf(aValue, MOZ_UTF16("%c%g,%g %g,%g"),
typeAsChar, aSeg[1], aSeg[2], aSeg[3], aSeg[4]);
break;
case 6:
nsTextFormatter::ssprintf(aValue,
NS_LITERAL_STRING("%c%g,%g %g,%g %g,%g").get(),
MOZ_UTF16("%c%g,%g %g,%g %g,%g"),
typeAsChar, aSeg[1], aSeg[2], aSeg[3], aSeg[4],
aSeg[5], aSeg[6]);
break;
default:
NS_ABORT_IF_FALSE(false, "Unknown segment type");
aValue = NS_LITERAL_STRING("<unknown-segment-type>").get();
aValue = MOZ_UTF16("<unknown-segment-type>");
return;
}
}

View File

@ -33,7 +33,7 @@ SVGPointList::GetValueAsString(nsAString& aValue) const
// Would like to use aValue.AppendPrintf("%f,%f", item.mX, item.mY),
// but it's not possible to always avoid trailing zeros.
nsTextFormatter::snprintf(buf, ArrayLength(buf),
NS_LITERAL_STRING("%g,%g").get(),
MOZ_UTF16("%g,%g"),
double(mItems[i].mX), double(mItems[i].mY));
// We ignore OOM, since it's not useful for us to return an error.
aValue.Append(buf);

View File

@ -84,7 +84,7 @@ GetValueString(nsAString &aValueAsString, float aValue, uint16_t aUnitType)
{
PRUnichar buf[24];
nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar),
NS_LITERAL_STRING("%g").get(),
MOZ_UTF16("%g"),
(double)aValue);
aValueAsString.Assign(buf);

View File

@ -112,7 +112,7 @@ GetValueString(nsAString &aValueAsString, float aValue, uint16_t aUnitType)
{
PRUnichar buf[24];
nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar),
NS_LITERAL_STRING("%g").get(),
MOZ_UTF16("%g"),
(double)aValue);
aValueAsString.Assign(buf);

View File

@ -25,41 +25,41 @@ nsSVGTransform::GetValueAsString(nsAString& aValue) const
// The spec say that if Y is not provided, it is assumed to be zero.
if (mMatrix.y0 != 0)
nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar),
NS_LITERAL_STRING("translate(%g, %g)").get(),
MOZ_UTF16("translate(%g, %g)"),
mMatrix.x0, mMatrix.y0);
else
nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar),
NS_LITERAL_STRING("translate(%g)").get(),
MOZ_UTF16("translate(%g)"),
mMatrix.x0);
break;
case SVG_TRANSFORM_ROTATE:
if (mOriginX != 0.0f || mOriginY != 0.0f)
nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar),
NS_LITERAL_STRING("rotate(%g, %g, %g)").get(),
MOZ_UTF16("rotate(%g, %g, %g)"),
mAngle, mOriginX, mOriginY);
else
nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar),
NS_LITERAL_STRING("rotate(%g)").get(), mAngle);
MOZ_UTF16("rotate(%g)"), mAngle);
break;
case SVG_TRANSFORM_SCALE:
if (mMatrix.xx != mMatrix.yy)
nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar),
NS_LITERAL_STRING("scale(%g, %g)").get(), mMatrix.xx, mMatrix.yy);
MOZ_UTF16("scale(%g, %g)"), mMatrix.xx, mMatrix.yy);
else
nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar),
NS_LITERAL_STRING("scale(%g)").get(), mMatrix.xx);
MOZ_UTF16("scale(%g)"), mMatrix.xx);
break;
case SVG_TRANSFORM_SKEWX:
nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar),
NS_LITERAL_STRING("skewX(%g)").get(), mAngle);
MOZ_UTF16("skewX(%g)"), mAngle);
break;
case SVG_TRANSFORM_SKEWY:
nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar),
NS_LITERAL_STRING("skewY(%g)").get(), mAngle);
MOZ_UTF16("skewY(%g)"), mAngle);
break;
case SVG_TRANSFORM_MATRIX:
nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar),
NS_LITERAL_STRING("matrix(%g, %g, %g, %g, %g, %g)").get(),
MOZ_UTF16("matrix(%g, %g, %g, %g, %g, %g)"),
mMatrix.xx, mMatrix.yx,
mMatrix.xy, mMatrix.yy,
mMatrix.x0, mMatrix.y0);

View File

@ -182,7 +182,7 @@ nsSVGViewBox::GetBaseValueString(nsAString& aValue) const
}
PRUnichar buf[200];
nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar),
NS_LITERAL_STRING("%g %g %g %g").get(),
MOZ_UTF16("%g %g %g %g"),
(double)mBaseVal.x, (double)mBaseVal.y,
(double)mBaseVal.width, (double)mBaseVal.height);
aValue.Assign(buf);

View File

@ -1389,8 +1389,8 @@ nsXMLContentSink::ReportError(const PRUnichar* aErrorText,
mContentStack.Clear();
mNotifyLevel = 0;
rv = HandleProcessingInstruction(NS_LITERAL_STRING("xml-stylesheet").get(),
NS_LITERAL_STRING("href=\"chrome://global/locale/intl.css\" type=\"text/css\"").get());
rv = HandleProcessingInstruction(MOZ_UTF16("xml-stylesheet"),
MOZ_UTF16("href=\"chrome://global/locale/intl.css\" type=\"text/css\""));
NS_ENSURE_SUCCESS(rv, rv);
const PRUnichar* noAtts[] = { 0, 0 };

View File

@ -1067,12 +1067,12 @@ txMozillaXSLTProcessor::reportError(nsresult aResult,
if (bundle) {
const PRUnichar* error[] = { errorText.get() };
if (mStylesheet) {
bundle->FormatStringFromName(NS_LITERAL_STRING("TransformError").get(),
bundle->FormatStringFromName(MOZ_UTF16("TransformError"),
error, 1,
getter_Copies(errorMessage));
}
else {
bundle->FormatStringFromName(NS_LITERAL_STRING("LoadingError").get(),
bundle->FormatStringFromName(MOZ_UTF16("LoadingError"),
error, 1,
getter_Copies(errorMessage));
}

View File

@ -436,7 +436,7 @@ bool nsDSURIContentListener::CheckFrameOptions(nsIRequest *request)
if (mDocShell) {
nsCOMPtr<nsIWebNavigation> webNav(do_QueryObject(mDocShell));
if (webNav) {
webNav->LoadURI(NS_LITERAL_STRING("about:blank").get(),
webNav->LoadURI(MOZ_UTF16("about:blank"),
0, nullptr, nullptr, nullptr);
}
}

View File

@ -11703,25 +11703,25 @@ nsDocShell::ConfirmRepost(bool * aRepost)
"Unable to set up repost prompter.");
nsXPIDLString brandName;
rv = brandBundle->GetStringFromName(NS_LITERAL_STRING("brandShortName").get(),
rv = brandBundle->GetStringFromName(MOZ_UTF16("brandShortName"),
getter_Copies(brandName));
nsXPIDLString msgString, button0Title;
if (NS_FAILED(rv)) { // No brand, use the generic version.
rv = appBundle->GetStringFromName(NS_LITERAL_STRING("confirmRepostPrompt").get(),
rv = appBundle->GetStringFromName(MOZ_UTF16("confirmRepostPrompt"),
getter_Copies(msgString));
}
else {
// Brand available - if the app has an override file with formatting, the app name will
// be included. Without an override, the prompt will look like the generic version.
const PRUnichar *formatStrings[] = { brandName.get() };
rv = appBundle->FormatStringFromName(NS_LITERAL_STRING("confirmRepostPrompt").get(),
rv = appBundle->FormatStringFromName(MOZ_UTF16("confirmRepostPrompt"),
formatStrings, ArrayLength(formatStrings),
getter_Copies(msgString));
}
if (NS_FAILED(rv)) return rv;
rv = appBundle->GetStringFromName(NS_LITERAL_STRING("resendButton.label").get(),
rv = appBundle->GetStringFromName(MOZ_UTF16("resendButton.label"),
getter_Copies(button0Title));
if (NS_FAILED(rv)) return rv;

View File

@ -8899,7 +8899,7 @@ nsGlobalWindow::Find(const nsAString& aString, bool aCaseSensitive,
nsCOMPtr<nsIDOMWindow> findDialog;
if (windowMediator) {
windowMediator->GetMostRecentWindow(NS_LITERAL_STRING("findInPage").get(),
windowMediator->GetMostRecentWindow(MOZ_UTF16("findInPage"),
getter_AddRefs(findDialog));
}

View File

@ -1158,7 +1158,7 @@ public:
MOZ_ASSERT(NS_IsMainThread());
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
obs->NotifyObservers(mFile, "file-watcher-notify", NS_LITERAL_STRING("modified").get());
obs->NotifyObservers(mFile, "file-watcher-notify", MOZ_UTF16("modified"));
return NS_OK;
}

View File

@ -382,7 +382,7 @@ PluginHangUIParent::GetHangUIOwnerWindowHandle(NativeWindowHandle& windowHandle)
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIDOMWindow> navWin;
rv = winMediator->GetMostRecentWindow(NS_LITERAL_STRING("navigator:browser").get(),
rv = winMediator->GetMostRecentWindow(MOZ_UTF16("navigator:browser"),
getter_AddRefs(navWin));
NS_ENSURE_SUCCESS(rv, rv);
if (!navWin) {

View File

@ -871,7 +871,7 @@ nsGeolocationService::StartDevice(nsIPrincipal *aPrincipal)
obs->NotifyObservers(mProvider,
"geolocation-device-events",
NS_LITERAL_STRING("starting").get());
MOZ_UTF16("starting"));
return NS_OK;
}
@ -951,7 +951,7 @@ nsGeolocationService::StopDevice()
mProvider->Shutdown();
obs->NotifyObservers(mProvider,
"geolocation-device-events",
NS_LITERAL_STRING("shutdown").get());
MOZ_UTF16("shutdown"));
}
StaticRefPtr<nsGeolocationService> nsGeolocationService::sService;

View File

@ -48,10 +48,10 @@ using namespace mozilla::dom::bluetooth;
#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "AudioManager" , ## args)
#define HEADPHONES_STATUS_HEADSET NS_LITERAL_STRING("headset").get()
#define HEADPHONES_STATUS_HEADPHONE NS_LITERAL_STRING("headphone").get()
#define HEADPHONES_STATUS_OFF NS_LITERAL_STRING("off").get()
#define HEADPHONES_STATUS_UNKNOWN NS_LITERAL_STRING("unknown").get()
#define HEADPHONES_STATUS_HEADSET MOZ_UTF16("headset")
#define HEADPHONES_STATUS_HEADPHONE MOZ_UTF16("headphone")
#define HEADPHONES_STATUS_OFF MOZ_UTF16("off")
#define HEADPHONES_STATUS_UNKNOWN MOZ_UTF16("unknown")
#define HEADPHONES_STATUS_CHANGED "headphones-status-changed"
#define MOZ_SETTINGS_CHANGE_ID "mozsettings-changed"

View File

@ -1022,7 +1022,7 @@ nsEditingSession::TimerCallback(nsITimer* aTimer, void* aClosure)
{
nsCOMPtr<nsIWebNavigation> webNav(do_QueryInterface(docShell));
if (webNav)
webNav->LoadURI(NS_LITERAL_STRING("about:blank").get(),
webNav->LoadURI(MOZ_UTF16("about:blank"),
0, nullptr, nullptr, nullptr);
}
}

View File

@ -1212,12 +1212,12 @@ nsHTMLEditor::ReplaceHeadContentsWithHTML(const nsAString& aSourceToInsert)
nsAutoString inputString (aSourceToInsert); // hope this does copy-on-write
// Windows linebreaks: Map CRLF to LF:
inputString.ReplaceSubstring(NS_LITERAL_STRING("\r\n").get(),
NS_LITERAL_STRING("\n").get());
inputString.ReplaceSubstring(MOZ_UTF16("\r\n"),
MOZ_UTF16("\n"));
// Mac linebreaks: Map any remaining CR to LF:
inputString.ReplaceSubstring(NS_LITERAL_STRING("\r").get(),
NS_LITERAL_STRING("\n").get());
inputString.ReplaceSubstring(MOZ_UTF16("\r"),
MOZ_UTF16("\n"));
nsAutoEditBatch beginBatching(this);

View File

@ -103,7 +103,7 @@ nsCommandManager::CommandStatusChanged(const char * aCommandName)
// should we get the command state to pass here? This might be expensive.
observer->Observe(NS_ISUPPORTS_CAST(nsICommandManager*, this),
aCommandName,
NS_LITERAL_STRING("command_status_changed").get());
MOZ_UTF16("command_status_changed"));
}
}

View File

@ -767,7 +767,7 @@ nsPermissionManager::AddInternal(nsIPrincipal* aPrincipal,
aPermission,
aExpireType,
aExpireTime,
NS_LITERAL_STRING("added").get());
MOZ_UTF16("added"));
}
break;
@ -793,7 +793,7 @@ nsPermissionManager::AddInternal(nsIPrincipal* aPrincipal,
oldPermissionEntry.mPermission,
oldPermissionEntry.mExpireType,
oldPermissionEntry.mExpireTime,
NS_LITERAL_STRING("deleted").get());
MOZ_UTF16("deleted"));
}
// If there are no more permissions stored for that entry, clear it.
@ -840,7 +840,7 @@ nsPermissionManager::AddInternal(nsIPrincipal* aPrincipal,
aPermission,
aExpireType,
aExpireTime,
NS_LITERAL_STRING("changed").get());
MOZ_UTF16("changed"));
}
break;
@ -916,7 +916,7 @@ nsPermissionManager::RemoveAllInternal(bool aNotifyObservers)
// on-disk database to notify observers.
RemoveAllFromMemory();
if (aNotifyObservers) {
NotifyObservers(nullptr, NS_LITERAL_STRING("cleared").get());
NotifyObservers(nullptr, MOZ_UTF16("cleared"));
}
// clear the db
@ -1256,7 +1256,7 @@ NS_IMETHODIMP nsPermissionManager::Observe(nsISupports *aSubject, const char *aT
// The profile is about to change,
// or is going away because the application is shutting down.
mIsShuttingDown = true;
if (!nsCRT::strcmp(someData, NS_LITERAL_STRING("shutdown-cleanse").get())) {
if (!nsCRT::strcmp(someData, MOZ_UTF16("shutdown-cleanse"))) {
// Clear the permissions file and close the db asynchronously
RemoveAllInternal(false);
} else {
@ -1387,7 +1387,7 @@ nsPermissionManager::RemoveExpiredPermissionsForAppEnumerator(
oldPermissionEntry.mPermission,
oldPermissionEntry.mExpireType,
oldPermissionEntry.mExpireTime,
NS_LITERAL_STRING("deleted").get());
MOZ_UTF16("deleted"));
--i;
continue;
}
@ -1403,7 +1403,7 @@ nsPermissionManager::RemoveExpiredPermissionsForAppEnumerator(
permEntry.mPermission,
permEntry.mExpireType,
permEntry.mExpireTime,
NS_LITERAL_STRING("changed").get());
MOZ_UTF16("changed"));
}
return PL_DHASH_NEXT;

View File

@ -827,17 +827,17 @@ mount_operation_ask_password (GMountOperation *mount_op,
if (flags & G_ASK_PASSWORD_NEED_USERNAME) {
if (!realm.IsEmpty()) {
const PRUnichar *strings[] = { realm.get(), dispHost.get() };
bundle->FormatStringFromName(NS_LITERAL_STRING("EnterLoginForRealm").get(),
bundle->FormatStringFromName(MOZ_UTF16("EnterLoginForRealm"),
strings, 2, getter_Copies(nsmessage));
} else {
const PRUnichar *strings[] = { dispHost.get() };
bundle->FormatStringFromName(NS_LITERAL_STRING("EnterUserPasswordFor").get(),
bundle->FormatStringFromName(MOZ_UTF16("EnterUserPasswordFor"),
strings, 1, getter_Copies(nsmessage));
}
} else {
NS_ConvertUTF8toUTF16 userName(default_user);
const PRUnichar *strings[] = { userName.get(), dispHost.get() };
bundle->FormatStringFromName(NS_LITERAL_STRING("EnterPasswordFor").get(),
bundle->FormatStringFromName(MOZ_UTF16("EnterPasswordFor"),
strings, 2, getter_Copies(nsmessage));
}
} else {

View File

@ -222,13 +222,13 @@ ProxiedAuthCallback(gconstpointer in,
if (!realm.IsEmpty())
{
const PRUnichar *strings[] = { realm.get(), dispHost.get() };
bundle->FormatStringFromName(NS_LITERAL_STRING("EnterUserPasswordForRealm").get(),
bundle->FormatStringFromName(MOZ_UTF16("EnterUserPasswordForRealm"),
strings, 2, getter_Copies(message));
}
else
{
const PRUnichar *strings[] = { dispHost.get() };
bundle->FormatStringFromName(NS_LITERAL_STRING("EnterUserPasswordFor").get(),
bundle->FormatStringFromName(MOZ_UTF16("EnterUserPasswordFor"),
strings, 1, getter_Copies(message));
}
if (message.IsEmpty())

View File

@ -502,11 +502,11 @@ nsresult nsAutoConfig::PromptForEMailAddress(nsACString &emailAddress)
NS_ENSURE_SUCCESS(rv, rv);
nsXPIDLString title;
rv = bundle->GetStringFromName(NS_LITERAL_STRING("emailPromptTitle").get(), getter_Copies(title));
rv = bundle->GetStringFromName(MOZ_UTF16("emailPromptTitle"), getter_Copies(title));
NS_ENSURE_SUCCESS(rv, rv);
nsXPIDLString err;
rv = bundle->GetStringFromName(NS_LITERAL_STRING("emailPromptMsg").get(), getter_Copies(err));
rv = bundle->GetStringFromName(MOZ_UTF16("emailPromptMsg"), getter_Copies(err));
NS_ENSURE_SUCCESS(rv, rv);
bool check = false;
nsXPIDLString emailResult;

View File

@ -59,12 +59,12 @@ static void DisplayError(void)
return;
nsXPIDLString title;
rv = bundle->GetStringFromName(NS_LITERAL_STRING("readConfigTitle").get(), getter_Copies(title));
rv = bundle->GetStringFromName(MOZ_UTF16("readConfigTitle"), getter_Copies(title));
if (NS_FAILED(rv))
return;
nsXPIDLString err;
rv = bundle->GetStringFromName(NS_LITERAL_STRING("readConfigMsg").get(), getter_Copies(err));
rv = bundle->GetStringFromName(MOZ_UTF16("readConfigMsg"), getter_Copies(err));
if (NS_FAILED(rv))
return;

View File

@ -143,7 +143,7 @@ SRGBOverrideObserver::Observe(nsISupports *aSubject,
const PRUnichar *someData)
{
NS_ASSERTION(NS_strcmp(someData,
NS_LITERAL_STRING("gfx.color_mangement.force_srgb").get()),
MOZ_UTF16("gfx.color_mangement.force_srgb")),
"Restarting CMS on wrong pref!");
ShutdownCMS();
return NS_OK;

View File

@ -320,7 +320,7 @@ nsIconChannel::InitWithGnome(nsIMozIconURI *aIconURI)
nsAutoString appName;
if (bundle) {
bundle->GetStringFromName(NS_LITERAL_STRING("brandShortName").get(),
bundle->GetStringFromName(MOZ_UTF16("brandShortName"),
getter_Copies(appName));
} else {
NS_WARNING("brand.properties not present, using default application name");

View File

@ -111,7 +111,7 @@ bool nsCharsetConverterManager::IsInternal(const nsACString& aCharset)
nsAutoString str;
// fully qualify to possibly avoid vtable call
nsresult rv = GetCharsetDataImpl(PromiseFlatCString(aCharset).get(),
NS_LITERAL_STRING(".isInternal").get(),
MOZ_UTF16(".isInternal"),
str);
return NS_SUCCEEDED(rv);
@ -345,7 +345,7 @@ nsCharsetConverterManager::GetCharsetLangGroupRaw(const char * aCharset,
nsAutoString langGroup;
// fully qualify to possibly avoid vtable call
nsresult rv = nsCharsetConverterManager::GetCharsetData(
aCharset, NS_LITERAL_STRING(".LangGroup").get(), langGroup);
aCharset, MOZ_UTF16(".LangGroup"), langGroup);
if (NS_SUCCEEDED(rv)) {
ToLowerCase(langGroup); // use lowercase for all language atoms

View File

@ -43,7 +43,7 @@ nsEntityConverter::LoadVersionPropertyFile()
nsAutoString key;
nsXPIDLString value;
rv = entities->GetStringFromName(NS_LITERAL_STRING("length").get(),
rv = entities->GetStringFromName(MOZ_UTF16("length"),
getter_Copies(value));
NS_ASSERTION(NS_SUCCEEDED(rv),"nsEntityConverter: malformed entity table\n");
if (NS_FAILED(rv)) return rv;

View File

@ -2751,8 +2751,8 @@ static bool IsChineseOrJapanese(nsIFrame* aFrame)
return false;
}
const PRUnichar *lang = language->GetUTF16String();
return (!nsCRT::strncmp(lang, NS_LITERAL_STRING("ja").get(), 2) ||
!nsCRT::strncmp(lang, NS_LITERAL_STRING("zh").get(), 2)) &&
return (!nsCRT::strncmp(lang, MOZ_UTF16("ja"), 2) ||
!nsCRT::strncmp(lang, MOZ_UTF16("zh"), 2)) &&
(language->GetLength() == 2 || lang[2] == '-');
}

View File

@ -56,7 +56,7 @@ nsPrintData::nsPrintData(ePrintDataType aType) :
if (svc) {
svc->CreateBundle( "chrome://branding/locale/brand.properties", getter_AddRefs( brandBundle ) );
if (brandBundle) {
brandBundle->GetStringFromName(NS_LITERAL_STRING("brandShortName").get(), &mBrandName );
brandBundle->GetStringFromName(MOZ_UTF16("brandShortName"), &mBrandName );
}
}

View File

@ -327,7 +327,7 @@ ErrorReporter::ReportUnexpectedEOF(const char *aMessage)
const PRUnichar *params[1] = { innerStr.get() };
nsAutoString str;
sStringBundle->FormatStringFromName(NS_LITERAL_STRING("PEUnexpEOF2").get(),
sStringBundle->FormatStringFromName(MOZ_UTF16("PEUnexpEOF2"),
params, ArrayLength(params),
getter_Copies(str));
AddToError(str);
@ -344,7 +344,7 @@ ErrorReporter::ReportUnexpectedEOF(PRUnichar aExpected)
const PRUnichar *params[1] = { expectedStr };
nsAutoString str;
sStringBundle->FormatStringFromName(NS_LITERAL_STRING("PEUnexpEOF2").get(),
sStringBundle->FormatStringFromName(MOZ_UTF16("PEUnexpEOF2"),
params, ArrayLength(params),
getter_Copies(str));
AddToError(str);

View File

@ -363,7 +363,7 @@ nsTreeBodyFrame::EnsureView()
mTreeBoxObject->GetView(getter_AddRefs(treeView));
if (treeView && weakFrame.IsAlive()) {
nsXPIDLString rowStr;
box->GetProperty(NS_LITERAL_STRING("topRow").get(),
box->GetProperty(MOZ_UTF16("topRow"),
getter_Copies(rowStr));
nsAutoString rowStr2(rowStr);
nsresult error;
@ -380,7 +380,7 @@ nsTreeBodyFrame::EnsureView()
// Clear out the property info for the top row, but we always keep the
// view current.
box->RemoveProperty(NS_LITERAL_STRING("topRow").get());
box->RemoveProperty(MOZ_UTF16("topRow"));
}
}
}

View File

@ -550,7 +550,7 @@ Preferences::Observe(nsISupports *aSubject, const char *aTopic,
nsresult rv = NS_OK;
if (!nsCRT::strcmp(aTopic, "profile-before-change")) {
if (!nsCRT::strcmp(someData, NS_LITERAL_STRING("shutdown-cleanse").get())) {
if (!nsCRT::strcmp(someData, MOZ_UTF16("shutdown-cleanse"))) {
if (mCurrentFile) {
mCurrentFile->Remove(false);
mCurrentFile = nullptr;

View File

@ -683,8 +683,8 @@ nsIOService::SetOffline(bool offline)
if (observerService) {
(void)observerService->NotifyObservers(nullptr,
NS_IPC_IOSERVICE_SET_OFFLINE_TOPIC, offline ?
NS_LITERAL_STRING("true").get() :
NS_LITERAL_STRING("false").get());
MOZ_UTF16("true") :
MOZ_UTF16("false"));
}
}

View File

@ -1563,7 +1563,7 @@ nsCookieService::Observe(nsISupports *aSubject,
// The profile is about to change,
// or is going away because the application is shutting down.
if (mDBState && mDBState->dbConn &&
!nsCRT::strcmp(aData, NS_LITERAL_STRING("shutdown-cleanse").get())) {
!nsCRT::strcmp(aData, MOZ_UTF16("shutdown-cleanse"))) {
// Clear the cookie db if we're in the default DBState.
RemoveAll();
}
@ -1656,7 +1656,7 @@ nsCookieService::SetCookieString(nsIURI *aHostURI,
do_GetService("@mozilla.org/consoleservice;1");
if (aConsoleService) {
aConsoleService->LogStringMessage(
NS_LITERAL_STRING("Non-null prompt ignored by nsCookieService.").get());
MOZ_UTF16("Non-null prompt ignored by nsCookieService."));
}
}
return SetCookieStringCommon(aHostURI, aCookieHeader, nullptr, aChannel,
@ -1679,7 +1679,7 @@ nsCookieService::SetCookieStringFromHttp(nsIURI *aHostURI,
do_GetService("@mozilla.org/consoleservice;1");
if (aConsoleService) {
aConsoleService->LogStringMessage(
NS_LITERAL_STRING("Non-null prompt ignored by nsCookieService.").get());
MOZ_UTF16("Non-null prompt ignored by nsCookieService."));
}
}
return SetCookieStringCommon(aHostURI, aCookieHeader, aServerTime, aChannel,
@ -1865,7 +1865,7 @@ nsCookieService::NotifyThirdParty(nsIURI *aHostURI, bool aIsAccepted, nsIChannel
// This can fail for a number of reasons, in which kind we fallback to "?"
mObserverService->NotifyObservers(aHostURI,
topic,
NS_LITERAL_STRING("?").get());
MOZ_UTF16("?"));
}
// notify observers that the cookie list changed. there are five possible
@ -1964,7 +1964,7 @@ nsCookieService::RemoveAll()
}
}
NotifyChanged(nullptr, NS_LITERAL_STRING("cleared").get());
NotifyChanged(nullptr, MOZ_UTF16("cleared"));
return NS_OK;
}
@ -2090,7 +2090,7 @@ nsCookieService::Remove(const nsACString& aHost, uint32_t aAppId,
if (cookie) {
// Everything's done. Notify observers.
NotifyChanged(cookie, NS_LITERAL_STRING("deleted").get());
NotifyChanged(cookie, MOZ_UTF16("deleted"));
}
return NS_OK;
@ -3024,7 +3024,7 @@ nsCookieService::AddInternal(const nsCookieKey &aKey,
if (aCookie->Expiry() <= currentTime) {
COOKIE_LOGFAILURE(SET_COOKIE, aHostURI, aCookieHeader,
"previously stored cookie was deleted");
NotifyChanged(oldCookie, NS_LITERAL_STRING("deleted").get());
NotifyChanged(oldCookie, MOZ_UTF16("deleted"));
return;
}
@ -3075,11 +3075,11 @@ nsCookieService::AddInternal(const nsCookieKey &aKey,
// Now that list mutations are complete, notify observers. We do it here
// because observers may themselves attempt to mutate the list.
if (purgedList) {
NotifyChanged(purgedList, NS_LITERAL_STRING("batch-deleted").get());
NotifyChanged(purgedList, MOZ_UTF16("batch-deleted"));
}
NotifyChanged(aCookie, foundCookie ? NS_LITERAL_STRING("changed").get()
: NS_LITERAL_STRING("added").get());
NotifyChanged(aCookie, foundCookie ? MOZ_UTF16("changed")
: MOZ_UTF16("added"));
}
/******************************************************************************

View File

@ -1485,7 +1485,7 @@ nsHttpChannel::PromptTempRedirect()
if (NS_FAILED(rv)) return rv;
nsXPIDLString messageString;
rv = stringBundle->GetStringFromName(NS_LITERAL_STRING("RepostFormData").get(), getter_Copies(messageString));
rv = stringBundle->GetStringFromName(MOZ_UTF16("RepostFormData"), getter_Copies(messageString));
// GetStringFromName can return NS_OK and nullptr messageString.
if (NS_SUCCEEDED(rv) && messageString) {
bool repost = false;

View File

@ -113,22 +113,22 @@ mozTXTToHTMLConv::UnescapeStr(const PRUnichar * aInString, int32_t aStartPos, in
if (aInString[i] == '&')
{
subString = &aInString[i];
if (!nsCRT::strncmp(subString, NS_LITERAL_STRING("&lt;").get(), MinInt(4, aLength - remainingChars)))
if (!nsCRT::strncmp(subString, MOZ_UTF16("&lt;"), MinInt(4, aLength - remainingChars)))
{
aOutString.Append(PRUnichar('<'));
i += 4;
}
else if (!nsCRT::strncmp(subString, NS_LITERAL_STRING("&gt;").get(), MinInt(4, aLength - remainingChars)))
else if (!nsCRT::strncmp(subString, MOZ_UTF16("&gt;"), MinInt(4, aLength - remainingChars)))
{
aOutString.Append(PRUnichar('>'));
i += 4;
}
else if (!nsCRT::strncmp(subString, NS_LITERAL_STRING("&amp;").get(), MinInt(5, aLength - remainingChars)))
else if (!nsCRT::strncmp(subString, MOZ_UTF16("&amp;"), MinInt(5, aLength - remainingChars)))
{
aOutString.Append(PRUnichar('&'));
i += 5;
}
else if (!nsCRT::strncmp(subString, NS_LITERAL_STRING("&quot;").get(), MinInt(6, aLength - remainingChars)))
else if (!nsCRT::strncmp(subString, MOZ_UTF16("&quot;"), MinInt(6, aLength - remainingChars)))
{
aOutString.Append(PRUnichar('"'));
i += 6;
@ -169,12 +169,12 @@ mozTXTToHTMLConv::CompleteAbbreviatedURL(const PRUnichar * aInString, int32_t aI
else if (aInString[pos] == '.')
{
if (ItMatchesDelimited(aInString, aInLength,
NS_LITERAL_STRING("www.").get(), 4, LT_IGNORE, LT_IGNORE))
MOZ_UTF16("www."), 4, LT_IGNORE, LT_IGNORE))
{
aOutString.AssignLiteral("http://");
aOutString += aInString;
}
else if (ItMatchesDelimited(aInString,aInLength, NS_LITERAL_STRING("ftp.").get(), 4, LT_IGNORE, LT_IGNORE))
else if (ItMatchesDelimited(aInString,aInLength, MOZ_UTF16("ftp."), 4, LT_IGNORE, LT_IGNORE))
{
aOutString.AssignLiteral("ftp://");
aOutString += aInString;
@ -191,7 +191,7 @@ mozTXTToHTMLConv::FindURLStart(const PRUnichar * aInString, int32_t aInLength,
{ // no breaks, because end of blocks is never reached
case RFC1738:
{
if (!nsCRT::strncmp(&aInString[MaxInt(pos - 4, 0)], NS_LITERAL_STRING("<URL:").get(), 5))
if (!nsCRT::strncmp(&aInString[MaxInt(pos - 4, 0)], MOZ_UTF16("<URL:"), 5))
{
start = pos + 1;
return true;
@ -202,7 +202,7 @@ mozTXTToHTMLConv::FindURLStart(const PRUnichar * aInString, int32_t aInLength,
case RFC2396E:
{
nsString temp(aInString, aInLength);
int32_t i = pos <= 0 ? kNotFound : temp.RFindCharInSet(NS_LITERAL_STRING("<>\"").get(), pos - 1);
int32_t i = pos <= 0 ? kNotFound : temp.RFindCharInSet(MOZ_UTF16("<>\""), pos - 1);
if (i != kNotFound && (temp[uint32_t(i)] == '<' ||
temp[uint32_t(i)] == '"'))
{
@ -281,7 +281,7 @@ mozTXTToHTMLConv::FindURLEnd(const PRUnichar * aInString, int32_t aInStringLengt
{
nsString temp(aInString, aInStringLength);
int32_t i = temp.FindCharInSet(NS_LITERAL_STRING("<>\"").get(), pos + 1);
int32_t i = temp.FindCharInSet(MOZ_UTF16("<>\""), pos + 1);
if (i != kNotFound && temp[uint32_t(i--)] ==
(check == RFC1738 || temp[start - 1] == '<' ? '>' : '"'))
{
@ -919,7 +919,7 @@ mozTXTToHTMLConv::GlyphHit(const PRUnichar * aInString, int32_t aInLength, bool
if (text0 == '+' || text1 == '+')
{
if (ItMatchesDelimited(aInString, aInLength,
NS_LITERAL_STRING(" +/-").get(), 4,
MOZ_UTF16(" +/-"), 4,
LT_IGNORE, LT_IGNORE))
{
aOutputString.AppendLiteral(" &plusmn;");
@ -927,7 +927,7 @@ mozTXTToHTMLConv::GlyphHit(const PRUnichar * aInString, int32_t aInLength, bool
return true;
}
if (col0 && ItMatchesDelimited(aInString, aInLength,
NS_LITERAL_STRING("+/-").get(), 3,
MOZ_UTF16("+/-"), 3,
LT_IGNORE, LT_IGNORE))
{
aOutputString.AppendLiteral("&plusmn;");
@ -1121,7 +1121,7 @@ mozTXTToHTMLConv::ScanTXT(const PRUnichar * aInString, int32_t aInStringLength,
{
case '*':
if (StructPhraseHit(newOffset, newLength, i == 0,
NS_LITERAL_STRING("*").get(), 1,
MOZ_UTF16("*"), 1,
"b", "class=\"moz-txt-star\"",
aOutString, structPhrase_strong))
{
@ -1131,7 +1131,7 @@ mozTXTToHTMLConv::ScanTXT(const PRUnichar * aInString, int32_t aInStringLength,
break;
case '/':
if (StructPhraseHit(newOffset, newLength, i == 0,
NS_LITERAL_STRING("/").get(), 1,
MOZ_UTF16("/"), 1,
"i", "class=\"moz-txt-slash\"",
aOutString, structPhrase_italic))
{
@ -1141,7 +1141,7 @@ mozTXTToHTMLConv::ScanTXT(const PRUnichar * aInString, int32_t aInStringLength,
break;
case '_':
if (StructPhraseHit(newOffset, newLength, i == 0,
NS_LITERAL_STRING("_").get(), 1,
MOZ_UTF16("_"), 1,
"span" /* <u> is deprecated */,
"class=\"moz-txt-underscore\"",
aOutString, structPhrase_underline))
@ -1152,7 +1152,7 @@ mozTXTToHTMLConv::ScanTXT(const PRUnichar * aInString, int32_t aInStringLength,
break;
case '|':
if (StructPhraseHit(newOffset, newLength, i == 0,
NS_LITERAL_STRING("|").get(), 1,
MOZ_UTF16("|"), 1,
"code", "class=\"moz-txt-verticalline\"",
aOutString, structPhrase_code))
{

View File

@ -537,7 +537,7 @@ nsIndexedToHTML::DoOnStartRequest(nsIRequest* request, nsISupports *aContext,
htmlEscSpec.get()
};
rv = mBundle->FormatStringFromName(NS_LITERAL_STRING("DirTitle").get(),
rv = mBundle->FormatStringFromName(MOZ_UTF16("DirTitle"),
formatTitle,
sizeof(formatTitle)/sizeof(PRUnichar*),
getter_Copies(title));
@ -594,7 +594,7 @@ nsIndexedToHTML::DoOnStartRequest(nsIRequest* request, nsISupports *aContext,
htmlEscSpec.get()
};
rv = mBundle->FormatStringFromName(NS_LITERAL_STRING("DirTitle").get(),
rv = mBundle->FormatStringFromName(MOZ_UTF16("DirTitle"),
formatHeading,
sizeof(formatHeading)/sizeof(PRUnichar*),
getter_Copies(title));
@ -605,7 +605,7 @@ nsIndexedToHTML::DoOnStartRequest(nsIRequest* request, nsISupports *aContext,
if (!parentStr.IsEmpty()) {
nsXPIDLString parentText;
rv = mBundle->GetStringFromName(NS_LITERAL_STRING("DirGoUp").get(),
rv = mBundle->GetStringFromName(MOZ_UTF16("DirGoUp"),
getter_Copies(parentText));
if (NS_FAILED(rv)) return rv;
@ -622,7 +622,7 @@ nsIndexedToHTML::DoOnStartRequest(nsIRequest* request, nsISupports *aContext,
if (isSchemeFile) {
nsXPIDLString showHiddenText;
rv = mBundle->GetStringFromName(NS_LITERAL_STRING("ShowHidden").get(),
rv = mBundle->GetStringFromName(MOZ_UTF16("ShowHidden"),
getter_Copies(showHiddenText));
if (NS_FAILED(rv)) return rv;
@ -639,21 +639,21 @@ nsIndexedToHTML::DoOnStartRequest(nsIRequest* request, nsISupports *aContext,
" <tr>\n"
" <th>");
rv = mBundle->GetStringFromName(NS_LITERAL_STRING("DirColName").get(),
rv = mBundle->GetStringFromName(MOZ_UTF16("DirColName"),
getter_Copies(columnText));
if (NS_FAILED(rv)) return rv;
AppendNonAsciiToNCR(columnText, buffer);
buffer.AppendLiteral("</th>\n"
" <th>");
rv = mBundle->GetStringFromName(NS_LITERAL_STRING("DirColSize").get(),
rv = mBundle->GetStringFromName(MOZ_UTF16("DirColSize"),
getter_Copies(columnText));
if (NS_FAILED(rv)) return rv;
AppendNonAsciiToNCR(columnText, buffer);
buffer.AppendLiteral("</th>\n"
" <th colspan=\"2\">");
rv = mBundle->GetStringFromName(NS_LITERAL_STRING("DirColMTime").get(),
rv = mBundle->GetStringFromName(MOZ_UTF16("DirColMTime"),
getter_Copies(columnText));
if (NS_FAILED(rv)) return rv;
AppendNonAsciiToNCR(columnText, buffer);
@ -937,7 +937,7 @@ nsIndexedToHTML::OnIndexAvailable(nsIRequest *aRequest,
pushBuffer.AppendLiteral("?size=16\" alt=\"");
nsXPIDLString altText;
rv = mBundle->GetStringFromName(NS_LITERAL_STRING("DirFileLabel").get(),
rv = mBundle->GetStringFromName(MOZ_UTF16("DirFileLabel"),
getter_Copies(altText));
if (NS_FAILED(rv)) return rv;
AppendNonAsciiToNCR(altText, pushBuffer);

View File

@ -10,7 +10,7 @@
#include "nsIChannel.h"
#include <algorithm>
#define TOKEN_DELIMITERS NS_LITERAL_STRING("\t\r\n ").get()
#define TOKEN_DELIMITERS MOZ_UTF16("\t\r\n ")
// nsISupports methods
NS_IMPL_ISUPPORTS4(nsTXTToHTMLConv,

View File

@ -31,7 +31,7 @@ nsHtml5PlainTextUtils::NewLinkAttributes()
NS_ASSERTION(NS_SUCCEEDED(rv) && bundle, "chrome://global/locale/browser.properties could not be loaded");
nsXPIDLString title;
if (bundle) {
bundle->GetStringFromName(NS_LITERAL_STRING("plainText.wordWrap").get(), getter_Copies(title));
bundle->GetStringFromName(MOZ_UTF16("plainText.wordWrap"), getter_Copies(title));
}
nsString* titleCopy = new nsString(title);

View File

@ -338,7 +338,7 @@ RDFContainerUtilsImpl::RDFContainerUtilsImpl()
&kRDF_Seq);
gRDFService->GetResource(NS_LITERAL_CSTRING(RDF_NAMESPACE_URI "Alt"),
&kRDF_Alt);
gRDFService->GetLiteral(NS_LITERAL_STRING("1").get(), &kOne);
gRDFService->GetLiteral(MOZ_UTF16("1"), &kOne);
}
}
}

View File

@ -1391,7 +1391,7 @@ RDFContentSinkImpl::ReinitContainer(nsIRDFResource* aContainerType, nsIRDFResour
nsresult rv;
nsCOMPtr<nsIRDFLiteral> one;
rv = gRDFService->GetLiteral(NS_LITERAL_STRING("1").get(), getter_AddRefs(one));
rv = gRDFService->GetLiteral(MOZ_UTF16("1"), getter_AddRefs(one));
if (NS_FAILED(rv)) return rv;
// Re-initialize the 'nextval' property

View File

@ -297,7 +297,7 @@ FileSystemDataSource::GetTarget(nsIRDFResource *source,
if (property == mNC_pulse)
{
nsIRDFLiteral *pulseLiteral;
mRDFService->GetLiteral(NS_LITERAL_STRING("12").get(), &pulseLiteral);
mRDFService->GetLiteral(MOZ_UTF16("12"), &pulseLiteral);
*target = pulseLiteral;
return NS_OK;
}
@ -409,7 +409,7 @@ FileSystemDataSource::GetTarget(nsIRDFResource *source,
else if (property == mNC_pulse)
{
nsCOMPtr<nsIRDFLiteral> pulseLiteral;
mRDFService->GetLiteral(NS_LITERAL_STRING("12").get(), getter_AddRefs(pulseLiteral));
mRDFService->GetLiteral(MOZ_UTF16("12"), getter_AddRefs(pulseLiteral));
rv = pulseLiteral->QueryInterface(NS_GET_IID(nsIRDFNode), (void**) target);
return(rv);
}
@ -485,7 +485,7 @@ FileSystemDataSource::GetTargets(nsIRDFResource *source,
else if (property == mNC_pulse)
{
nsCOMPtr<nsIRDFLiteral> pulseLiteral;
mRDFService->GetLiteral(NS_LITERAL_STRING("12").get(),
mRDFService->GetLiteral(MOZ_UTF16("12"),
getter_AddRefs(pulseLiteral));
return NS_NewSingletonEnumerator(targets, pulseLiteral);
}
@ -529,7 +529,7 @@ FileSystemDataSource::GetTargets(nsIRDFResource *source,
else if (property == mNC_pulse)
{
nsCOMPtr<nsIRDFLiteral> pulseLiteral;
rv = mRDFService->GetLiteral(NS_LITERAL_STRING("12").get(),
rv = mRDFService->GetLiteral(MOZ_UTF16("12"),
getter_AddRefs(pulseLiteral));
if (NS_FAILED(rv)) return rv;

View File

@ -55,7 +55,7 @@ nsSecurityWarningDialogs::ConfirmPostToInsecureFromSecure(nsIInterfaceRequestor
// The Telemetry clickthrough constant is 1 more than the constant for the dialog.
rv = ConfirmDialog(ctx, nullptr, // No preference for this one - it's too important
NS_LITERAL_STRING("PostToInsecureFromSecureMessage").get(),
MOZ_UTF16("PostToInsecureFromSecureMessage"),
nullptr,
nsISecurityUITelemetry::WARNING_CONFIRM_POST_TO_INSECURE_FROM_SECURE,
_result);
@ -106,7 +106,7 @@ nsSecurityWarningDialogs::ConfirmDialog(nsIInterfaceRequestor *ctx, const char *
// Get messages strings from localization file
nsXPIDLString windowTitle, message, alertMe, cont;
mStringBundle->GetStringFromName(NS_LITERAL_STRING("Title").get(),
mStringBundle->GetStringFromName(MOZ_UTF16("Title"),
getter_Copies(windowTitle));
mStringBundle->GetStringFromName(messageName,
getter_Copies(message));
@ -114,7 +114,7 @@ nsSecurityWarningDialogs::ConfirmDialog(nsIInterfaceRequestor *ctx, const char *
mStringBundle->GetStringFromName(showAgainName,
getter_Copies(alertMe));
}
mStringBundle->GetStringFromName(NS_LITERAL_STRING("Continue").get(),
mStringBundle->GetStringFromName(MOZ_UTF16("Continue"),
getter_Copies(cont));
// alertMe is allowed to be null
if (!windowTitle || !message || !cont) return NS_ERROR_FAILURE;

View File

@ -203,12 +203,12 @@ nsNSSDialogs::NotifyCACertExists(nsIInterfaceRequestor *ctx)
nsCOMPtr<nsIDOMWindow> parent = do_GetInterface(ctx);
nsAutoString title;
rv = mPIPStringBundle->GetStringFromName(NS_LITERAL_STRING("caCertExistsTitle").get(),
rv = mPIPStringBundle->GetStringFromName(MOZ_UTF16("caCertExistsTitle"),
getter_Copies(title));
NS_ENSURE_SUCCESS(rv, rv);
nsAutoString msg;
rv = mPIPStringBundle->GetStringFromName(NS_LITERAL_STRING("caCertExistsMessage").get(),
rv = mPIPStringBundle->GetStringFromName(MOZ_UTF16("caCertExistsMessage"),
getter_Copies(msg));
NS_ENSURE_SUCCESS(rv, rv);

View File

@ -145,7 +145,7 @@ nsCertOverrideService::Observe(nsISupports *,
ReentrantMonitorAutoEnter lock(monitor);
if (!nsCRT::strcmp(aData, NS_LITERAL_STRING("shutdown-cleanse").get())) {
if (!nsCRT::strcmp(aData, MOZ_UTF16("shutdown-cleanse"))) {
RemoveAllFromMemory();
// delete the storage file
if (mSettingsFile) {

View File

@ -2124,10 +2124,10 @@ nsP12Runnable::Run()
//Build up the message that let's the user know we're trying to
//make PKCS12 backups of the new certs.
nssComponent->GetPIPNSSBundleString("ForcedBackup1", final);
final.Append(NS_LITERAL_STRING("\n\n").get());
final.Append(MOZ_UTF16("\n\n"));
nssComponent->GetPIPNSSBundleString("ForcedBackup2", temp);
final.Append(temp.get());
final.Append(NS_LITERAL_STRING("\n\n").get());
final.Append(MOZ_UTF16("\n\n"));
nssComponent->GetPIPNSSBundleString("ForcedBackup3", temp);

View File

@ -551,7 +551,7 @@ nsCommandLine::EnumerateHandlers(EnumerateHandlersCallback aCallback, void *aClo
nsCOMPtr<nsICommandLineHandler> clh(do_GetService(contractID.get()));
if (!clh) {
LogConsoleMessage(NS_LITERAL_STRING("Contract ID '%s' was registered as a command line handler for entry '%s', but could not be created.").get(),
LogConsoleMessage(MOZ_UTF16("Contract ID '%s' was registered as a command line handler for entry '%s', but could not be created."),
contractID.get(), entry.get());
continue;
}

View File

@ -1370,7 +1370,7 @@ nsDownloadManager::GetDefaultDownloadsDirectory(nsIFile **aResult)
// XDG user dir spec, with a fallback to Home/Downloads
nsXPIDLString folderName;
mBundle->GetStringFromName(NS_LITERAL_STRING("downloadsFolder").get(),
mBundle->GetStringFromName(MOZ_UTF16("downloadsFolder"),
getter_Copies(folderName));
#if defined (XP_MACOSX)
@ -2438,26 +2438,26 @@ nsDownloadManager::Observe(nsISupports *aSubject,
NS_ENSURE_SUCCESS(rv, rv);
#ifndef XP_MACOSX
ConfirmCancelDownloads(currDownloadCount, cancelDownloads,
NS_LITERAL_STRING("quitCancelDownloadsAlertTitle").get(),
NS_LITERAL_STRING("quitCancelDownloadsAlertMsgMultiple").get(),
NS_LITERAL_STRING("quitCancelDownloadsAlertMsg").get(),
NS_LITERAL_STRING("dontQuitButtonWin").get());
MOZ_UTF16("quitCancelDownloadsAlertTitle"),
MOZ_UTF16("quitCancelDownloadsAlertMsgMultiple"),
MOZ_UTF16("quitCancelDownloadsAlertMsg"),
MOZ_UTF16("dontQuitButtonWin"));
#else
ConfirmCancelDownloads(currDownloadCount, cancelDownloads,
NS_LITERAL_STRING("quitCancelDownloadsAlertTitle").get(),
NS_LITERAL_STRING("quitCancelDownloadsAlertMsgMacMultiple").get(),
NS_LITERAL_STRING("quitCancelDownloadsAlertMsgMac").get(),
NS_LITERAL_STRING("dontQuitButtonMac").get());
MOZ_UTF16("quitCancelDownloadsAlertTitle"),
MOZ_UTF16("quitCancelDownloadsAlertMsgMacMultiple"),
MOZ_UTF16("quitCancelDownloadsAlertMsgMac"),
MOZ_UTF16("dontQuitButtonMac"));
#endif
} else if (strcmp(aTopic, "offline-requested") == 0 && currDownloadCount) {
nsCOMPtr<nsISupportsPRBool> cancelDownloads =
do_QueryInterface(aSubject, &rv);
NS_ENSURE_SUCCESS(rv, rv);
ConfirmCancelDownloads(currDownloadCount, cancelDownloads,
NS_LITERAL_STRING("offlineCancelDownloadsAlertTitle").get(),
NS_LITERAL_STRING("offlineCancelDownloadsAlertMsgMultiple").get(),
NS_LITERAL_STRING("offlineCancelDownloadsAlertMsg").get(),
NS_LITERAL_STRING("dontGoOfflineButton").get());
MOZ_UTF16("offlineCancelDownloadsAlertTitle"),
MOZ_UTF16("offlineCancelDownloadsAlertMsgMultiple"),
MOZ_UTF16("offlineCancelDownloadsAlertMsg"),
MOZ_UTF16("dontGoOfflineButton"));
}
else if (strcmp(aTopic, NS_IOSERVICE_GOING_OFFLINE_TOPIC) == 0) {
// Pause all downloads, and mark them to auto-resume.
@ -2473,7 +2473,7 @@ nsDownloadManager::Observe(nsISupports *aSubject,
do_GetService("@mozilla.org/download-manager-ui;1", &rv);
NS_ENSURE_SUCCESS(rv, rv);
return dmui->Show(nullptr, nullptr, nsIDownloadManagerUI::REASON_USER_INTERACTED,
aData && NS_strcmp(aData, NS_LITERAL_STRING("private").get()) == 0);
aData && NS_strcmp(aData, MOZ_UTF16("private")) == 0);
} else if (strcmp(aTopic, "sleep_notification") == 0 ||
strcmp(aTopic, "suspend_process_notification") == 0) {
// Pause downloads if we're sleeping, and mark the downloads as auto-resume
@ -2508,10 +2508,10 @@ nsDownloadManager::Observe(nsISupports *aSubject,
NS_ENSURE_SUCCESS(rv, rv);
ConfirmCancelDownloads(mCurrentPrivateDownloads.Count(), cancelDownloads,
NS_LITERAL_STRING("leavePrivateBrowsingCancelDownloadsAlertTitle").get(),
NS_LITERAL_STRING("leavePrivateBrowsingWindowsCancelDownloadsAlertMsgMultiple").get(),
NS_LITERAL_STRING("leavePrivateBrowsingWindowsCancelDownloadsAlertMsg").get(),
NS_LITERAL_STRING("dontLeavePrivateBrowsingButton").get());
MOZ_UTF16("leavePrivateBrowsingCancelDownloadsAlertTitle"),
MOZ_UTF16("leavePrivateBrowsingWindowsCancelDownloadsAlertMsgMultiple"),
MOZ_UTF16("leavePrivateBrowsingWindowsCancelDownloadsAlertMsg"),
MOZ_UTF16("dontLeavePrivateBrowsingButton"));
}
return NS_OK;
@ -2541,11 +2541,11 @@ nsDownloadManager::ConfirmCancelDownloads(int32_t aCount,
if (aCount > 1) {
mBundle->FormatStringFromName(aCancelMessageMultiple, strings, 1,
getter_Copies(message));
mBundle->FormatStringFromName(NS_LITERAL_STRING("cancelDownloadsOKTextMultiple").get(),
mBundle->FormatStringFromName(MOZ_UTF16("cancelDownloadsOKTextMultiple"),
strings, 1, getter_Copies(quitButton));
} else {
mBundle->GetStringFromName(aCancelMessageSingle, getter_Copies(message));
mBundle->GetStringFromName(NS_LITERAL_STRING("cancelDownloadsOKText").get(),
mBundle->GetStringFromName(MOZ_UTF16("cancelDownloadsOKText"),
getter_Copies(quitButton));
}
@ -2555,7 +2555,7 @@ nsDownloadManager::ConfirmCancelDownloads(int32_t aCount,
nsCOMPtr<nsIWindowMediator> wm = do_GetService(NS_WINDOWMEDIATOR_CONTRACTID);
nsCOMPtr<nsIDOMWindow> dmWindow;
if (wm) {
wm->GetMostRecentWindow(NS_LITERAL_STRING("Download:Manager").get(),
wm->GetMostRecentWindow(MOZ_UTF16("Download:Manager"),
getter_AddRefs(dmWindow));
}
@ -2708,10 +2708,10 @@ nsDownload::SetState(DownloadState aState)
nsXPIDLString title, message;
mDownloadManager->mBundle->GetStringFromName(
NS_LITERAL_STRING("downloadsCompleteTitle").get(),
MOZ_UTF16("downloadsCompleteTitle"),
getter_Copies(title));
mDownloadManager->mBundle->GetStringFromName(
NS_LITERAL_STRING("downloadsCompleteMsg").get(),
MOZ_UTF16("downloadsCompleteMsg"),
getter_Copies(message));
bool removeWhenDone =
@ -3679,7 +3679,7 @@ nsDownload::FailDownload(nsresult aStatus, const PRUnichar *aMessage)
// Get title for alert.
nsXPIDLString title;
nsresult rv = bundle->GetStringFromName(
NS_LITERAL_STRING("downloadErrorAlertTitle").get(), getter_Copies(title));
MOZ_UTF16("downloadErrorAlertTitle"), getter_Copies(title));
NS_ENSURE_SUCCESS(rv, rv);
// Get a generic message if we weren't supplied one
@ -3687,7 +3687,7 @@ nsDownload::FailDownload(nsresult aStatus, const PRUnichar *aMessage)
message = aMessage;
if (message.IsEmpty()) {
rv = bundle->GetStringFromName(
NS_LITERAL_STRING("downloadErrorGeneric").get(), getter_Copies(message));
MOZ_UTF16("downloadErrorGeneric"), getter_Copies(message));
NS_ENSURE_SUCCESS(rv, rv);
}
@ -3696,7 +3696,7 @@ nsDownload::FailDownload(nsresult aStatus, const PRUnichar *aMessage)
do_GetService(NS_WINDOWMEDIATOR_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIDOMWindow> dmWindow;
rv = wm->GetMostRecentWindow(NS_LITERAL_STRING("Download:Manager").get(),
rv = wm->GetMostRecentWindow(MOZ_UTF16("Download:Manager"),
getter_AddRefs(dmWindow));
NS_ENSURE_SUCCESS(rv, rv);

View File

@ -854,7 +854,7 @@ nsFileView::FilterFiles()
for (uint32_t j = 0; j < filterCount; ++j) {
bool matched = false;
if (!nsCRT::strcmp(mCurrentFilters.ElementAt(j),
NS_LITERAL_STRING("..apps").get()))
MOZ_UTF16("..apps")))
{
file->IsExecutable(&matched);
} else

View File

@ -872,25 +872,25 @@ Database::CreateBookmarkRoots()
if (NS_FAILED(rv)) return rv;
// Fetch the internationalized folder name from the string bundle.
rv = bundle->GetStringFromName(NS_LITERAL_STRING("BookmarksMenuFolderTitle").get(),
rv = bundle->GetStringFromName(MOZ_UTF16("BookmarksMenuFolderTitle"),
getter_Copies(rootTitle));
if (NS_FAILED(rv)) return rv;
rv = CreateRoot(mMainConn, NS_LITERAL_CSTRING("menu"), rootTitle);
if (NS_FAILED(rv)) return rv;
rv = bundle->GetStringFromName(NS_LITERAL_STRING("BookmarksToolbarFolderTitle").get(),
rv = bundle->GetStringFromName(MOZ_UTF16("BookmarksToolbarFolderTitle"),
getter_Copies(rootTitle));
if (NS_FAILED(rv)) return rv;
rv = CreateRoot(mMainConn, NS_LITERAL_CSTRING("toolbar"), rootTitle);
if (NS_FAILED(rv)) return rv;
rv = bundle->GetStringFromName(NS_LITERAL_STRING("TagsFolderTitle").get(),
rv = bundle->GetStringFromName(MOZ_UTF16("TagsFolderTitle"),
getter_Copies(rootTitle));
if (NS_FAILED(rv)) return rv;
rv = CreateRoot(mMainConn, NS_LITERAL_CSTRING("tags"), rootTitle);
if (NS_FAILED(rv)) return rv;
rv = bundle->GetStringFromName(NS_LITERAL_STRING("UnsortedBookmarksFolderTitle").get(),
rv = bundle->GetStringFromName(MOZ_UTF16("UnsortedBookmarksFolderTitle"),
getter_Copies(rootTitle));
if (NS_FAILED(rv)) return rv;
rv = CreateRoot(mMainConn, NS_LITERAL_CSTRING("unfiled"), rootTitle);

View File

@ -1532,7 +1532,7 @@ PlacesSQLQueryBuilder::SelectAsDay()
case 0:
// Today
history->GetStringFromName(
NS_LITERAL_STRING("finduri-AgeInDays-is-0").get(), dateName);
MOZ_UTF16("finduri-AgeInDays-is-0"), dateName);
// From start of today
sqlFragmentContainerBeginTime = NS_LITERAL_CSTRING(
"(strftime('%s','now','localtime','start of day','utc')*1000000)");
@ -1546,7 +1546,7 @@ PlacesSQLQueryBuilder::SelectAsDay()
case 1:
// Yesterday
history->GetStringFromName(
NS_LITERAL_STRING("finduri-AgeInDays-is-1").get(), dateName);
MOZ_UTF16("finduri-AgeInDays-is-1"), dateName);
// From start of yesterday
sqlFragmentContainerBeginTime = NS_LITERAL_CSTRING(
"(strftime('%s','now','localtime','start of day','-1 day','utc')*1000000)");
@ -1560,7 +1560,7 @@ PlacesSQLQueryBuilder::SelectAsDay()
case 2:
// Last 7 days
history->GetAgeInDaysString(7,
NS_LITERAL_STRING("finduri-AgeInDays-last-is").get(), dateName);
MOZ_UTF16("finduri-AgeInDays-last-is"), dateName);
// From start of 7 days ago
sqlFragmentContainerBeginTime = NS_LITERAL_CSTRING(
"(strftime('%s','now','localtime','start of day','-7 days','utc')*1000000)");
@ -1576,7 +1576,7 @@ PlacesSQLQueryBuilder::SelectAsDay()
case 3:
// This month
history->GetStringFromName(
NS_LITERAL_STRING("finduri-AgeInMonths-is-0").get(), dateName);
MOZ_UTF16("finduri-AgeInMonths-is-0"), dateName);
// From start of this month
sqlFragmentContainerBeginTime = NS_LITERAL_CSTRING(
"(strftime('%s','now','localtime','start of month','utc')*1000000)");
@ -1593,7 +1593,7 @@ PlacesSQLQueryBuilder::SelectAsDay()
if (i == HISTORY_ADDITIONAL_DATE_CONT_NUM + 6) {
// Older than 6 months
history->GetAgeInDaysString(6,
NS_LITERAL_STRING("finduri-AgeInMonths-isgreater").get(), dateName);
MOZ_UTF16("finduri-AgeInMonths-isgreater"), dateName);
// From start of epoch
sqlFragmentContainerBeginTime = NS_LITERAL_CSTRING(
"(datetime(0, 'unixepoch')*1000000)");
@ -1693,7 +1693,7 @@ PlacesSQLQueryBuilder::SelectAsSite()
nsNavHistory *history = nsNavHistory::GetHistoryService();
NS_ENSURE_STATE(history);
history->GetStringFromName(NS_LITERAL_STRING("localhost").get(), localFiles);
history->GetStringFromName(MOZ_UTF16("localhost"), localFiles);
mAddParams.Put(NS_LITERAL_CSTRING("localhost"), localFiles);
// If there are additional conditions the query has to join on visits too.
@ -4117,7 +4117,7 @@ nsNavHistory::TitleForDomain(const nsCString& domain, nsACString& aTitle)
}
// use the localized one instead
GetStringFromName(NS_LITERAL_STRING("localhost").get(), aTitle);
GetStringFromName(MOZ_UTF16("localhost"), aTitle);
}
void
@ -4187,7 +4187,7 @@ nsNavHistory::GetMonthYear(int32_t aMonth, int32_t aYear, nsACString& aResult)
};
nsXPIDLString value;
if (NS_SUCCEEDED(bundle->FormatStringFromName(
NS_LITERAL_STRING("finduri-MonthYear").get(), strings, 2,
MOZ_UTF16("finduri-MonthYear"), strings, 2,
getter_Copies(value)
))) {
CopyUTF16toUTF8(value, aResult);

View File

@ -4718,7 +4718,7 @@ nsNavHistoryResult::OnVisit(nsIURI* aURI, int64_t aVisitId, PRTime aTime,
NS_ENSURE_TRUE(history, NS_OK);
nsAutoCString todayLabel;
history->GetStringFromName(
NS_LITERAL_STRING("finduri-AgeInDays-is-0").get(), todayLabel);
MOZ_UTF16("finduri-AgeInDays-is-0"), todayLabel);
todayIsMissing = !todayLabel.Equals(title);
}
}

View File

@ -262,7 +262,7 @@ nsAlertsIconListener::InitAlertAsync(const nsAString & aImageUrl,
nsAutoString appName;
if (bundle) {
bundle->GetStringFromName(NS_LITERAL_STRING("brandShortName").get(),
bundle->GetStringFromName(MOZ_UTF16("brandShortName"),
getter_Copies(appName));
appShortName = NS_ConvertUTF16toUTF8(appName);
} else {

View File

@ -80,7 +80,7 @@ ProfileResetCleanup(nsIToolkitProfile* aOldProfile)
nsXPIDLString resetBackupDirectoryName;
static const PRUnichar* kResetBackupDirectory = NS_LITERAL_STRING("resetBackupDirectory").get();
static const PRUnichar* kResetBackupDirectory = MOZ_UTF16("resetBackupDirectory");
rv = sb->FormatStringFromName(kResetBackupDirectory, params, 2,
getter_Copies(resetBackupDirectoryName));

View File

@ -1779,7 +1779,7 @@ ProfileLockedDialog(nsIFile* aProfileDir, nsIFile* aProfileLocalDir,
params, 2, getter_Copies(killMessage));
nsXPIDLString killTitle;
sb->FormatStringFromName(NS_LITERAL_STRING("restartTitle").get(),
sb->FormatStringFromName(MOZ_UTF16("restartTitle"),
params, 1, getter_Copies(killTitle));
if (!killMessage || !killTitle)
@ -1865,7 +1865,7 @@ ProfileMissingDialog(nsINativeAppSupport* aNative)
sb->FormatStringFromName(kMissing, params, 2, getter_Copies(missingMessage));
nsXPIDLString missingTitle;
sb->FormatStringFromName(NS_LITERAL_STRING("profileMissingTitle").get(),
sb->FormatStringFromName(MOZ_UTF16("profileMissingTitle"),
params, 1, getter_Copies(missingTitle));
if (missingMessage && missingTitle) {

View File

@ -1372,7 +1372,7 @@ void nsNativeAppSupportOS2::ParseDDEArg( HSZ args, int index, nsCString& aString
void nsNativeAppSupportOS2::ActivateLastWindow() {
nsCOMPtr<nsIDOMWindow> navWin;
GetMostRecentWindow( NS_LITERAL_STRING("navigator:browser").get(), getter_AddRefs( navWin ) );
GetMostRecentWindow( MOZ_UTF16("navigator:browser"), getter_AddRefs( navWin ) );
if ( navWin )
// Activate that window.
activateWindow( navWin );

View File

@ -1242,7 +1242,7 @@ HDDEDATA nsNativeAppSupportWin::CreateDDEData( LPBYTE value, DWORD len ) {
void nsNativeAppSupportWin::ActivateLastWindow() {
nsCOMPtr<nsIDOMWindow> navWin;
GetMostRecentWindow( NS_LITERAL_STRING("navigator:browser").get(), getter_AddRefs( navWin ) );
GetMostRecentWindow( MOZ_UTF16("navigator:browser"), getter_AddRefs( navWin ) );
if ( navWin ) {
// Activate that window.
activateWindow( navWin );

View File

@ -1842,7 +1842,7 @@ void nsExternalAppHandler::SendStatusChange(ErrorType type, nsresult rv, nsIRequ
// We don't have a listener. Simply show the alert ourselves.
nsCOMPtr<nsIPrompt> prompter(do_GetInterface(mWindowContext));
nsXPIDLString title;
bundle->FormatStringFromName(NS_LITERAL_STRING("title").get(),
bundle->FormatStringFromName(MOZ_UTF16("title"),
strings,
1,
getter_Copies(title));

View File

@ -1338,7 +1338,7 @@ WpsGetDefaultHandler(const char *aFileExt, nsAString& aDescription)
}
// no RWS or RWS failed to return at least a description
if (NS_FAILED(GetNLSString(NS_LITERAL_STRING("wpsDefaultOS2").get(),
if (NS_FAILED(GetNLSString(MOZ_UTF16("wpsDefaultOS2"),
aDescription)))
aDescription.Assign(NS_LITERAL_STRING("WPS default"));
@ -1388,7 +1388,7 @@ WpsMimeInfoFromExtension(const char *aFileExt, nsMIMEInfoOS2 *aMI)
CopyUTF8toUTF16(extUpper, ustr);
nsAutoString fileType;
if (NS_FAILED(GetNLSString(NS_LITERAL_STRING("fileType").get(), fileType)))
if (NS_FAILED(GetNLSString(MOZ_UTF16("fileType"), fileType)))
ustr.Assign(NS_LITERAL_STRING("%S file"));
int pos = -1;
if ((pos = fileType.Find("%S")) > -1)

View File

@ -571,7 +571,7 @@ nsAppShell::ProcessNextNativeEvent(bool mayWait)
if (os) {
os->NotifyObservers(nullptr,
"memory-pressure",
NS_LITERAL_STRING("low-memory").get());
MOZ_UTF16("low-memory"));
}
}
break;

View File

@ -12,7 +12,7 @@ public:
{
// The aim here is to set up the objects enough that silent printing works
SetOutputFormat(nsIPrintSettings::kOutputFormatPDF);
SetPrinterName(NS_LITERAL_STRING("PDF printer").get());
SetPrinterName(MOZ_UTF16("PDF printer"));
}
};

View File

@ -105,7 +105,7 @@ public:
if (observerService) {
observerService->NotifyObservers(
nullptr, "screen-state-changed",
mIsOn ? NS_LITERAL_STRING("on").get() : NS_LITERAL_STRING("off").get()
mIsOn ? MOZ_UTF16("on") : MOZ_UTF16("off")
);
}

View File

@ -820,7 +820,7 @@ NS_IMETHODIMP nsPrinterEnumeratorGTK::InitPrintSettingsFromPrinter(const PRUnich
printerFeatures.SetCanChangePlex(false);
#endif /* SET_PRINTER_FEATURES_VIA_PREFS */
DO_PR_DEBUG_LOG(("setting default plex to '%s'\n", "default"));
aPrintSettings->SetPlexName(NS_LITERAL_STRING("default").get());
aPrintSettings->SetPlexName(MOZ_UTF16("default"));
#ifdef SET_PRINTER_FEATURES_VIA_PREFS
printerFeatures.SetPlexRecord(0, "default");
printerFeatures.SetNumPlexRecords(1);
@ -831,7 +831,7 @@ NS_IMETHODIMP nsPrinterEnumeratorGTK::InitPrintSettingsFromPrinter(const PRUnich
printerFeatures.SetCanChangeResolutionName(false);
#endif /* SET_PRINTER_FEATURES_VIA_PREFS */
DO_PR_DEBUG_LOG(("setting default resolution to '%s'\n", "default"));
aPrintSettings->SetResolutionName(NS_LITERAL_STRING("default").get());
aPrintSettings->SetResolutionName(MOZ_UTF16("default"));
#ifdef SET_PRINTER_FEATURES_VIA_PREFS
printerFeatures.SetResolutionNameRecord(0, "default");
printerFeatures.SetNumResolutionNameRecords(1);
@ -842,7 +842,7 @@ NS_IMETHODIMP nsPrinterEnumeratorGTK::InitPrintSettingsFromPrinter(const PRUnich
printerFeatures.SetCanChangeColorspace(false);
#endif /* SET_PRINTER_FEATURES_VIA_PREFS */
DO_PR_DEBUG_LOG(("setting default colorspace to '%s'\n", "default"));
aPrintSettings->SetColorspace(NS_LITERAL_STRING("default").get());
aPrintSettings->SetColorspace(MOZ_UTF16("default"));
#ifdef SET_PRINTER_FEATURES_VIA_PREFS
printerFeatures.SetColorspaceRecord(0, "default");
printerFeatures.SetNumColorspaceRecords(1);

View File

@ -60,7 +60,7 @@ ShowCustomDialog(GtkComboBox *changed_box, gpointer user_data)
bundleSvc->CreateBundle("chrome://global/locale/printdialog.properties", getter_AddRefs(printBundle));
nsXPIDLString intlString;
printBundle->GetStringFromName(NS_LITERAL_STRING("headerFooterCustom").get(), getter_Copies(intlString));
printBundle->GetStringFromName(MOZ_UTF16("headerFooterCustom"), getter_Copies(intlString));
GtkWidget* prompt_dialog = gtk_dialog_new_with_buttons(NS_ConvertUTF16toUTF8(intlString).get(), printDialog,
#if (MOZ_WIDGET_GTK == 2)
(GtkDialogFlags)(GTK_DIALOG_MODAL | GTK_DIALOG_NO_SEPARATOR),
@ -76,7 +76,7 @@ ShowCustomDialog(GtkComboBox *changed_box, gpointer user_data)
GTK_RESPONSE_REJECT,
-1);
printBundle->GetStringFromName(NS_LITERAL_STRING("customHeaderFooterPrompt").get(), getter_Copies(intlString));
printBundle->GetStringFromName(MOZ_UTF16("customHeaderFooterPrompt"), getter_Copies(intlString));
GtkWidget* custom_label = gtk_label_new(NS_ConvertUTF16toUTF8(intlString).get());
GtkWidget* custom_entry = gtk_entry_new();
GtkWidget* question_icon = gtk_image_new_from_stock(GTK_STOCK_DIALOG_QUESTION, GTK_ICON_SIZE_DIALOG);

View File

@ -128,7 +128,7 @@ ca_context_get_default()
getter_AddRefs(brandingBundle));
if (brandingBundle) {
nsAutoString wbrand;
brandingBundle->GetStringFromName(NS_LITERAL_STRING("brandShortName").get(),
brandingBundle->GetStringFromName(MOZ_UTF16("brandShortName"),
getter_Copies(wbrand));
NS_ConvertUTF16toUTF8 brand(wbrand);

View File

@ -3317,7 +3317,7 @@ GetBrandName(nsXPIDLString& brandName)
if (bundle)
bundle->GetStringFromName(
NS_LITERAL_STRING("brandShortName").get(),
MOZ_UTF16("brandShortName"),
getter_Copies(brandName));
if (brandName.IsEmpty())

View File

@ -315,7 +315,7 @@ nsRwsService::HandlerFromPath(const char *aPath, uint32_t *aHandle,
if (rc) {
if (rc == RWSSRV_FUNCTIONFAILED) {
*aHandle = 0;
AssignNLSString(NS_LITERAL_STRING("wpsDefaultOS2").get(), _retval);
AssignNLSString(MOZ_UTF16("wpsDefaultOS2"), _retval);
rv = NS_OK;
}
else
@ -360,7 +360,7 @@ nsRwsService::HandlerFromPath(const char *aPath, uint32_t *aHandle,
case 0xbc2b: {
rv = IsDescendedFrom(wpsFilePtr, "MMImage");
if (NS_SUCCEEDED(rv))
AssignNLSString(NS_LITERAL_STRING("mmImageViewerOS2").get(), _retval);
AssignNLSString(MOZ_UTF16("mmImageViewerOS2"), _retval);
break;
}
@ -371,19 +371,19 @@ nsRwsService::HandlerFromPath(const char *aPath, uint32_t *aHandle,
case 0xbbe5: { // Player
rv = IsDescendedFrom(wpsFilePtr, "MMAudio");
if (NS_SUCCEEDED(rv)) {
AssignNLSString(NS_LITERAL_STRING("mmAudioPlayerOS2").get(), _retval);
AssignNLSString(MOZ_UTF16("mmAudioPlayerOS2"), _retval);
break;
}
rv = IsDescendedFrom(wpsFilePtr, "MMVideo");
if (NS_SUCCEEDED(rv)) {
AssignNLSString(NS_LITERAL_STRING("mmVideoPlayerOS2").get(), _retval);
AssignNLSString(MOZ_UTF16("mmVideoPlayerOS2"), _retval);
break;
}
rv = IsDescendedFrom(wpsFilePtr, "MMMIDI");
if (NS_SUCCEEDED(rv))
AssignNLSString(NS_LITERAL_STRING("mmMidiPlayerOS2").get(), _retval);
AssignNLSString(MOZ_UTF16("mmMidiPlayerOS2"), _retval);
break;
}
@ -391,7 +391,7 @@ nsRwsService::HandlerFromPath(const char *aPath, uint32_t *aHandle,
case 0x7701: {
rv = IsDescendedFrom(wpsFilePtr, "TSArcMgr");
if (NS_SUCCEEDED(rv))
AssignNLSString(NS_LITERAL_STRING("odZipFolderOS2").get(), _retval);
AssignNLSString(MOZ_UTF16("odZipFolderOS2"), _retval);
break;
}
@ -401,7 +401,7 @@ nsRwsService::HandlerFromPath(const char *aPath, uint32_t *aHandle,
case 0xa742: {
rv = IsDescendedFrom(wpsFilePtr, "TSEnhDataFile");
if (NS_SUCCEEDED(rv))
AssignNLSString(NS_LITERAL_STRING("odTextViewOS2").get(), _retval);
AssignNLSString(MOZ_UTF16("odTextViewOS2"), _retval);
break;
}
} // end switch
@ -431,7 +431,7 @@ nsRwsService::HandlerFromPath(const char *aPath, uint32_t *aHandle,
break;
nsAutoString classViewer;
AssignNLSString(NS_LITERAL_STRING("classViewerOS2").get(), classViewer);
AssignNLSString(MOZ_UTF16("classViewerOS2"), classViewer);
int pos = -1;
if ((pos = classViewer.Find("%S")) > -1)
classViewer.Replace(pos, 2, buffer.Elements());
@ -747,7 +747,7 @@ static void AssignNLSString(const PRUnichar *aKey, nsAString& result)
// if we can't fetch the requested string, try to get "WPS Default"
rv = bundle->GetStringFromName(aKey, getter_Copies(title));
if (NS_FAILED(rv))
rv = bundle->GetStringFromName(NS_LITERAL_STRING("wpsDefaultOS2").get(),
rv = bundle->GetStringFromName(MOZ_UTF16("wpsDefaultOS2"),
getter_Copies(title));
} while (0);

View File

@ -2157,7 +2157,7 @@ GetBrandName(nsXPIDLString& brandName)
if (bundle)
bundle->GetStringFromName(
NS_LITERAL_STRING("brandShortName").get(),
MOZ_UTF16("brandShortName"),
getter_Copies(brandName));
if (brandName.IsEmpty())

View File

@ -207,7 +207,7 @@ AudioSession::Start()
getter_AddRefs(bundle));
NS_ENSURE_TRUE(bundle, NS_ERROR_FAILURE);
bundle->GetStringFromName(NS_LITERAL_STRING("brandFullName").get(),
bundle->GetStringFromName(MOZ_UTF16("brandFullName"),
getter_Copies(mDisplayName));
wchar_t *buffer;

View File

@ -1030,7 +1030,7 @@ nsDataObj :: GetFileDescriptorInternetShortcutA ( FORMATETC& aFE, STGMEDIUM& aST
if (!CreateFilenameFromTextA(title, ".URL",
fileGroupDescA->fgd[0].cFileName, NS_MAX_FILEDESCRIPTOR)) {
nsXPIDLString untitled;
if (!GetLocalizedString(NS_LITERAL_STRING("noPageTitle").get(), untitled) ||
if (!GetLocalizedString(MOZ_UTF16("noPageTitle"), untitled) ||
!CreateFilenameFromTextA(untitled, ".URL",
fileGroupDescA->fgd[0].cFileName, NS_MAX_FILEDESCRIPTOR)) {
strcpy(fileGroupDescA->fgd[0].cFileName, "Untitled.URL");
@ -1068,13 +1068,13 @@ nsDataObj :: GetFileDescriptorInternetShortcutW ( FORMATETC& aFE, STGMEDIUM& aST
// get a valid filename in the following order: 1) from the page title,
// 2) localized string for an untitled page, 3) just use "Untitled.URL"
if (!CreateFilenameFromTextW(title, NS_LITERAL_STRING(".URL").get(),
if (!CreateFilenameFromTextW(title, MOZ_UTF16(".URL"),
fileGroupDescW->fgd[0].cFileName, NS_MAX_FILEDESCRIPTOR)) {
nsXPIDLString untitled;
if (!GetLocalizedString(NS_LITERAL_STRING("noPageTitle").get(), untitled) ||
!CreateFilenameFromTextW(untitled, NS_LITERAL_STRING(".URL").get(),
if (!GetLocalizedString(MOZ_UTF16("noPageTitle"), untitled) ||
!CreateFilenameFromTextW(untitled, MOZ_UTF16(".URL"),
fileGroupDescW->fgd[0].cFileName, NS_MAX_FILEDESCRIPTOR)) {
wcscpy(fileGroupDescW->fgd[0].cFileName, NS_LITERAL_STRING("Untitled.URL").get());
wcscpy(fileGroupDescW->fgd[0].cFileName, MOZ_UTF16("Untitled.URL"));
}
}

View File

@ -260,7 +260,7 @@ GetFileNameForPrintSettings(nsIPrintSettings* aPS)
NS_ENSURE_SUCCESS(rv, rv);
nsXPIDLString title;
rv = bundle->GetStringFromName(NS_LITERAL_STRING("PrintToFile").get(), getter_Copies(title));
rv = bundle->GetStringFromName(MOZ_UTF16("PrintToFile"), getter_Copies(title));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIWindowWatcher> wwatch =

View File

@ -3347,7 +3347,7 @@ nsTextStore::Initialize(void)
if (sTsfThreadMgr && !sFlushTIPInputMessage) {
sFlushTIPInputMessage = ::RegisterWindowMessageW(
NS_LITERAL_STRING("Flush TIP Input Message").get());
MOZ_UTF16("Flush TIP Input Message"));
}
if (!sTsfThreadMgr) {

View File

@ -416,7 +416,7 @@ FrameworkView::OnDataShareRequested(IDataTransferManager* aDTM,
getter_AddRefs(brandBundle));
NS_ENSURE_TRUE(brandBundle, E_FAIL);
if(brandBundle) {
brandBundle->GetStringFromName(NS_LITERAL_STRING("brandFullName").get(),
brandBundle->GetStringFromName(MOZ_UTF16("brandFullName"),
getter_Copies(brandName));
}

View File

@ -171,47 +171,47 @@ nsBaseFilePicker::AppendFilters(int32_t aFilterMask)
nsXPIDLString filter;
if (aFilterMask & filterAll) {
titleBundle->GetStringFromName(NS_LITERAL_STRING("allTitle").get(), getter_Copies(title));
filterBundle->GetStringFromName(NS_LITERAL_STRING("allFilter").get(), getter_Copies(filter));
titleBundle->GetStringFromName(MOZ_UTF16("allTitle"), getter_Copies(title));
filterBundle->GetStringFromName(MOZ_UTF16("allFilter"), getter_Copies(filter));
AppendFilter(title,filter);
}
if (aFilterMask & filterHTML) {
titleBundle->GetStringFromName(NS_LITERAL_STRING("htmlTitle").get(), getter_Copies(title));
filterBundle->GetStringFromName(NS_LITERAL_STRING("htmlFilter").get(), getter_Copies(filter));
titleBundle->GetStringFromName(MOZ_UTF16("htmlTitle"), getter_Copies(title));
filterBundle->GetStringFromName(MOZ_UTF16("htmlFilter"), getter_Copies(filter));
AppendFilter(title,filter);
}
if (aFilterMask & filterText) {
titleBundle->GetStringFromName(NS_LITERAL_STRING("textTitle").get(), getter_Copies(title));
filterBundle->GetStringFromName(NS_LITERAL_STRING("textFilter").get(), getter_Copies(filter));
titleBundle->GetStringFromName(MOZ_UTF16("textTitle"), getter_Copies(title));
filterBundle->GetStringFromName(MOZ_UTF16("textFilter"), getter_Copies(filter));
AppendFilter(title,filter);
}
if (aFilterMask & filterImages) {
titleBundle->GetStringFromName(NS_LITERAL_STRING("imageTitle").get(), getter_Copies(title));
filterBundle->GetStringFromName(NS_LITERAL_STRING("imageFilter").get(), getter_Copies(filter));
titleBundle->GetStringFromName(MOZ_UTF16("imageTitle"), getter_Copies(title));
filterBundle->GetStringFromName(MOZ_UTF16("imageFilter"), getter_Copies(filter));
AppendFilter(title,filter);
}
if (aFilterMask & filterAudio) {
titleBundle->GetStringFromName(NS_LITERAL_STRING("audioTitle").get(), getter_Copies(title));
filterBundle->GetStringFromName(NS_LITERAL_STRING("audioFilter").get(), getter_Copies(filter));
titleBundle->GetStringFromName(MOZ_UTF16("audioTitle"), getter_Copies(title));
filterBundle->GetStringFromName(MOZ_UTF16("audioFilter"), getter_Copies(filter));
AppendFilter(title,filter);
}
if (aFilterMask & filterVideo) {
titleBundle->GetStringFromName(NS_LITERAL_STRING("videoTitle").get(), getter_Copies(title));
filterBundle->GetStringFromName(NS_LITERAL_STRING("videoFilter").get(), getter_Copies(filter));
titleBundle->GetStringFromName(MOZ_UTF16("videoTitle"), getter_Copies(title));
filterBundle->GetStringFromName(MOZ_UTF16("videoFilter"), getter_Copies(filter));
AppendFilter(title,filter);
}
if (aFilterMask & filterXML) {
titleBundle->GetStringFromName(NS_LITERAL_STRING("xmlTitle").get(), getter_Copies(title));
filterBundle->GetStringFromName(NS_LITERAL_STRING("xmlFilter").get(), getter_Copies(filter));
titleBundle->GetStringFromName(MOZ_UTF16("xmlTitle"), getter_Copies(title));
filterBundle->GetStringFromName(MOZ_UTF16("xmlFilter"), getter_Copies(filter));
AppendFilter(title,filter);
}
if (aFilterMask & filterXUL) {
titleBundle->GetStringFromName(NS_LITERAL_STRING("xulTitle").get(), getter_Copies(title));
filterBundle->GetStringFromName(NS_LITERAL_STRING("xulFilter").get(), getter_Copies(filter));
titleBundle->GetStringFromName(MOZ_UTF16("xulTitle"), getter_Copies(title));
filterBundle->GetStringFromName(MOZ_UTF16("xulFilter"), getter_Copies(filter));
AppendFilter(title, filter);
}
if (aFilterMask & filterApps) {
titleBundle->GetStringFromName(NS_LITERAL_STRING("appsTitle").get(), getter_Copies(title));
titleBundle->GetStringFromName(MOZ_UTF16("appsTitle"), getter_Copies(title));
// Pass the magic string "..apps" to the platform filepicker, which it
// should recognize and do the correct platform behavior for.
AppendFilter(title, NS_LITERAL_STRING("..apps"));

View File

@ -48,7 +48,7 @@ nsMemoryImpl::Free(void* ptr)
NS_IMETHODIMP
nsMemoryImpl::HeapMinimize(bool aImmediate)
{
return FlushMemory(NS_LITERAL_STRING("heap-minimize").get(), aImmediate);
return FlushMemory(MOZ_UTF16("heap-minimize"), aImmediate);
}
NS_IMETHODIMP

View File

@ -1628,7 +1628,7 @@ public:
if (mRemainingIters == 0) {
os->NotifyObservers(nullptr, "after-minimize-memory-usage",
NS_LITERAL_STRING("MinimizeMemoryUsageRunnable").get());
MOZ_UTF16("MinimizeMemoryUsageRunnable"));
if (mCallback) {
mCallback->Run();
}
@ -1636,7 +1636,7 @@ public:
}
os->NotifyObservers(nullptr, "memory-pressure",
NS_LITERAL_STRING("heap-minimize").get());
MOZ_UTF16("heap-minimize"));
mRemainingIters--;
NS_DispatchToMainThread(this);

View File

@ -452,7 +452,7 @@ ParseManifest(NSLocationType type, FileLocation &file, char* buf, bool aChromeOn
#if defined(XP_WIN)
OSVERSIONINFO info = { sizeof(OSVERSIONINFO) };
if (GetVersionEx(&info)) {
nsTextFormatter::ssprintf(osVersion, NS_LITERAL_STRING("%ld.%ld").get(),
nsTextFormatter::ssprintf(osVersion, MOZ_UTF16("%ld.%ld"),
info.dwMajorVersion,
info.dwMinorVersion);
}
@ -460,12 +460,12 @@ ParseManifest(NSLocationType type, FileLocation &file, char* buf, bool aChromeOn
SInt32 majorVersion, minorVersion;
if ((Gestalt(gestaltSystemVersionMajor, &majorVersion) == noErr) &&
(Gestalt(gestaltSystemVersionMinor, &minorVersion) == noErr)) {
nsTextFormatter::ssprintf(osVersion, NS_LITERAL_STRING("%ld.%ld").get(),
nsTextFormatter::ssprintf(osVersion, MOZ_UTF16("%ld.%ld"),
majorVersion,
minorVersion);
}
#elif defined(MOZ_WIDGET_GTK)
nsTextFormatter::ssprintf(osVersion, NS_LITERAL_STRING("%ld.%ld").get(),
nsTextFormatter::ssprintf(osVersion, MOZ_UTF16("%ld.%ld"),
gtk_major_version,
gtk_minor_version);
#elif defined(MOZ_WIDGET_ANDROID)

View File

@ -99,13 +99,13 @@ int main(int argc, char *argv[])
printf("Testing Notify(observer-A, topic-A)...\n");
rv = anObserverService->NotifyObservers( aObserver,
topicA.get(),
NS_LITERAL_STRING("Testing Notify(observer-A, topic-A)").get() );
MOZ_UTF16("Testing Notify(observer-A, topic-A)") );
testResult(rv);
printf("Testing Notify(observer-B, topic-B)...\n");
rv = anObserverService->NotifyObservers( bObserver,
topicB.get(),
NS_LITERAL_STRING("Testing Notify(observer-B, topic-B)").get() );
MOZ_UTF16("Testing Notify(observer-B, topic-B)") );
testResult(rv);
printf("Testing EnumerateObserverList (for topic-A)...\n");
@ -127,7 +127,7 @@ int main(int argc, char *argv[])
printf("...\n");
rv = observer->Observe( observer,
topicA.get(),
NS_LITERAL_STRING("during enumeration").get() );
MOZ_UTF16("during enumeration") );
testResult(rv);
}
}

View File

@ -1017,23 +1017,23 @@ static bool test_strip_chars_helper(const PRUnichar* str, const PRUnichar* strip
static bool test_strip_chars()
{
return test_strip_chars_helper(NS_LITERAL_STRING("foo \r \nbar").get(),
NS_LITERAL_STRING(" \n\r").get(),
return test_strip_chars_helper(MOZ_UTF16("foo \r \nbar"),
MOZ_UTF16(" \n\r"),
NS_LITERAL_STRING("foobar")) &&
test_strip_chars_helper(NS_LITERAL_STRING("\r\nfoo\r\n").get(),
NS_LITERAL_STRING(" \n\r").get(),
test_strip_chars_helper(MOZ_UTF16("\r\nfoo\r\n"),
MOZ_UTF16(" \n\r"),
NS_LITERAL_STRING("foo")) &&
test_strip_chars_helper(NS_LITERAL_STRING("foo").get(),
NS_LITERAL_STRING(" \n\r").get(),
test_strip_chars_helper(MOZ_UTF16("foo"),
MOZ_UTF16(" \n\r"),
NS_LITERAL_STRING("foo")) &&
test_strip_chars_helper(NS_LITERAL_STRING("foo").get(),
NS_LITERAL_STRING("fo").get(),
test_strip_chars_helper(MOZ_UTF16("foo"),
MOZ_UTF16("fo"),
NS_LITERAL_STRING("")) &&
test_strip_chars_helper(NS_LITERAL_STRING("foo").get(),
NS_LITERAL_STRING("foo").get(),
test_strip_chars_helper(MOZ_UTF16("foo"),
MOZ_UTF16("foo"),
NS_LITERAL_STRING("")) &&
test_strip_chars_helper(NS_LITERAL_STRING(" foo").get(),
NS_LITERAL_STRING(" ").get(),
test_strip_chars_helper(MOZ_UTF16(" foo"),
MOZ_UTF16(" "),
NS_LITERAL_STRING(" foo"), 1);
}

View File

@ -461,16 +461,16 @@ nsHTTPIndex::OnIndexAvailable(nsIRequest* aRequest, nsISupports *aContext,
rv = aIndex->GetType(&type);
switch (type) {
case nsIDirIndex::TYPE_UNKNOWN:
rv = mDirRDF->GetLiteral(NS_LITERAL_STRING("UNKNOWN").get(), getter_AddRefs(lit));
rv = mDirRDF->GetLiteral(MOZ_UTF16("UNKNOWN"), getter_AddRefs(lit));
break;
case nsIDirIndex::TYPE_DIRECTORY:
rv = mDirRDF->GetLiteral(NS_LITERAL_STRING("DIRECTORY").get(), getter_AddRefs(lit));
rv = mDirRDF->GetLiteral(MOZ_UTF16("DIRECTORY"), getter_AddRefs(lit));
break;
case nsIDirIndex::TYPE_FILE:
rv = mDirRDF->GetLiteral(NS_LITERAL_STRING("FILE").get(), getter_AddRefs(lit));
rv = mDirRDF->GetLiteral(MOZ_UTF16("FILE"), getter_AddRefs(lit));
break;
case nsIDirIndex::TYPE_SYMLINK:
rv = mDirRDF->GetLiteral(NS_LITERAL_STRING("SYMLINK").get(), getter_AddRefs(lit));
rv = mDirRDF->GetLiteral(MOZ_UTF16("SYMLINK"), getter_AddRefs(lit));
break;
}
@ -588,9 +588,9 @@ nsHTTPIndex::CommonInit()
mDirRDF->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "IsContainer"),
getter_AddRefs(kNC_IsContainer));
rv = mDirRDF->GetLiteral(NS_LITERAL_STRING("true").get(), getter_AddRefs(kTrueLiteral));
rv = mDirRDF->GetLiteral(MOZ_UTF16("true"), getter_AddRefs(kTrueLiteral));
if (NS_FAILED(rv)) return(rv);
rv = mDirRDF->GetLiteral(NS_LITERAL_STRING("false").get(), getter_AddRefs(kFalseLiteral));
rv = mDirRDF->GetLiteral(MOZ_UTF16("false"), getter_AddRefs(kFalseLiteral));
if (NS_FAILED(rv)) return(rv);
rv = NS_NewISupportsArray(getter_AddRefs(mConnectionList));