gecko-dev/widget/cocoa
Nicholas Nethercote c86dc10505 Bug 1380227 - Avoid many UTF16toUTF8 and UTF8toUTF16 conversions in nsStringBundle. r=emk.
Most of the names passed to nsIStringBundle::{Get,Format}StringFromUTF8Name
have one of the two following forms:

- a 16-bit C string literal, which is then converted to an 8-bit string in
  order for the lookup to occur;

- an 8-bit C string literal converted to a 16-bit string, which is then
  converted back to an 8-bit string in order for the lookup to occur.

This patch introduces and uses alternative methods that can take an 8-bit C
string literal, which requires changing some signatures in other methods and
functions. It replaces all C++ uses of the old methods.

The patch also changes the existing {Get,Format}StringFromName() methods so
they take an AUTF8String argument for the name instead of a wstring, because
that's nicer for JS code.

Even though there is a method for C++ code and a different one for JS code,
|binaryname| is used so that the existing method names can be used for the
common case in both languages.

The change reduces the number of NS_ConvertUTF8toUTF16 and
NS_ConvertUTF16toUTF8 conversions while running Speedometer v2 from ~270,000 to
~160,000. (Most of these conversions involved the string
"deprecatedReferrerDirective" in nsCSPParser.cpp.)

--HG--
extra : rebase_source : 3bee57a501035f76a81230d95186f8c3f460ff8e
2017-07-12 15:13:37 +10:00
..
crashtests Backed out changeset bbb688fe1ba3 (bug 1365614) 2017-05-22 15:45:31 +02:00
cursors
resources/MainMenu.nib
ComplexTextInputPanel.h
ComplexTextInputPanel.mm
CustomCocoaEvents.h
GfxInfo.h
GfxInfo.mm
moz.build Bug 1355089 - add BUG_COMPONENT to widget/* files. r=mstange,jimm 2017-04-14 05:54:36 -04:00
mozView.h
NativeKeyBindings.h Bug 1339543 part 4 Change nsIWidget::ExecuteNativeKeyBinding() to nsIWidget::GetEditCommands() which just retrieves edit commands for the type r=smaug 2017-05-19 17:49:41 +09:00
NativeKeyBindings.mm Bug 1339543 part 4 Change nsIWidget::ExecuteNativeKeyBinding() to nsIWidget::GetEditCommands() which just retrieves edit commands for the type r=smaug 2017-05-19 17:49:41 +09:00
nsAppShell.h
nsAppShell.mm Bug 1372599 - Only turn off CGEvent logging on buggy versions of OSX to avoid delays in first paint. r=mstange 2017-07-06 23:31:00 -04:00
nsBidiKeyboard.h
nsBidiKeyboard.mm
nsChangeObserver.h
nsChildView.h Bug 1377591 - Make nsCocoaWindow and nsChildView 'final' to devirtualize some calls. r=mstange 2017-07-05 02:01:45 +02:00
nsChildView.mm Bug 1377314 - Replace ImageKey when image size is changed r=kats 2017-07-04 11:56:04 +09:00
nsClipboard.h Bug 1358075: Generate UTI types dynamically when needed for the new drag & drop APIs on OSX. r=mstange 2017-05-23 00:23:38 -04:00
nsClipboard.mm Bug 1368077: Strip page titles from URLs on the pasteboard when dragging on OSX/macOS. r=mstange 2017-05-26 11:45:28 -04:00
nsCocoaDebugUtils.h
nsCocoaDebugUtils.mm
nsCocoaFeatures.h Bug 1331683 - Don't attempt to use any Core Text and Core Graphics variation-font APIs on pre-Sierra systems. r=jrmuizel,lsalzman 2017-02-09 21:37:24 +00:00
nsCocoaFeatures.mm Bug 1331683 - Don't attempt to use any Core Text and Core Graphics variation-font APIs on pre-Sierra systems. r=jrmuizel,lsalzman 2017-02-09 21:37:24 +00:00
nsCocoaUtils.h Bug 1313977 - Don't round fractional mouse coordinates up, because doing so might push them outside the window. r=kats 2017-04-15 11:02:09 -04:00
nsCocoaUtils.mm Bug 1323912 - Part 2. Pass opacity down to imgIContainer::Draw. r=mstange 2017-01-03 13:53:22 +08:00
nsCocoaWindow.h Bug 1331932 - Suppress window animations while we're restoring window dimension. r=mikedeboer,jimm,mstange 2017-06-22 14:27:05 +07:00
nsCocoaWindow.mm Bug 1331932 - Suppress window animations while we're restoring window dimension. r=mikedeboer,jimm,mstange 2017-06-22 14:27:05 +07:00
nsColorPicker.h
nsColorPicker.mm Bug 1293593: Fix crash due to an Objective-C exception when calling getRed:green:blue:alpha on an NSColor instance with an incompatible NSColorSpace. r=mstange 2016-08-19 23:17:58 -04:00
nsCursorManager.h
nsCursorManager.mm
nsDeviceContextSpecX.h Bug 1309272, part 8 - Implement printing via Skia PDF for macOS (behind pref print.print_via_pdf_encoder=skia-pdf). r=lsalzman 2016-11-29 07:55:19 +00:00
nsDeviceContextSpecX.mm Bug 1366744 - Fix wrong PaperSizeUnit handling. r=haik 2017-05-25 22:11:08 +09:00
nsDragService.h Bug 1330470: Restore ability to drag & drop entries from the download list to Finder on OSX. r=mstange 2017-05-23 00:23:47 -04:00
nsDragService.mm Bug 1088760 - Remove nsRenderingContext, replacing all of its uses with gfxContext. r=jwatt,jrmuizel 2017-06-13 11:00:10 -04:00
nsFilePicker.h
nsFilePicker.mm Bug 1380227 - Avoid many UTF16toUTF8 and UTF8toUTF16 conversions in nsStringBundle. r=emk. 2017-07-12 15:13:37 +10:00
nsIdleServiceX.h
nsIdleServiceX.mm
nsLookAndFeel.h Bug 1377348 - Make nsLookAndFeel final to allow the compiler to devirtualize some calls. r=tn 2017-06-30 03:34:15 +02:00
nsLookAndFeel.mm Bug 531078 - Use MacOS system color for selected text background in inactive windows. r=mstange. 2016-11-15 20:38:22 +01:00
nsMacCursor.h
nsMacCursor.mm
nsMacDockSupport.h
nsMacDockSupport.mm Bug 1377222 - Eliminate nsITimer::InitWithFuncCallback in favor of InitWithNamedFuncCallback (r=froydnj) 2017-07-03 16:19:56 -07:00
nsMacWebAppUtils.h
nsMacWebAppUtils.mm
nsMenuBarX.h Bug 429824: Let OSX's native menu system handle keyboard shortcuts that we did not handle ourselves via XBL prototype handlers. This allows for handling of custom shortcuts, but does not allow for reassignment of existing shortcuts. r=mstange 2017-05-15 22:59:28 -04:00
nsMenuBarX.mm Bug 1380227 - Avoid many UTF16toUTF8 and UTF8toUTF16 conversions in nsStringBundle. r=emk. 2017-07-12 15:13:37 +10:00
nsMenuBaseX.h
nsMenuGroupOwnerX.h
nsMenuGroupOwnerX.mm
nsMenuItemIconX.h Bug 1319908 - Load the menu icons for the bookmarks menu with the correct content type and principal on OSX; r=baku 2017-01-20 10:55:23 -05:00
nsMenuItemIconX.mm Bug 1348050 - Part 3: Mark channel as urgent-start for loading image. r=baku,mayhemer 2017-04-25 09:17:38 +08:00
nsMenuItemX.h
nsMenuItemX.mm
nsMenuUtilsX.h
nsMenuUtilsX.mm Bug 1251198 - Remove various obsolete events from document.createEvent r=smaug 2017-04-20 15:45:37 +03:00
nsMenuX.h
nsMenuX.mm Bug 1292527: Make OSX application menu localizable at runtime. r=mstange 2016-11-29 21:22:13 -05:00
nsNativeThemeCocoa.h Bug 1088760 - Remove nsRenderingContext, replacing all of its uses with gfxContext. r=jwatt,jrmuizel 2017-06-13 11:00:10 -04:00
nsNativeThemeCocoa.mm Bug 1377169 - Turn gfxRect into a typedef. r=jrmuizel 2017-07-05 11:22:00 -04:00
nsNativeThemeColors.h
nsPIWidgetCocoa.idl Bug 1294553 - Don't pretend that nsCocoaWindow is an interface in nsPIWidgetCocoa.idl, r=mstange 2016-08-11 17:56:10 -04:00
nsPrintDialogX.h Bug 1293117 (part 4) - Change many NS_IMETHODIMP occurrences to NS_IMETHOD. r=froydnj. 2016-08-08 10:54:47 +10:00
nsPrintDialogX.mm Bug 1380227 - Avoid many UTF16toUTF8 and UTF8toUTF16 conversions in nsStringBundle. r=emk. 2017-07-12 15:13:37 +10:00
nsPrintOptionsX.h Bug 1303051 - Printing Issue: Page Setup not being respected since upgrade to 48.01 on Mac; r=mconley 2016-11-09 17:37:40 -08:00
nsPrintOptionsX.mm Bug 1194751 - Part 8. Implement ScreenHelperCocoa and delete old nsScreenManagerCocoa/nsScreenCocoa. r=mstange 2017-03-09 19:34:49 +08:00
nsPrintSettingsX.h Bug 1366744 - Remove needless SetPaperSizeUnit override. r=haik 2017-06-07 14:24:05 +09:00
nsPrintSettingsX.mm Bug 1366744 - Remove needless SetPaperSizeUnit override. r=haik 2017-06-07 14:24:05 +09:00
nsSandboxViolationSink.h
nsSandboxViolationSink.mm Bug 1302163 - Change code to use SprintfLiteral instead of snprintf. r=ehsan 2016-10-04 17:57:51 +02:00
nsSound.h
nsSound.mm
nsStandaloneNativeMenu.h
nsStandaloneNativeMenu.mm
nsSystemStatusBarCocoa.h
nsSystemStatusBarCocoa.mm
nsToolkit.h
nsToolkit.mm
nsWidgetFactory.mm Bug 1194751 - Part 8. Implement ScreenHelperCocoa and delete old nsScreenManagerCocoa/nsScreenCocoa. r=mstange 2017-03-09 19:34:49 +08:00
nsWindowMap.h
nsWindowMap.mm
OSXNotificationCenter.h
OSXNotificationCenter.mm Bug 1380227 - Avoid many UTF16toUTF8 and UTF8toUTF16 conversions in nsStringBundle. r=emk. 2017-07-12 15:13:37 +10:00
RectTextureImage.h
RectTextureImage.mm Bug 1362049 - Update the texture target and texture format in MacIOSurface. v5. r=mattwoodrow 2017-05-18 22:59:07 +08:00
ScreenHelperCocoa.h Bug 1356023 - Remove nsIScreenManager.systemDefaultScale. r=jfkthame 2017-04-13 07:20:35 +09:00
ScreenHelperCocoa.mm Bug 1356023 - Remove nsIScreenManager.systemDefaultScale. r=jfkthame 2017-04-13 07:20:35 +09:00
SwipeTracker.h Bug 1256562 part.2 All event dispatchers under widget/cocoa should initialize WidgetEventTime::mTimeStamp with nsCocoaUtils::GetEventTimeStamp() r=mstange,smaug 2016-12-20 20:58:04 +09:00
SwipeTracker.mm Bug 1328832 - And the other one. 2017-01-06 15:30:31 +08:00
TextInputHandler.h Bug 1376417 - part1: IMEInputHandler should notify Cocoa of layout change with [NSTextInputContext invalidateCharacterCoordinates] r=m_kato 2017-06-29 16:03:57 +09:00
TextInputHandler.mm Bug 1377222 - Eliminate nsITimer::InitWithFuncCallback in favor of InitWithNamedFuncCallback (r=froydnj) 2017-07-03 16:19:56 -07:00
VibrancyManager.h Bug 1192053 - Implement NS_THEME_MAC_SOURCE_LIST_SELECTION and NS_THEME_MAC_ACTIVE_SOURCE_LIST_SELECTION. r=mstange. 2016-10-14 22:45:29 +02:00
VibrancyManager.mm Bug 1310808 - Make use of the new 10.12 constant NSVisualEffectMaterialSelection. r=mstange. 2016-10-17 22:45:02 +02:00
ViewRegion.h
ViewRegion.mm
WidgetTraceEvent.mm