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.
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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