gecko-dev/caps
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
..
tests Bug 1334550 - Part 2 - Add nsISubstitutionObserver and update test_extensionURL.html; r=jimm 2017-06-21 16:13:23 -07:00
BasePrincipal.cpp Bug 1380227 - Avoid many UTF16toUTF8 and UTF8toUTF16 conversions in nsStringBundle. r=emk. 2017-07-12 15:13:37 +10:00
BasePrincipal.h Bug 1369316 - Get rid of nsIPrincipal.unknownAppId, r=bholley 2017-06-02 11:05:28 +02:00
ContentPrincipal.cpp Bug 1353204 - Follow-up: Use entire spec for origin for Thunderbird. r=bz 2017-04-10 14:04:11 +02:00
ContentPrincipal.h Bug 1347817 - Principal must always have a valid origin - part 4 - origin passed as argument when a principal is created, r=bholley 2017-03-29 08:24:01 +02:00
DomainPolicy.cpp bug 1303096 - Stop sending sync messages soon after content process start-up r=billm 2017-02-05 00:52:38 -05:00
DomainPolicy.h Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
ExpandedPrincipal.cpp Bug 1347817 - Principal must always have a valid origin - part 4 - origin passed as argument when a principal is created, r=bholley 2017-03-29 08:24:01 +02:00
ExpandedPrincipal.h Bug 1347817 - Principal must always have a valid origin - part 3 - move origin to BasePrincipal, r=bholley 2017-03-29 08:22:26 +02:00
NullPrincipal.cpp Bug 1346713 - Generate unique firstPartyDomain value for NullPrincipal. r=smaug 2017-04-11 16:48:34 +08:00
NullPrincipal.h Bug 1346713 - Generate unique firstPartyDomain value for NullPrincipal. r=smaug 2017-04-11 16:48:34 +08:00
NullPrincipalURI.cpp Bug 945240 - Make nsIURI.host & variants return ASCII strings r=mcmanus 2017-07-11 19:09:10 +02:00
NullPrincipalURI.h Bug 1343933 - Renaming Principal classes - part 2 - NullPrincipal, r=qdot 2017-03-22 11:38:40 +01:00
OriginAttributes.cpp Bug 1344170: set firstPartyDomai on blob: URI. r=smaug 2017-04-24 14:12:03 +08:00
OriginAttributes.h Bug 1349512 - Move OriginAttributes class in separate files, r=qdot 2017-03-22 18:45:40 +01:00
SystemPrincipal.cpp Bug 1347817 - Principal must always have a valid origin - part 3 - move origin to BasePrincipal, r=bholley 2017-03-29 08:22:26 +02:00
SystemPrincipal.h Bug 1347817 - Principal must always have a valid origin - part 3 - move origin to BasePrincipal, r=bholley 2017-03-29 08:22:26 +02:00
moz.build Bug 1349512 - Move OriginAttributes class in separate files, r=qdot 2017-03-22 18:45:40 +01:00
nsIAddonPolicyService.idl Bug 1308640 bypass TP when addon has explicit permission to url, r=bz,kmag,mrbkap 2017-02-09 21:08:06 -08:00
nsIDomainPolicy.idl bug 1303096 - Stop sending sync messages soon after content process start-up r=billm 2017-02-05 00:52:38 -05:00
nsIPrincipal.idl Bug 1369316 - Get rid of nsIPrincipal.unknownAppId, r=bholley 2017-06-02 11:05:28 +02:00
nsIScriptSecurityManager.idl Bug 1369323 - Get rid of nsScriptSecurityManager::GetNoAppCodebasePrincipal, r=bholley 2017-06-02 11:05:28 +02:00
nsJSPrincipals.cpp Bug 1340163 - Introducing originNoSuffix as attribute in ContentPrincipalInfo, r=smaug 2017-03-20 16:03:45 +01:00
nsJSPrincipals.h Bug 1297300 - Add missing checks to GetSpec() calls in caps/ and js/. r=mrbkap. 2016-08-30 14:22:04 +10:00
nsScriptSecurityManager.cpp Bug 1380227 - Avoid many UTF16toUTF8 and UTF8toUTF16 conversions in nsStringBundle. r=emk. 2017-07-12 15:13:37 +10:00
nsScriptSecurityManager.h Bug 1380227 - Avoid many UTF16toUTF8 and UTF8toUTF16 conversions in nsStringBundle. r=emk. 2017-07-12 15:13:37 +10:00