Commit Graph
93 Commits
Author SHA1 Message Date
Sean e1c6b6bd1b Bug 1797846 - Remove network.url.strip-data-url-whitespace pref r=valentin,sunil,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D209433
2024-05-23 09:36:06 +00:00
dylan 11f08c1481 Bug 1873944 - Also parse about and data urls with DefaultURI if starting with '/'. r=necko-reviewers,valentin,rpl
Differential Revision: https://phabricator.services.mozilla.com/D205062
2024-04-15 16:51:00 +00:00
Thomas Wisniewski 70221d18ca Bug 1847358 part 3: add a fullMimeType attribute to nsIBaseChannel and use it to make our Data URI content-type header parsing standards-compliant for XHR and Fetch; r=dlrobertson,necko-reviewers,jesup
Differential Revision: https://phabricator.services.mozilla.com/D203380
2024-03-04 21:34:27 +00:00
Thomas Wisniewski 4a7d5fe2a0 Bug 1847659 - Use the new MimeType parser to parse content-types for response headers; r=kershaw,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D195692
2023-12-25 01:59:14 +00:00
Noemi Erli d40c2eff5a Backed out changeset 433e82386c67 (bug 1847659) for causing failures in script.window.html CLOSED TREE 2023-12-21 21:03:32 +02:00
Thomas Wisniewski 1776aeb0d5 Bug 1847659 - Use the new MimeType parser to parse content-types for response headers; r=kershaw,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D195692
2023-12-21 15:46:29 +00:00
edgul 4e281e2835 Bug 1722328 - Use defaultURI to verify data and javascript schemes with '//' during parsing. r=necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D195891
2023-12-13 13:52:55 +00:00
Jan Varga 272327b326 Bug 1855134 - Move existing MOZ_TRY macros to a dedicated header file; r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D189226
2023-09-28 20:46:07 +00:00
Thomas Wisniewski 1e50108243 Bug 1848903 - only allow ;base64 right before the comma in a data URL; r=kershaw,necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D186401
2023-08-18 04:18:42 +00:00
Thomas Wisniewski 489aea0550 Bug 1845006 - store the fully-serialized MimeType on data url channels so XHR and fetch may use it for content-type response headers, and clean up the data url parsing code to better match the spec. r=kershaw,sunil,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D184713
2023-08-02 23:41:24 +00:00
Narcis Beleuzu 701fed4368 Backed out changeset f96e24bbd71c (bug 1845006) for bustages on nsDataHandler.cpp 2023-08-02 22:39:40 +03:00
Thomas Wisniewski 453464c0ca Bug 1845006 - store the fully-serialized MimeType on data url channels so XHR and fetch may use it for content-type response headers, and clean up the data url parsing code to better match the spec. r=kershaw,sunil,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D184713
2023-08-02 16:33:41 +00:00
Cristina Horotan 8c78774d7d Backed out changeset 8d98996f824c (bug 1845006) for causing build bustage at FetchDriver.cpp CLOSED TREE 2023-08-02 17:22:58 +03:00
Thomas Wisniewski 4faa886152 Bug 1845006 - store the fully-serialized MimeType on data url channels so XHR and fetch may use it for content-type response headers, and clean up the data url parsing code to better match the spec. r=kershaw,sunil,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D184713
2023-08-02 13:39:48 +00:00
nicklas boman 4114a8d7f7 Bug 1724649 - Followup to remove #include plstr.h r=necko-reviewers,xpcom-reviewers,valentin,nika
Differential Revision: https://phabricator.services.mozilla.com/D177690
2023-05-15 14:53:02 +00:00
Nika Layzell 091cb51c2d Bug 1793463 - Part 6: Remove nsIProtocolHandler.{defaultPort,protocolFlags}, r=necko-reviewers,valentin
This removes all implementations of these types. Some implementations in JS
code were also removed in the previous part, when updating tests to use
`Services.io.registerProtocolHandler`.

Code which used to access these members should go through the IOService now
instead.

Differential Revision: https://phabricator.services.mozilla.com/D162805
2022-12-01 15:43:19 +00:00
Marian-Vasile Laza bf84df153e Backed out 7 changesets (bug 1793463) for causing bustages on nsIOService.cpp. CLOSED TREE
Backed out changeset 47c3acb30de2 (bug 1793463)
Backed out changeset 71afe900eb17 (bug 1793463)
Backed out changeset d168599a269e (bug 1793463)
Backed out changeset d0f18d300818 (bug 1793463)
Backed out changeset a116e6f089f2 (bug 1793463)
Backed out changeset eba1123c8b56 (bug 1793463)
Backed out changeset 68a3eb8a3057 (bug 1793463)
2022-12-01 02:30:02 +02:00
Nika Layzell b98575e30b Bug 1793463 - Part 6: Remove nsIProtocolHandler.{defaultPort,protocolFlags}, r=necko-reviewers,valentin
This removes all implementations of these types. Some implementations in JS
code were also removed in the previous part, when updating tests to use
`Services.io.registerProtocolHandler`.

Code which used to access these members should go through the IOService now
instead.

Differential Revision: https://phabricator.services.mozilla.com/D162805
2022-11-30 18:13:43 +00:00
Valentin Gosu b020c98ec7 Bug 1104311 - Stop stripping spaces from data URLs r=necko-reviewers,sunil,jesup
Differential Revision: https://phabricator.services.mozilla.com/D159522
2022-10-31 14:46:00 +00:00
Iulian Moraru 66c275d4a1 Backed out changeset 10883f7ad411 (bug 1104311) for causing wpt failures on data-uri.htm. CLOSED TREE 2022-10-28 17:38:42 +03:00
Valentin Gosu c5a39077a6 Bug 1104311 - Stop stripping spaces from data URLs r=necko-reviewers,sunil,jesup
Differential Revision: https://phabricator.services.mozilla.com/D159522
2022-10-28 09:53:57 +00:00
Cristian Tuns c564b2cb68 Backed out changeset d2922261c8c1 (bug 1104311) for causing build bustages on nsDataHandler.cpp CLOSED TREE 2022-10-27 17:28:03 -04:00
Valentin Gosu 2953b3d18c Bug 1104311 - Stop stripping spaces from data URLs r=necko-reviewers,sunil,jesup
Differential Revision: https://phabricator.services.mozilla.com/D159522
2022-10-27 20:40:04 +00:00
Andrew McCreight 9ebb07c91b Bug 1514936, part 2 - Drop the outer arguments from static components. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D146457
2022-05-17 20:24:19 +00:00
Emilio Cobos Álvarez a229df1443 Bug 1761512 - Remove unneeded special case in nsDataHandler::CreateNewURI. r=dragana,necko-reviewers
NS_NewURI (its only caller) deals with this generically in:

  https://searchfox.org/mozilla-central/rev/3f782c2587124923a37c750b88c5a40108077057/netwerk/base/nsNetUtil.cpp#1832

Differential Revision: https://phabricator.services.mozilla.com/D142099
2022-04-01 11:46:11 +00:00
Valentin Gosu ef5d1a4b16 Bug 1722925 - Avoid unnecessary string copies by nsCString constructor r=necko-reviewers,kershaw CLOSED TREE
Since the Find method does not exist on nsACString, I had to use std::search
to find the "data:" substring in the spec.

Differential Revision: https://phabricator.services.mozilla.com/D122082
2021-08-12 07:40:58 +00:00
Valentin Gosu b559b0c49b Bug 1722925 - Remove NS_MutatorMethod in favor of templated nsIURIMutator::Apply r=necko-reviewers,kershaw
This basically reverts the changes in 5caa81103c00 (bug 1435671). In that bug
we switched from having a templated method to using a templated function
that returned a lambda because the templated method caused a binary size
regression on windows (MSVC). Since Firefox 67 we no longer support MSVC.
Using a lambda also required capturing the arguments by value, so it was
slightly inefficient.

This patch removes NS_MutatorMethod and makes the Apply method a template.
This improves perfomance as we can just pass the arguments to the called
function, without worrying about needing to copy them.
Since MSVC is not supported anymore, and clang and gcc didn't report a
binary size regression, this is a much better solution.

Differential Revision: https://phabricator.services.mozilla.com/D122081
2021-08-12 07:40:58 +00:00
Iulian Moraru d9303dbb1c Backed out 2 changesets (bug 1722925) for causing reftest failures in color_quads. CLOSED TREE
Backed out changeset 95a6eacbef27 (bug 1722925)
Backed out changeset 2e2a98aeca5c (bug 1722925)
2021-08-12 12:22:34 +03:00
Valentin Gosu 0fccb551f6 Bug 1722925 - Avoid unnecessary string copies by nsCString constructor r=necko-reviewers,kershaw
Since the Find method does not exist on nsACString, I had to use std::search
to find the "data:" substring in the spec.

Differential Revision: https://phabricator.services.mozilla.com/D122082
2021-08-12 07:40:58 +00:00
Valentin Gosu 3c32f531f0 Bug 1722925 - Remove NS_MutatorMethod in favor of templated nsIURIMutator::Apply r=necko-reviewers,kershaw
This basically reverts the changes in 5caa81103c00 (bug 1435671). In that bug
we switched from having a templated method to using a templated function
that returned a lambda because the templated method caused a binary size
regression on windows (MSVC). Since Firefox 67 we no longer support MSVC.
Using a lambda also required capturing the arguments by value, so it was
slightly inefficient.

This patch removes NS_MutatorMethod and makes the Apply method a template.
This improves perfomance as we can just pass the arguments to the called
function, without worrying about needing to copy them.
Since MSVC is not supported anymore, and clang and gcc didn't report a
binary size regression, this is a much better solution.

Differential Revision: https://phabricator.services.mozilla.com/D122081
2021-08-12 07:40:58 +00:00
Aaron Klotz 6652e1b678 Bug 1668952: Part 1 - Remove GeckoView-specific limits on URI length from Necko; r=necko-reviewers,valentin
For webcompat reasons, we have determined that we should only limit the length
of URIs in specific cases. We're going to handle this on the GV side instead.

Differential Revision: https://phabricator.services.mozilla.com/D109426
2021-04-09 06:01:58 +00:00
Valentin Gosu 5cf3d4b253 Bug 1696261 - Optimize nsDataHandler and nsSimpleURI::SetSpec to do fewer passes r=necko-reviewers,kershaw
- Rename nsAciiMask.h details:: namespace to asciimask_details so it doesn't clash with ipc/chromium/src/base/task.h
- Add SetSpecAndFilterWhitespace simple URI constructor that filters whitespace instead of just CR/LF.
- Only do one scan of the string in nsSimpleURI::SetPathQueryRefInternal in order to find the end of the path, query & ref.

There are probably more optimizations possible.
In my testing these get me a 1.5x-2x speedup.

Differential Revision: https://phabricator.services.mozilla.com/D107567
2021-04-06 08:37:40 +00:00
Simon Giesecke d2e71d5859 Bug 1648010 - Remove NS_NAMED_LITERAL_CSTRING and NS_NAMED_LITERAL_STRING macros. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80631
2020-07-01 08:42:31 +00:00
Emilio Cobos Álvarez 03cfd95496 Bug 1641245 - Make string comparators not virtual. r=froydnj,necko-reviewers,geckoview-reviewers,jgilbert,agi,valentin
There's no use case for stateful comparators, so they can be just plain
function pointers.

This is used in some hot places like CSS selector matching.

Differential Revision: https://phabricator.services.mozilla.com/D77084
2020-05-27 18:11:12 +00:00
owlishDeveloper c8d6ababa7 Bug 1626687 - Do not handle data URIs larger than 2M on mobile r=necko-reviewers,geckoview-reviewers,valentin,snorp
Differential Revision: https://phabricator.services.mozilla.com/D72955
2020-04-29 18:07:39 +00:00
Emilio Cobos Álvarez 8d28b22e47 Bug 1599843 - nsBaseChannel::Init does nothing. r=valentin
And is not virtual, so has no point in existing.

Differential Revision: https://phabricator.services.mozilla.com/D54983
2019-11-27 20:06:41 +00:00
Valentin Gosu 79914444ad Bug 1579331 - URL constructor fails when input is a data URL without a comma r=baku
Differential Revision: https://phabricator.services.mozilla.com/D45372
2019-09-12 09:24:23 +00:00
Noemi Erli e9ad859292 Backed out changeset d0fb6559c22e (bug 1579331) for failing in browser_contextmenu.js CLOSED TREE 2019-09-11 19:05:35 +03:00
Valentin Gosu b6c2412520 Bug 1579331 - URL constructor fails when input is a data URL without a comma r=baku
Differential Revision: https://phabricator.services.mozilla.com/D45372
2019-09-11 14:03:40 +00:00
Valentin Gosu b5b7df0e54 Bug 1536744 - Remove nsIProtocolHandler.newURI r=baku
Differential Revision: https://phabricator.services.mozilla.com/D30703
2019-05-28 13:49:27 +00:00
Valentin Gosu 0fd86fb6df Bug 1532253 - Add NS_NewURIOnAnyThread r=baku
Differential Revision: https://phabricator.services.mozilla.com/D22137
2019-03-19 15:11:31 +00:00
Valentin Gosu ea3eb469ce Bug 1532324 - Remove manual NS_RELEASE from netwerk/* r=JuniorHsu
Differential Revision: https://phabricator.services.mozilla.com/D22005
2019-03-05 18:43:02 +00:00
Christoph Kerschbaumer 4aebbff842 Bug 1528971: Move newChannel2 being the only implementation within nsIProtocolHandler.idl. r=valentin 2019-02-19 19:20:37 +01:00
Tooru Fujisawa 5ef6d9cc06 Bug 1511393 - Use c-basic-offset: 2 in Emacs mode line for C/C++ code. r=nbp 2018-12-01 04:52:05 +09:00
Sylvestre Ledru e5a134f73a Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset
2018-11-30 11:46:48 +01:00
Valentin Gosu d441e87f5b Bug 1489730 - Allow base64 token to be followed by space r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D5378
2018-09-10 06:24:20 +00:00
Valentin Gosu 21cba055c9 Bug 908413 - Use dom::CMimeType::Parse to extract content type for data URIs r=hsivonen
Depends on D5094

Differential Revision: https://phabricator.services.mozilla.com/D5095
2018-09-07 05:44:49 +00:00
Andrea Marchesini c8b49ba5dd Bug 1446933 - Remove 'using namespace mozilla::net' from BackgroundUtils.h, r=qdot 2018-05-30 21:21:17 +02:00
Andi-Bogdan Postelnicu 99cba2dd23 Bug 1457411 - Update netwerk module to make use of newer methods introduced with c++11 and c++14. r=valentin
MozReview-Commit-ID: 666LNaHyiuQ
2018-04-30 19:46:04 +03:00
Valentin Gosu f2bb2cf231 Bug 1433958 - Change code that sets nsIURI.ref to use nsIURIMutator r=mayhemer
MozReview-Commit-ID: 4caicZFBkcQ
2018-02-26 20:43:46 +01:00