Bug 1218315 - Replace NS_LITERAL_STRING(...).get() with MOZ_UTF16(...) on widget. r=nfroyd
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Wed, 28 Oct 2015 14:28:06 +0900
changeset 305124 7102bfea6bbff372d349930667987516d509e178
parent 305067 95b404586f1dddf6738b550516ad5f93099b9665
child 305125 5931f379416e626aa7d26498bd488e497fc6a3ac
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnfroyd
bugs1218315
milestone44.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 1218315 - Replace NS_LITERAL_STRING(...).get() with MOZ_UTF16(...) on widget. r=nfroyd
widget/cocoa/OSXNotificationCenter.mm
widget/cocoa/nsFilePicker.mm
--- a/widget/cocoa/OSXNotificationCenter.mm
+++ b/widget/cocoa/OSXNotificationCenter.mm
@@ -247,43 +247,43 @@ OSXNotificationCenter::ShowAlertNotifica
   nsAlertsUtils::GetSourceHostPort(aPrincipal, hostPort);
   nsCOMPtr<nsIStringBundle> bundle;
   nsCOMPtr<nsIStringBundleService> sbs = do_GetService(NS_STRINGBUNDLE_CONTRACTID);
   nsresult rv = sbs->CreateBundle("chrome://alerts/locale/alert.properties", getter_AddRefs(bundle));
 
   if (!hostPort.IsEmpty()) {
     const char16_t* formatStrings[] = { hostPort.get() };
     nsXPIDLString notificationSource;
-    bundle->FormatStringFromName(NS_LITERAL_STRING("source.label").get(),
+    bundle->FormatStringFromName(MOZ_UTF16("source.label"),
                                  formatStrings,
                                  ArrayLength(formatStrings),
                                  getter_Copies(notificationSource));
     notification.subtitle = nsCocoaUtils::ToNSString(notificationSource);
   }
 
   notification.informativeText = nsCocoaUtils::ToNSString(aAlertText);
   notification.soundName = NSUserNotificationDefaultSoundName;
   notification.hasActionButton = NO;
 
   // If this is not an application/extension alert, show additional actions dealing with permissions.
   if (nsAlertsUtils::IsActionablePrincipal(aPrincipal)) {
     if (NS_SUCCEEDED(rv)) {
       nsXPIDLString closeButtonTitle, actionButtonTitle, disableButtonTitle, settingsButtonTitle;
-      bundle->GetStringFromName(NS_LITERAL_STRING("closeButton.title").get(),
+      bundle->GetStringFromName(MOZ_UTF16("closeButton.title"),
                                 getter_Copies(closeButtonTitle));
-      bundle->GetStringFromName(NS_LITERAL_STRING("actionButton.label").get(),
+      bundle->GetStringFromName(MOZ_UTF16("actionButton.label"),
                                 getter_Copies(actionButtonTitle));
       if (!hostPort.IsEmpty()) {
         const char16_t* formatStrings[] = { hostPort.get() };
-        bundle->FormatStringFromName(NS_LITERAL_STRING("webActions.disableForOrigin.label").get(),
+        bundle->FormatStringFromName(MOZ_UTF16("webActions.disableForOrigin.label"),
                                      formatStrings,
                                      ArrayLength(formatStrings),
                                      getter_Copies(disableButtonTitle));
       }
-      bundle->GetStringFromName(NS_LITERAL_STRING("webActions.settings.label").get(),
+      bundle->GetStringFromName(MOZ_UTF16("webActions.settings.label"),
                                 getter_Copies(settingsButtonTitle));
 
       notification.hasActionButton = YES;
       notification.otherButtonTitle = nsCocoaUtils::ToNSString(closeButtonTitle);
       notification.actionButtonTitle = nsCocoaUtils::ToNSString(actionButtonTitle);
       [(NSObject*)notification setValue:@(YES) forKey:@"_showsButtons"];
       [(NSObject*)notification setValue:@(YES) forKey:@"_alwaysShowAlternateActionMenu"];
       [(NSObject*)notification setValue:@[
--- a/widget/cocoa/nsFilePicker.mm
+++ b/widget/cocoa/nsFilePicker.mm
@@ -116,17 +116,17 @@ NSView* nsFilePicker::GetAccessoryView()
   NSString* label = @"Format:";
 
   // Try to get the localized string.
   nsCOMPtr<nsIStringBundleService> sbs = do_GetService(NS_STRINGBUNDLE_CONTRACTID);
   nsCOMPtr<nsIStringBundle> bundle;
   nsresult rv = sbs->CreateBundle("chrome://global/locale/filepicker.properties", getter_AddRefs(bundle));
   if (NS_SUCCEEDED(rv)) {
     nsXPIDLString locaLabel;
-    bundle->GetStringFromName(NS_LITERAL_STRING("formatLabel").get(),
+    bundle->GetStringFromName(MOZ_UTF16("formatLabel"),
 			      getter_Copies(locaLabel));
     if (locaLabel) {
       label = [NSString stringWithCharacters:reinterpret_cast<const unichar*>(locaLabel.get())
                                       length:locaLabel.Length()];
     }
   }
 
   // set up label text field