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
It doesn't appear these IDL files have had interfaces in them since
before the Netscape import, and were mostly just hanging around
because they contained some IDs needed elsewhere. Move the IDs
somewhere more appropriate and remove files.
MozReview-Commit-ID: AINtTerqHu1
Differential Revision: https://phabricator.services.mozilla.com/D2688
--HG--
extra : moz-landing-system : lando
The way we currently save resource URIs that we discovered by walking the document
isn't guaranteed to be in-order with when we save the documents they came from.
To deduce the correct principal to use to load these subresources, we need to
store it with the resource in the map of URIs we work with.
MozReview-Commit-ID: GNlNuS6TuVV
--HG--
extra : rebase_source : 99982f91971423730aa8661cf66c2dd14e276780
Enforce that callers pass triggering principals through to any persist APIs,
which all delegate to SaveURIInternal.
Also add the missing principal information to the saveURL call in the page
info dialog code, which was triggering crashes in this way.
MozReview-Commit-ID: L9pNE7BxGws
--HG--
extra : rebase_source : 957d765f965aa4f942532c693cae36addd8b781d
This was done automatically replacing:
s/mozilla::Move/std::move/
s/ Move(/ std::move(/
s/(Move(/(std::move(/
Removing the 'using mozilla::Move;' lines.
And then with a few manual fixups, see the bug for the split series..
MozReview-Commit-ID: Jxze3adipUh
* Code in XMLHttpRequestMainThread is converted to set the username and password individually. This is because when the parameters are empty, it ended up calling SetUserPass(":") which always returns an error.
MozReview-Commit-ID: 3cK5HeyzjFE
--HG--
extra : rebase_source : f34400c11245d88648b0ae9c196637628afa9517
* Uses NS_MutateURI in order to call nsIFileURLMutator::SetFile
* After changing the URL to append the correct file extension it also changes
the nsWebBrowserPersist::mURIMap entry to reflect these changes
MozReview-Commit-ID: GCBK5hBurGd
--HG--
extra : rebase_source : 1328bbc94d5ad0aabc340536386834fafbfbbf78
We instead add a templated method NS_MutatorMethod that returns a std::function<nsresult(nsIURIMutator*)> which Apply then calls with mMutator as an argument.
The function returned by NS_MutatorMethod performs a QueryInterface, then calls the passed method with arguments on the result.
MozReview-Commit-ID: Jjqp7gGLG1D
--HG--
extra : rebase_source : f2a17aee7bb66a7ba8652817d43b9aa7ec7ef710
We instead add a templated method NS_MutatorMethod that returns a std::function<nsresult(nsIURIMutator*)> which Apply then calls with mMutator as an argument.
The function returned by NS_MutatorMethod performs a QueryInterface, then calls the passed method with arguments on the result.
MozReview-Commit-ID: Jjqp7gGLG1D
--HG--
extra : rebase_source : 592d13349a8c4627c7ce3146ec592f577b39f3cc
Change all QIs or instanceof checks against nsIDOMHTMLMediaElement to
check against HTMLVideoElement/HTMLAudioElement.
MozReview-Commit-ID: EpywwFGK33C
--HG--
extra : rebase_source : 3eff2df9580074ed0a71c8fa6750d84a4750fde8
Backs out the part of part of changeset a20fbbe7b948 (Bug 1432602) that uses nsIURIMutator instead of calling nsIFileURL::SetFile()
MozReview-Commit-ID: 9mC3fv85pUl