Callers already store the return value in UniquePtr, so callsites don't need
updating. This patch is just enforcing that callers do this, while also
properly tracking ownership from the moment the object is allocated.
Differential Revision: https://phabricator.services.mozilla.com/D305973
This reverts commit 4cb63eb70c.
Revert "Bug 1465074 - Let ServiceWorker intercepts range requests. r=hsingh"
This reverts commit 0fa2e5d3c8.
Revert "Bug 1465074 - Return NetworkError while get a ranged response but not requested by a ranged request. r=hsingh"
This reverts commit 49cabcd364.
Revert "Bug 1465074 - Only remove privileged nocors request headers if RequestInit memebers presented in Request::Constructor. r=hsingh"
This reverts commit a6087fb37b.
This patch moves relevant APIs that interact with the channel to a
separate ClassifierChannelUtils class from the URLClassifierCommon.
The ClassifierChannelUtils shares between the UrlClassifier and
the ContentClassifier.
Differential Revision: https://phabricator.services.mozilla.com/D301027
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
By doing this during the fetch, we can remove an additional codepath which was
depending on being able to read any BlobURL directly from the content process.
This allows the Blob's size to not need to be checked until after the BlobImpl
has been fetched from the parent process.
This patch also moves the content range logic out of nsIBaseChannel and into
BlobURLChannel, as this logic only applies to BlobURL, and not to other
nsBaseChannel subclasses.
Differential Revision: https://phabricator.services.mozilla.com/D276060
This requires some changes to the various places which currently directly read
the BlobImpl from the BlobURLChannel.
This requires a change to how MediaResource handles Blob URL loads, as the
existing code was avoiding creating a BlobURLChannel entirely when loading a
Blob URL. This could be improved in the future in a similar manner to how
HTTP(s) URLs are handled for ChannelMediaResource, but that was left as
out-of-scope for this bug.
Differential Revision: https://phabricator.services.mozilla.com/D276059
This reverts commit 47367770c3.
Revert "Bug 2005247 - Part 3: Always read BlobURL info over IPC, r=asuth"
This reverts commit df37ac38f8.
Revert "Bug 2005247 - Part 2: Validate BlobURL ContentLength header during channel fetch, r=asuth,necko-reviewers,valentin"
This reverts commit 45e63e6920.
Revert "Bug 2005247 - Part 1: Get the BlobImpl from the BlobURLChannel, r=asuth,media-playback-reviewers,padenot"
This reverts commit 440a33211b.
Revert "Bug 2005002 - Part 5: sec-fetch-storage-access not implemented for workers, r=manuel"
This reverts commit 5654faf8a0.
Revert "Bug 2005002 - Part 4: Fix devtools tests for blob: URL dedicated worker changes, r=devtools-reviewers,ochameau"
This reverts commit 9c9c197990.
Revert "Bug 2005002 - Part 3: Extension content scripts for Blob URLs no longer match with full paths, r=extension-reviewers,robwu"
This reverts commit 55f399175f.
Revert "Bug 2005002 - Part 2: Infer Blob URL principal from URL when possible, r=asuth,extension-reviewers,necko-reviewers,home-newtab-reviewers,robwu,mconley,kershaw,bvandersloot"
This reverts commit d3022ec470.
Revert "Bug 2005002 - Part 1: Support do_QueryObject for nsSimpleURI and subclasses, r=necko-reviewers,valentin,asuth"
This reverts commit 3d1199b4d4.
By doing this during the fetch, we can remove an additional codepath which was
depending on being able to read any BlobURL directly from the content process.
This allows the Blob's size to not need to be checked until after the BlobImpl
has been fetched from the parent process.
This patch also moves the content range logic out of nsIBaseChannel and into
BlobURLChannel, as this logic only applies to BlobURL, and not to other
nsBaseChannel subclasses.
Differential Revision: https://phabricator.services.mozilla.com/D276060
This requires some changes to the various places which currently directly read
the BlobImpl from the BlobURLChannel.
This requires a change to how MediaResource handles Blob URL loads, as the
existing code was avoiding creating a BlobURLChannel entirely when loading a
Blob URL. This could be improved in the future in a similar manner to how
HTTP(s) URLs are handled for ChannelMediaResource, but that was left as
out-of-scope for this bug.
Differential Revision: https://phabricator.services.mozilla.com/D276059
This patch updates InternalRequest and InternalResponse such that it parses the
URL passed to it at creation time, rather than when the channel is created.
This should improve the behaviour of these types around Blob URLs, so that
extra state, such as the "revoked" flag, is calculated at the correct time
as-per spec.
While making this change, I noticed that a previous Cache DB migration could
insert an "" URL in the DB when migrating from a single response URL to a URL
list, rather than storing an empty URL list. The choice was made to do
filtering when reading, rather than performing a migration, to avoid migration
first-time start-up overhead.
Differential Revision: https://phabricator.services.mozilla.com/D276047
The changeset has been generated automatically through:
./mach static-analysis check --output ./clang-tidy-bugprone.json --format json --fix
followed by manual adjustment when needed or when the auto-fixer bailed out.
This paves the way for Bug 2023527
Differential Revision: https://phabricator.services.mozilla.com/D287941
The changeset has been generated automatically through:
./mach static-analysis check --output ./clang-tidy-bugprone.json --format json --fix
followed by manual adjustment when needed or when the auto-fixer bailed out.
This paves the way for Bug 2023527
Differential Revision: https://phabricator.services.mozilla.com/D287941
Changes name of "WorkerAssociatedBrowsingContext" in LoadInfo to just
"AssociatedBrowsingContext" to signal it's somewhat broader use case.
For reporting api, to show up in dev tools, we need dev tooling to match
against the channel and for that it needs a browsing context id (or
something similar). We set the associated bc id and then try matching
against that in NetworkUtils.sys.mjs.
Differential Revision: https://phabricator.services.mozilla.com/D283896
Commit automatically generated through clang-tidy's
performance-use-std-move new pass.
- Maybe type has a dedicated move operator
- And TimingParams also have a dedicated move operator because of Maybe
members
- OwningAnimationTarget benefits from being moved
- nsCOMPtr benefits from being moved
- std::vector benefits from being moved
- std::string benefits from being moved
- SMILTimeValueSpecParams benefits from being moved
Differential Revision: https://phabricator.services.mozilla.com/D285674
Commit automatically generated through clang-tidy's
performance-use-std-move new pass.
- Maybe type has a dedicated move operator
- And TimingParams also have a dedicated move operator because of Maybe
members
- OwningAnimationTarget benefits from being moved
- nsCOMPtr benefits from being moved
- std::vector benefits from being moved
- std::string benefits from being moved
- SMILTimeValueSpecParams benefits from being moved
Differential Revision: https://phabricator.services.mozilla.com/D285674
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.
In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.
One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.
Most of the heavy lifting was done through:
$ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
$ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'
Differential Revision: https://phabricator.services.mozilla.com/D268706
Most changes are automated. Relevant bit is dom/.clang-format. I had to
manually disable clang-format in a few places where importing external
files and so on that aren't self-contained, and fix a couple includes /
forward declarations.
Differential Revision: https://phabricator.services.mozilla.com/D256800
I checked every `HttpBaseChannel::SetupReplacementChannel` call (including calls to overrides) and we always create a copy of the existing loadinfo, usually with `CloneLoadInfoForRedirect`, except for TRR, it just calls `TRRLoadInfo::Clone`.
Differential Revision: https://phabricator.services.mozilla.com/D255316
This reverts commit efd9a5ba48.
Revert "Bug 1968644 - Part 9: Add more tests for loads triggered by tracking scripts. r=valentin,anti-tracking-reviewers,emz"
This reverts commit 7d5c3e1c1c.
Revert "Bug 1968644 - Part 8: Populate the triggeringFirstPartyClassificationFlags and triggeringThirdPartyClassificationFlags for WebSocket requests. r=valentin,necko-reviewers"
This reverts commit 53a783a51e.
Revert "Bug 1968644 - Part 7: Add tests. r=necko-reviewers,anti-tracking-reviewers,emz,valentin"
This reverts commit e52f034955.
Revert "Bug 1968644 - Part 6: Populate triggeringFirstPartyClassificationFlags and triggeringThirdPartyClassificationFlags during channel creation. r=necko-reviewers,kershaw"
This reverts commit f564c21b37.
Revert "Bug 1968644 - Part 5: Populate triggeringFirstPartyClassificationFlags and triggeringThirdPartyClassificationFlags for CSS loads. r=emilio"
This reverts commit 8a8fd7bacc.
Revert "Bug 1968644 - Part 4: Populate triggeringFirstPartyClassificationFlags and triggeringThirdPartyClassificationFlags for loads. r=smaug,necko-reviewers"
This reverts commit 7b3ba3b668.
Revert "Bug 1968644 - Part 3: Populate the triggeringFirstPartyClassificationFlags and triggeringThirdPartyClassificationFlags for fetch requests. r=valentin,smaug"
This reverts commit 08f090244f.
Revert "Bug 1968644 - Part 2: Intorduce the ClassificationFlags to nsIClassifiedChannel.idl. r=dimi,necko-reviewers,valentin"
This reverts commit b8c01cd77c.
Revert "Bug 1968644 - Part 1: Introduce triggeringFirstPartyClassificationFlags and triggeringThirdPartyClassificationFlags to LoadInfo. r=necko-reviewers,kershaw"
This reverts commit a7619a72b4.
The referrer info is more directly what we want (what triggered this
load).
I could add this information for non-http channels, but I think it's
probably not worth it. This is useful because it's thread-safe, which
allows me to support off-main-thread parsing of stylesheets that contain
SRI metadata.
It also simplifies the API and avoids getting URIs around in non-error
code paths.
Differential Revision: https://phabricator.services.mozilla.com/D238612
We need to propagate the isOn3PCBExceptionList flag from the nsILoadInfo
to workers so that the requests from workers can have the flag to exempt
third-party cookie blocking. We will also tackle the fetch request in
the worker scope in the patch.
Depends on D223380
Differential Revision: https://phabricator.services.mozilla.com/D223936
We need to propagate the isOn3PCBExceptionList flag from the nsILoadInfo
to workers so that the requests from workers can have the flag to exempt
third-party cookie blocking. We will also tackle the fetch request in
the worker scope in the patch.
Depends on D223380
Differential Revision: https://phabricator.services.mozilla.com/D223936