gecko-dev/dom/security
Henri Sivonen 3edc601325 Bug 1402247 - Use encoding_rs for XPCOM string encoding conversions. r=Nika,erahm,froydnj.
Correctness improvements:

 * UTF errors are handled safely per spec instead of dangerously truncating
   strings.

 * There are fewer converter implementations.

Performance improvements:

 * The old code did exact buffer length math, which meant doing UTF math twice
   on each input string (once for length calculation and another time for
   conversion). Exact length math is more complicated when handling errors
   properly, which the old code didn't do. The new code does UTF math on the
   string content only once (when converting) but risks allocating more than
   once. There are heuristics in place to lower the probability of
   reallocation in cases where the double math avoidance isn't enough of a
   saving to absorb an allocation and memcpy.

 * Previously, in UTF-16 <-> UTF-8 conversions, an ASCII prefix was optimized
   but a single non-ASCII code point pessimized the rest of the string. The
   new code tries to get back on the fast ASCII path.

 * UTF-16 to Latin1 conversion guarantees less about handling of out-of-range
   input to eliminate an operation from the inner loop on x86/x86_64.

 * When assigning to a pre-existing string, the new code tries to reuse the
   old buffer instead of first releasing the old buffer and then allocating a
   new one.

 * When reallocating from the new code, the memcpy covers only the data that
   is part of the logical length of the old string instead of memcpying the
   whole capacity. (For old callers old excess memcpy behavior is preserved
   due to bogus callers. See bug 1472113.)

 * UTF-8 strings in XPConnect that are in the Latin1 range are passed to
   SpiderMonkey as Latin1.

New features:

 * Conversion between UTF-8 and Latin1 is added in order to enable faster
   future interop between Rust code (or otherwise UTF-8-using code) and text
   node and SpiderMonkey code that uses Latin1.

MozReview-Commit-ID: JaJuExfILM9
2018-08-14 14:43:42 +03:00
..
test Bug 1476592 - Remove the cache from nsCSPContext - part 2 - sendViolationReports parameter, r=ckerschb, r=aosmond 2018-08-01 06:35:24 +02:00
ContentVerifier.cpp
ContentVerifier.h
FramingChecker.cpp Bug 1304645: Pass individual CSP errors as categories to web console error messages. r=baku 2018-07-20 19:57:21 +02:00
FramingChecker.h
PolicyTokenizer.cpp Bug 1458504 - Move Tokenizer into it's own file so it can be shared by the CSP Parser and the Feature Policy Parser. r=jkt 2018-05-02 16:36:51 +02:00
PolicyTokenizer.h Bug 1458504 - Move Tokenizer into it's own file so it can be shared by the CSP Parser and the Feature Policy Parser. r=jkt 2018-05-02 16:36:51 +02:00
SRICheck.cpp Bug 1402247 - Use encoding_rs for XPCOM string encoding conversions. r=Nika,erahm,froydnj. 2018-08-14 14:43:42 +03:00
SRICheck.h Bug 1454460 - Hoist SRI helper into Loader.cpp. r=bz 2018-04-17 16:27:09 -07:00
SRILogHelper.h
SRIMetadata.cpp
SRIMetadata.h
moz.build Bug 1458504 - Move Tokenizer into it's own file so it can be shared by the CSP Parser and the Feature Policy Parser. r=jkt 2018-05-02 16:36:51 +02:00
nsCSPContext.cpp Bug 1476592 - Remove the cache from nsCSPContext - part 2 - sendViolationReports parameter, r=ckerschb, r=aosmond 2018-08-01 06:35:24 +02:00
nsCSPContext.h Bug 1476592 - Remove the cache from nsCSPContext - part 1, r=ckerschb 2018-08-01 06:35:21 +02:00
nsCSPParser.cpp Bug 1476820 - Convert some VarCache prefs in dom/security/ to use StaticPrefs. r=ckerschb 2018-07-19 10:43:29 +10:00
nsCSPParser.h Bug 1476820 - Convert some VarCache prefs in dom/security/ to use StaticPrefs. r=ckerschb 2018-07-19 10:43:29 +10:00
nsCSPService.cpp Bug 1476592 - Remove the cache from nsCSPContext - part 2 - sendViolationReports parameter, r=ckerschb, r=aosmond 2018-08-01 06:35:24 +02:00
nsCSPService.h Bug 1476820 - Convert some VarCache prefs in dom/security/ to use StaticPrefs. r=ckerschb 2018-07-19 10:43:29 +10:00
nsCSPUtils.cpp Bug 1474537 - CSP 'self' should translate to 'self' and not be resolved to actual self URI. r=dveditz 2018-07-22 18:08:17 +02:00
nsCSPUtils.h Bug 1304645: Pass individual CSP errors as categories to web console error messages. r=baku 2018-07-20 19:57:21 +02:00
nsContentSecurityManager.cpp Bug 1470295 - Allow save-as download of FTP files on HTTP pages. r=ckerschb 2018-06-21 23:31:13 +02:00
nsContentSecurityManager.h Bug 1404744 - Check for FTP subresource after applying CSP. r=ckerschb 2018-04-06 00:27:02 +02:00
nsMixedContentBlocker.cpp Bug 1304645: Pass individual CSP errors as categories to web console error messages. r=baku 2018-07-20 19:57:21 +02:00
nsMixedContentBlocker.h Bug 1332422 - CSP should not use 'aExtra' to indicate redirects within ContentPolicy, r=ckerschb 2018-07-19 13:25:50 +02:00