Commit Graph
73 Commits
Author SHA1 Message Date
Daniel Holbert fe6ee9a068 Bug 2043345: Use MakeRefPtr to do allocation for various RefPtr variables in widget/android. r=geckoview-reviewers,hiro
Differential Revision: https://phabricator.services.mozilla.com/D302957
2026-05-29 03:43:06 +00:00
pstanciu e8aa1cc58d Revert "Bug 1971997 - Make Request head const r=necko-reviewers,jesupi" for causing causing mocitest http3 failures @ test_XHRSendData.html
This reverts commit fc09852690.

Revert "Bug 1971997 - HTTP/2 and HTTP/3 should not reparse the headers. r=necko-reviewers,geckoview-reviewers,extension-reviewers,devtools-reviewers,jesup,robwu,nalexander,bomsy"

This reverts commit ae6a9de29b.
2026-04-28 19:13:05 +00:00
Valentin Gosu ae6a9de29b Bug 1971997 - HTTP/2 and HTTP/3 should not reparse the headers. r=necko-reviewers,geckoview-reviewers,extension-reviewers,devtools-reviewers,jesup,robwu,nalexander,bomsy
Before this change, HTTP/2/3 requests took an awkward round trip:

- The channel built nsHttpRequestHead (name/value pairs).
- It serialized that into a flat HTTP/1.1-style text buffer (mReqHeaderBuf) — start line, CRLF-separated headers, terminator.
- Http2Compressor::EncodeHeaderBlock then text-parsed that flat buffer back into name/value pairs to feed HPACK/QPACK.

This commit does the following:

Http2Compressor::EncodeHeaderBlock signature flipped — instead of a flat const nsCString& nvInput, it now takes explicit method/path/host/scheme/protocol pseudo-header values and an nsHttpRequestHead*. The text-parsing loop (Find \r\n,
Find :, slice, tolower, etc.) is gone; it iterates requestHead->Headers() directly under the head's RecursiveMutex. Same rewrite on the HTTP/3 side in NeqoHttp3Conn + neqo_glue/src/lib.rs.

nsHttpTransaction storage lazy-fied. nsCString mReqHeaderBuf (pre-flattened) is replaced with nsCOMPtr<nsIInputStream> mHeaderStream + a mHeadersSerialized flag. For HTTP/2/3 the buffer is never built — the compressor reads from
mRequestHead. For HTTP/1.x it's produced on demand in ReadSegments. mThrottleQueue also moves into the transaction.

HttpTransactionShell::Init cleanup. The bool reqBodyIncludesHeaders parameter (an NPAPI-era hack letting callers ship a pre-baked header block embedded in the request body) is removed end-to-end. Dropped from PHttpTransaction.ipdl,
DOMTypes.ipdlh, nsIUploadChannel2.idl, and all call sites.

New accounting hook. HttpTransactionShell::AddRequestHeadersSize(int64_t) — request-size telemetry is no longer derivable from mReqHeaderBuf.Length() so the compressor reports it after encoding.

This change is a prerequisite to fetch upload streaming.

Differential Revision: https://phabricator.services.mozilla.com/D284386
2026-04-28 16:46:04 +00:00
Sylvestre Ledru 4f6b8b516d Bug 2023419 - Remove Emacs/Vim modelines from widget/ r=emilio
replaced by .editorconfig
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D287877
2026-03-16 17:22:02 +00:00
Fatih Kilic b735a19de7 Bug 1947801: Add OHTTP client test. r=valentin,geckoview-reviewers,android-reviewers,ohall
Differential Revision: https://phabricator.services.mozilla.com/D239907
2025-03-31 22:01:49 +00:00
Fatih Kilic 501b14b0ff Bug 1947801: Add OHTTP flag to WebExecutor. r=sfamisa,valentin,geckoview-reviewers,android-reviewers,ohall,jonalmeida,owlish
Differential Revision: https://phabricator.services.mozilla.com/D239906
2025-03-31 22:01:49 +00:00
Goloman Adrian af3036fa8a Backed out 2 changesets (bug 1947801) for causing build bustages @WebExecutorSupport.cpp. CLOSED TREE
Backed out changeset b3f2954096e1 (bug 1947801)
Backed out changeset 605099f124a8 (bug 1947801)
2025-03-31 21:12:19 +03:00
Fatih Kilic 05b61c0bd2 Bug 1947801: Add OHTTP client test. r=valentin,geckoview-reviewers,android-reviewers,ohall
Differential Revision: https://phabricator.services.mozilla.com/D239907
2025-03-31 15:42:34 +00:00
Fatih Kilic 709aa177a0 Bug 1947801: Add OHTTP flag to WebExecutor. r=sfamisa,valentin,geckoview-reviewers,android-reviewers,ohall,jonalmeida,owlish
Differential Revision: https://phabricator.services.mozilla.com/D239906
2025-03-31 15:42:34 +00:00
Makoto Kato aa4499c788 Bug 1586471 - Part 2. Implement nsDragService on GeckoView. r=geckoview-reviewers,amejiamarmol
This implementation supports
- HTML drag & drop API.
- Drop and drop for text/plain or text/html from/to external application.

Differential Revision: https://phabricator.services.mozilla.com/D197330
2024-01-28 07:49:53 +00:00
Tom Schuster 8f9c47f362 Bug 1837153 - Make RFPTarget parameter of ShouldResistFingerprinting with nsIChannel non-optional. r=tjr,cookie-reviewers,timhuang,geckoview-reviewers,owlish
Differential Revision: https://phabricator.services.mozilla.com/D180199
2023-06-13 19:32:17 +00:00
Nika Layzell 2e6ea183a0 Bug 1818305 - Part 2: Add a streamStatus method to nsIInputStream, r=xpcom-reviewers,necko-reviewers,geckoview-reviewers,valentin,jesup,m_kato,mccr8
This is semantically similar to the existing available() method, however will
not block, and doesn't need to do the work to actually determine the number of
available bytes.

As part of this patch, I also fixed one available() implementation which was
incorrectly throwing NS_BASE_STREAM_WOULD_BLOCK.

Differential Revision: https://phabricator.services.mozilla.com/D170697
2023-03-15 19:52:34 +00:00
Valentin Gosu 1b16c04546 Bug 1596845 - Turn nsIDNSService dns flags into a cenum r=necko-reviewers,geckoview-reviewers,kershaw,m_kato
This allows us to use a consistent size for the dnsFlags field.
across different files (previously some would use uint16_t and some uint32_t).
It also improves type safety - making sure we don't pass in the wrong value
to DNSFlags.

Depends on D164856

Differential Revision: https://phabricator.services.mozilla.com/D164857
2022-12-23 09:26:17 +00:00
Marian-Vasile Laza 6fb0160a69 Backed out 9 changesets (bug 1596845) for causing xpcshell failures on test_trr_enterprise_policy.js. CLOSED TREE
Backed out changeset 231acfc052bb (bug 1596845)
Backed out changeset 7d02dad4d720 (bug 1596845)
Backed out changeset b0449eec2671 (bug 1596845)
Backed out changeset 5cd033c9ef7c (bug 1596845)
Backed out changeset 98d583f1d19e (bug 1596845)
Backed out changeset b78bc0049605 (bug 1596845)
Backed out changeset 88919aaff89b (bug 1596845)
Backed out changeset f4adb3e7b8e1 (bug 1596845)
Backed out changeset b171f7ac0b40 (bug 1596845)
2022-12-23 09:21:39 +02:00
Valentin Gosu a6382d6270 Bug 1596845 - Turn nsIDNSService dns flags into a cenum r=necko-reviewers,geckoview-reviewers,kershaw,m_kato
This allows us to use a consistent size for the dnsFlags field.
across different files (previously some would use uint16_t and some uint32_t).
It also improves type safety - making sure we don't pass in the wrong value
to DNSFlags.

Depends on D164856

Differential Revision: https://phabricator.services.mozilla.com/D164857
2022-12-23 01:20:04 +00:00
Sandor Molnar a10fcf6c07 Backed out 9 changesets (bug 1596845) for causing mochitest failures in browser/base/content/test/about/browser_aboutCertError_telemetry.js
Backed out changeset eb1e34c3041f (bug 1596845)
Backed out changeset af6d41439c60 (bug 1596845)
Backed out changeset f1447dd8df04 (bug 1596845)
Backed out changeset a383f2bbcaae (bug 1596845)
Backed out changeset 950c66dd6133 (bug 1596845)
Backed out changeset ab300239fd69 (bug 1596845)
Backed out changeset 8e1fe024b680 (bug 1596845)
Backed out changeset 80e5048d1f35 (bug 1596845)
Backed out changeset b14a4910d73b (bug 1596845)
2022-12-23 00:56:35 +02:00
Valentin Gosu e9b2bc4088 Bug 1596845 - Turn nsIDNSService dns flags into a cenum r=necko-reviewers,geckoview-reviewers,kershaw,m_kato
This allows us to use a consistent size for the dnsFlags field.
across different files (previously some would use uint16_t and some uint32_t).
It also improves type safety - making sure we don't pass in the wrong value
to DNSFlags.

Depends on D164856

Differential Revision: https://phabricator.services.mozilla.com/D164857
2022-12-22 21:16:07 +00:00
Tom Ritter 7a812a40d5 Bug 1770498: Populate the RFP member of CookieJar Settings r=timhuang,geckoview-reviewers,owlish
CookieJarSettings frequently gets populated in a place
where we have ready access to the Document/Channel it
is being constructed for. This lets us populate the boolean
and pass it into CookieJarSetting's constructor easily.

When it is created for LoadInfo, we need to plumb the URI
through by adding it to LoadInfo::CreateForDocument.

Differential Revision: https://phabricator.services.mozilla.com/D150588
2022-07-15 20:39:19 +00:00
Agi Sferro a86ffd5b80 Bug 1750231 - Add WebRequest::beConservative. r=calu,jonalmeida
Differential Revision: https://phabricator.services.mozilla.com/D136387
2022-01-26 20:11:45 +00:00
Agi Sferro 583126f80e Bug 1750239 - Set beConservative by default in GeckoWebExecutor. r=owlish,calu
BeConservative ensures that Gecko will not use bleeding-edge features like
HTTP3 to avoid breaking core browser functionality.

Differential Revision: https://phabricator.services.mozilla.com/D136024
2022-01-14 21:07:16 +00:00
ssummar 96eada1272 Bug 1739367 - Replaces mozilla::Tuple with std::tuple in widget/ r=emilio,geckoview-reviewers,owlish
Differential Revision: https://phabricator.services.mozilla.com/D130356
2021-11-10 12:57:43 +00:00
Tim Huang 56b548589c Bug 1695050 - Part 9: Update the call-site of CookieJarSettings::Create() for WebExecutorSupport. r=esawin
The WebExecutorSupport::CreateStreamLoader() would need the
cookieJarSettings. This patch updates the call-site to pass the correct
enum according to the fact that if the request from the private mode.

Differential Revision: https://phabricator.services.mozilla.com/D109052
2021-03-29 11:01:54 +00:00
owlishDeveloper 949f84f437 Bug 1432949 - Return error if channel cannot be opened. Expand download blob test case r=geckoview-reviewers,snorp
Differential Revision: https://phabricator.services.mozilla.com/D75687
2021-03-09 00:45:22 +00:00
Simon Giesecke 46908cfb51 Bug 1660470 - Add missing include directives/forward declarations. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D87865
2020-11-23 16:21:38 +00:00
owlishDeveloper 577f14c87b Bug 1665426 - Implement fetch flag for private browsing downloads in WebExecutor r=geckoview-reviewers,agi,snorp
Differential Revision: https://phabricator.services.mozilla.com/D93044
2020-10-13 17:59:49 +00:00
Simon Giesecke ab6f0a7137 Bug 1650145 - Replace all value uses of Empty[C]String by 0-length _ns literals. r=froydnj,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D82325
2020-09-23 15:17:15 +00:00
owlishDeveloper 9bd06348f2 Bug 1654722 - Add backend support for new OnExternalResponse API in GV r=geckoview-reviewers,snorp
Differential Revision: https://phabricator.services.mozilla.com/D86617
2020-08-31 17:30:57 +00:00
Valentin Gosu 76eebd4651 Bug 1657582 - Add nsIDNSAddrRecord interface r=necko-reviewers,geckoview-reviewers,snorp,mixedpuppy,dragana
This interface extends nsIDNSRecord and makes the DNS code more extensible
by allowing us to support more record types.
This change does require the consumer to be aware of the type they requested
and to QueryInterface to either nsIDNSAddrRecord for regular IP lookups,
or to nsIDNSByTypeRecord for other kinds of lookups.

Differential Revision: https://phabricator.services.mozilla.com/D86177
2020-08-12 10:49:39 +00:00
Valentin Gosu a3c770dc4b Bug 1657582 - Add nsIDNSResolverInfo interface r=necko-reviewers,geckoview-reviewers,snorp,mixedpuppy,extension-reviewers,dragana
This patch adds the nsIDNSResolverInfo interface which is used to hold
information about the resolver to be used in a DNS resolution.

We use this to merge all of the *WithTRRServer resolve functions into one.
Passing a resolver info will use that object when appropriate. No resolver
info means that we default to using the system resolver, or the default TRR
resolver.

This patch also converts the RESOLVE_TYPE_* flags into a cenum and adds
the resolveType as a parameter to asyncResolve thus removing the need
to have asyncResolveByType methods.

Differential Revision: https://phabricator.services.mozilla.com/D86176
2020-08-12 08:25:14 +00:00
Bogdan Tara d19650bd2d Backed out 2 changesets (bug 1657582) for test_DNSLookup.js failures CLOSED TREE
Backed out changeset 784122a5f5ab (bug 1657582)
Backed out changeset 0f17312b01ad (bug 1657582)
2020-08-12 11:18:06 +03:00
Valentin Gosu ad5a386fd3 Bug 1657582 - Add nsIDNSAddrRecord interface r=necko-reviewers,geckoview-reviewers,snorp,mixedpuppy,dragana
This interface extends nsIDNSRecord and makes the DNS code more extensible
by allowing us to support more record types.
This change does require the consumer to be aware of the type they requested
and to QueryInterface to either nsIDNSAddrRecord for regular IP lookups,
or to nsIDNSByTypeRecord for other kinds of lookups.

Differential Revision: https://phabricator.services.mozilla.com/D86177
2020-08-12 01:35:10 +00:00
Valentin Gosu adf8b12bbe Bug 1657582 - Add nsIDNSResolverInfo interface r=necko-reviewers,geckoview-reviewers,snorp,mixedpuppy,extension-reviewers,dragana
This patch adds the nsIDNSResolverInfo interface which is used to hold
information about the resolver to be used in a DNS resolution.

We use this to merge all of the *WithTRRServer resolve functions into one.
Passing a resolver info will use that object when appropriate. No resolver
info means that we default to using the system resolver, or the default TRR
resolver.

This patch also converts the RESOLVE_TYPE_* flags into a cenum and adds
the resolveType as a parameter to asyncResolve thus removing the need
to have asyncResolveByType methods.

Differential Revision: https://phabricator.services.mozilla.com/D86176
2020-08-12 01:00:39 +00:00
Frederik Braun 617d3006d9 Bug 1366973: Rename security flags to not contain DATA anymore r=geckoview-reviewers,ckerschb,snorp
Differential Revision: https://phabricator.services.mozilla.com/D83490
2020-07-15 11:20:45 +00:00
Aaron Klotz 383ce64df3 Bug 1637452: Part 1 - Fix JNI includes in widget/android; r=geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D75364
2020-05-15 17:04:10 +00:00
owlishDeveloper acf62e138a Bug 1635862 - Add object URI support to WebExecutor r=geckoview-reviewers,snorp
Differential Revision: https://phabricator.services.mozilla.com/D74465
2020-05-11 17:51:05 +00:00
Valentin Gosu 5654646ca2 Bug 1625213 - Make txt records be resolved with onLookupComplete r=dragana
This patch makes nsIDNSByTypeRecord extend nsIDNSRecord, but implementations
will safely forward the nsIDNSRecord methods to `nullptr`, meaning they will
throw an error when called.

Consumers should try to QI the nsIDNSRecord to nsIDNSByTypeRecord (or any
future types) and use that.

Differential Revision: https://phabricator.services.mozilla.com/D69326
2020-04-07 12:39:45 +00:00
Tim Huang 37f162c69d Bug 1616570 - Part 1: Rename CookieSettings to CookieJarSettings. r=Ehsan
Given that we are going to add ContentBlockingAllowList in
CookieSettings, so CookieSettings will be responsible for more stuff than the
cookie behavior and cookie permission. We should use a proper name to
reflect the purpose of it. The name 'CookieSettings' is misleading that
this is only for cookie related stuff. So, we decide to rename
'CookieSettins' to 'CookieJarSettings' which serves better meaning here.

Differential Revision: https://phabricator.services.mozilla.com/D63935
2020-03-04 08:59:08 +00:00
James Willcox 891ff23f16 Bug 1508730 - Add WebRequestError#certificate. r=geckoview-reviewers,droeh,agi
This is useful if you get a certificate-related error and want
to inspect the broken certificate.

Differential Revision: https://phabricator.services.mozilla.com/D58170
2020-01-10 15:24:08 +00:00
James Willcox 435a6c2886 Bug 1508730 - Add WebResponse#certificate r=geckoview-reviewers,droeh,agi
This is the server certificate, if any, as a
java.security.cert.X509Certificate.

Differential Revision: https://phabricator.services.mozilla.com/D58156
2020-01-10 15:09:24 +00:00
James Willcox d160294734 Bug 1508730 - Add WebResponse#isSecure r=geckoview-reviewers,droeh,agi
Differential Revision: https://phabricator.services.mozilla.com/D58155
2020-01-10 15:09:22 +00:00
James Willcox 8680ad7dc1 Bug 1603114 - Ensure Gecko channel is closed with WebResponse body stream. r=geckoview-reviewers,agi
This also fixes a lifetime issue where we may have been leaking the
native instance of `WebResponse.Support`.

Differential Revision: https://phabricator.services.mozilla.com/D56994
2019-12-18 20:22:18 +00:00
Noemi Erli d9b4a548d0 Backed out 3 changesets (bug 1603452, bug 1603114, bug 1577596) for causing lint failure in GeckoSession.java CLOSED TREE
Backed out changeset 1a9be6d049a7 (bug 1577596)
Backed out changeset 11e1f382ea77 (bug 1603114)
Backed out changeset d63c194d1c6c (bug 1603452)
2019-12-18 01:12:37 +02:00
James Willcox e2b194a8ec Bug 1603114 - Ensure Gecko channel is closed with WebResponse body stream. r=geckoview-reviewers,agi
This also fixes a lifetime issue where we may have been leaking the
native instance of `WebResponse.Support`.

Differential Revision: https://phabricator.services.mozilla.com/D56994
2019-12-17 20:59:31 +00:00
Brendan Dahl a348018ff0 Bug 1599957 - Fix intermittent test WebExecutorTest.testFetchStreamError r=snorp
Currently, it's possible for testFetchStreamError to finish receiving data
before the error is received and throws.

Differential Revision: https://phabricator.services.mozilla.com/D56797
2019-12-12 15:29:36 +00:00
Gabriele Svelto f03cdb2b2d Bug 1600545 - Remove useless inclusions of header files generated from IDL files in modules/, netwerk/, parser/, security/, startupcache/, storage/, toolkit/, tools/, uriloader/, widget/, xpcom/ and xpfe/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

Differential Revision: https://phabricator.services.mozilla.com/D55444
2019-12-06 09:17:57 +00:00
James Willcox 4d1fe6c81e Bug 1594905 - Propagate Gecko channel errors to GeckoInputStream r=geckoview-reviewers,esawin
Differential Revision: https://phabricator.services.mozilla.com/D54615
2019-11-27 18:23:05 +00:00
Ciure Andrei fe448971b6 Backed out changeset c4258604bf44 (bug 1594905) for causing linting failure in GeckoWebExecutor.java CLOSED TREE 2019-11-27 19:48:49 +02:00
James Willcox d6c2426f57 Bug 1594905 - Propagate Gecko channel errors to GeckoInputStream r=geckoview-reviewers,esawin
Differential Revision: https://phabricator.services.mozilla.com/D54615
2019-11-27 16:36:47 +00:00
Thomas Nguyen 2b9a6d0f8d Bug 1532318 - Part 2 : update changes of nsIHttpChannel in codebase r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D22786
2019-05-02 12:33:55 +00:00
Sebastian Streich 8d14f5fb41 Bug 1546913 - Remove GetLoadInfo callsites r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D27647
2019-04-25 12:16:35 +00:00