0
Commit Graph

25 Commits

Author SHA1 Message Date
Tom Sepez
b55f2f1f5e Remove stray const when passing std::string_view arguments.
These may be remnants from a time before string_view when a const
char* would have made sense. Now the const doesn't matter.

Fully automated change.

Change-Id: I2dfc7ce30a54701639535a4f137dc18e71575fe2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5906184
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1363323}
2024-10-02 21:54:33 +00:00
Avi Drissman
13d20e92ee Use an opaque type for FrameTreeNode IDs, part 14
content/browser bits

Bug: 361344235
Change-Id: I12275a6cb6864da69e7e719032bf43a1756c1744
Include-Ci-Only-Tests: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5836984
Commit-Queue: Nasko Oskov <nasko@chromium.org>
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1351508}
2024-09-05 16:56:30 +00:00
Arthur Sonzogni
0a5d54489f Spanify: content/ (c-array conversions only)
Addresses ~14% of `-WUnsafe-buffer-usage` opt-out in `//content`.
This is a #cleanup.

The patch was initially partially generated by `./tool/clang/spanify`.

This patch applies conversions specifically to c-arrays in `//content`.
Although the `spanify` tool supports broader conversions, this change
intentionally focuses on c-arrays. Several manual fixes were made to
address anonymous struct issues and other edge cases encountered during
the conversion process.

Bug: 342213636, 40285824
Change-Id: I72666faa45a461ea27bb3608beeacc6c9fcd8a63
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5824992
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1349804}
2024-09-02 11:23:35 +00:00
Chris Fredrickson
8ce3679552 Migrate to optional-based GetHeader overload
HttpRequestHeaders::GetHeader has a new overload
which returns an optional instead of using an out-
parameter. I'm migrating callers and will eventually
delete the old version of the method.

This CL was uploaded by git cl split.

R=victortan@chromium.org

Bug: 355451174
Change-Id: Ide41a0bae0452e631ee079ac3cec426e323fb1d1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5749286
Commit-Queue: Victor Tan <victortan@chromium.org>
Auto-Submit: Chris Fredrickson <cfredric@chromium.org>
Reviewed-by: Victor Tan <victortan@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1334897}
2024-07-30 16:31:47 +00:00
Victor Tan
37978c63ed [ReduceAcceptLanguage] Add base language for the HTTP header
To reduce the compatibility risk and increase the changes of
language matching on the server side when reduce Accept-Language, we can keep some work already done in Chrome, which is expanding
the single language in the HTTP request header by adding the base
language from the language-region pair if the language has the
region code.

See: https://docs.google.com/document/d/1Gbkd_oj5A4dkEsA41k5eQqnQDQqhWAFTaa00RhHPjzo/edit?usp=sharing


Change-Id: I306b58b1becbe790ce8c4ea6ccf41ca6eea02b06
Bug: 40233721
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5695965
Commit-Queue: Victor Tan <victortan@chromium.org>
Reviewed-by: David Song <wintermelons@google.com>
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Andrew Williams <awillia@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1328483}
2024-07-16 22:30:15 +00:00
Victor Tan
b64848310b Remove ReduceAcceptLanguage origin trial and add deprecation trial
1. This CL intend to remove the first-party ReduceAcceptLanguage
origin trial which was introduced by https://crrev.com/c/3932979
years ago.

2. To support experiment the ReduceAcceptLanguage, we also add supports
first part and third party deprecation origin trial for this feature.

* Same origin: We support most cases (subresource, iframe, etc) of
same origin deprecation trial. Also, to make the first request work, sites can send the critical-origin-trial header.

* Cross origin: For cross origin iframe deprecation origin trial, site
need to register first-part deprecation origin trial. For subresource, sites can use JavaScript to inject the origin-trial meta tag.

* Same origin redirect: The expected behavior will happen in the second request, e.g. if the first request opt-in the deprecation origin trial, starting the second request we won't send reduced accept-language.

* Cross origin redirect: The deprecation origin trial won't work when a.com redirects to b.com and only a.com opt-in the deprecation origin,
because persistent origin trials only parse and persist tokens for commit origin which is b.com in this case.

Change-Id: Ia1fda573bb0279a4b976a7a3b8455bdcb809fcce
Bug: 334954143
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5582436
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Victor Tan <victortan@chromium.org>
Reviewed-by: Andrew Williams <awillia@chromium.org>
Reviewed-by: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1314865}
2024-06-13 21:06:58 +00:00
Nasko Oskov
ee48dfb4fa Prepare to remove //content/ from unsafe_bufers_paths.txt
Suppress unsafe buffer usage on a file-by-file basis.  Out of
approximately 5850 .cc and .h files only roughly 160 files fail
compilation with the unsafe buffers warning.

Suppress only, by inserting boilerplate into affected files. Do not
re-write any code to work around the issues. Properly fixing each file
will be done in follow-up CLs.

//content/ is not removed from unsafe_bufers_paths.txt file and will be
also done as a follow-up, so it makes potential reverts simpler.

Bug: 342213636
Change-Id: I4a936e63dea95a78951f7bfae6d5487708ae3c0b
AX-Relnotes: n/a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5608913
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Nasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1312393}
2024-06-08 05:13:06 +00:00
Victor Tan
fa65ec7193 [ReduceAcceptLanguage] Skip empty user accept-language prefs
From the existing metric, we can see there is a small number of profile
that user's accept-language is empty, this could cause the DCHECK failed
and result a crash. In this case, we can skip reduce the accept-language
instead of ending with a crash.
Also, ChromeOs had similar crash crbug.com/1151558 related to
AcceptLanguage prefs which marked as won't fixed.

This CL also adds a metric to tracking how often this case can happen when reducing accept-language.


LanguageUsage.AcceptLanguage.Count:
http://uma/p/chrome/timeline_v2?sid=61a87ff670d6e5cc43c62030d34ed552

Change-Id: Iba27af6cbbf9a02c0c4f2c511c58c1abc3d27759
Bug: 337741702
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5506595
Reviewed-by: Andrew Williams <awillia@chromium.org>
Reviewed-by: Clark DuVall <cduvall@chromium.org>
Commit-Queue: Victor Tan <victortan@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1295482}
2024-05-02 15:26:12 +00:00
Alison Gale
59c007a7ad Migrate TODOs referencing old crbug IDs to the new issue tracker IDs
The canonical bug format is TODO(crbug.com/<id>). TODOs of the
following forms will all be migrated to the new format:

- TODO(crbug.com/<old id>)
- TODO(https://crbug.com/<old id>)
- TODO(crbug/<old id>)
- TODO(crbug/monorail/<old id>)
- TODO(<old id>)
- TODO(issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/<old id>)
- TODO(https://issues.chromium.org/u/1/issues/<old id>)
- TODO(bugs.chromium.org/<old id>)

Bug id mapping is sourced from go/chrome-on-buganizer-prod-issues.
See go/crbug-todo-migration for details.

#crbug-todo-migration

Bug: b/321899722
Change-Id: Ifd155bbeff882ea939f74cf8b8f847f42847940b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5468156
Reviewed-by: Darryl James <dljames@chromium.org>
Owners-Override: Alison Gale <agale@chromium.org>
Commit-Queue: Alison Gale <agale@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1290297}
2024-04-20 03:05:40 +00:00
Victor Tan
c4c2ae61d5 [Reduce-Accept-Language] Change Variants to Avail-Language
As the Variants RFC draft is expired, change it to use Avail-Language to
indicate the server side supported languages. Currently no sites use the
Variants header, it's safe to replace before we experiment in canary/dev.

From:
Variants: Accept-Language=(de en jp)

To:
Avail-Language: de, en;d, jp

Refs:
* https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-variants-06#section-2
* https://mnot.github.io/I-D/draft-nottingham-http-availability-hints.html#section-5.3

Change-Id: I5ee44065eaf774c6c971105aee62f63310b11a89
Bug: 40224802
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5410413
Reviewed-by: Joe Mason <joenotcharles@google.com>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Victor Tan <victortan@chromium.org>
Reviewed-by: Andrew Williams <awillia@chromium.org>
Reviewed-by: Clark DuVall <cduvall@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1284635}
2024-04-09 19:28:38 +00:00
Hiroshige Hayashizaki
560e972b34 Remove URLLoaderThrottle::Delegate::RestartWithURLResetAndFlags
Remove `defer` from
`URLLoaderThrottle::BeforeWillProcessResponse` and
`URLLoaderThrottle::BeforeWillRedirectRequest`
as they are not used.
This removes `DEFERRED_BEFORE_RESPONSE` as well.

Remove `URLLoaderThrottle::Delegate::RestartWithURLResetAndFlags`,
and instead signal a restart by setting `RestartWithURLReset` to true
in `BeforeWillProcessResponse` or `BeforeWillRedirectRequest`,
because and to clarify `RestartWithURLReset` can be set only
synchronously within these methods.

Remove `pending_restart_flags_`.
(`RestartWithURLResetAndFlags()` was always called with 0)

Remove `throttle_will_start_original_url_`
(always true when `RestartWithURLResetNow()` is called)

Remove `has_pending_restart_`, and use `RestartWithURLReset` local
variables instead, because Before* methods can no longer defer the
loading and thus restarting is processed immediately.

Bug: 325314722
Change-Id: Ia520d055966d03a2cb402f961afd837b74683796
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5149865
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Lingqi Chi <lingqi@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1263152}
2024-02-21 05:22:20 +00:00
Jeff Yoon
d1328c4408 [buganizer] Migrate DIR_METADATA in content/browser/
Migrate all metadata files for content/browser.

Verify components with http://b/components/{id} or at
go/chrome-on-buganizer-prod-components.

Bug: chromium:1518875
Change-Id: I555b9fe40952a5707e167b3dcbaf2858bbdf1f34
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5284095
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1258966}
2024-02-11 19:24:26 +00:00
Arthur Sonzogni
c686e8f4fd Rename {absl => std}::optional in //content/
Automated patch, intended to be effectively a no-op.

Context:
https://groups.google.com/a/chromium.org/g/cxx/c/nBD_1LaanTc/m/ghh-ZZhWAwAJ?utm_medium=email&utm_source=footer

As of https://crrev.com/1204351, absl::optional is now a type alias for
std::optional. We should migrate toward it.

Script:
```
function replace {
  echo "Replacing $1 by $2"
  git grep -l "$1" \
    | cut -f1 -d: \
    | grep \
      -e "^content" \
    | sort \
    | uniq \
    | grep \
      -e "\.h" \
      -e "\.cc" \
      -e "\.mm" \
      -e "\.py" \
    | xargs sed -i "s/$1/$2/g"
}
replace "absl::make_optional" "std::make_optional"
replace "absl::optional" "std::optional"
replace "absl::nullopt" "std::nullopt"
replace "absl::in_place" "std::in_place"
replace "absl::in_place_t" "std::in_place_t"
replace "\"third_party\/abseil-cpp\/absl\/types\/optional.h\"" "<optional>"
git cl format
```

# Skipping unrelated "check_network_annotation" errors.
NOTRY=True

Bug: chromium:1500249
Change-Id: Icfd31a71d8faf63a2e8d5401127e7ee74cc1c413
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5185537
Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1245739}
2024-01-11 08:36:37 +00:00
Arthur Sonzogni
f6785ec94d Turn FrameTreeNode::frame_tree into raw_ref.
This patch started as a consequence of this comment, where I asked to
remove all multiple meaningless CHECK:
https://chromium-review.googlesource.com/c/chromium/src/+/3862583/118..119/content/browser/renderer_host/frame_tree_node.cc#b869

The `frame_tree` has always been non null. Chrome used to prefer
pointers, even for non null references. This is changing.

By using a raw_ref, we make it clearer what to expect, and we aren't
going to add meaningless CHECK.

Bug: None
Change-Id: I97a5ad4172387d16348b6510c75099edaf3f5228
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4076211
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1079139}
2022-12-05 10:11:50 +00:00
Antonio Sartori
55369fff9d [IdentifiabilityStudy] Report DocumentCreated for child frame empty documents
Initial empty documents are assigned a new UKM source ID in blink.
Previously, this source ID was not propagated to the browser. Hence it
was impossible to attribute metrics reported by such initial empty
documents.

This CL plumbs the UKM source ID for the initial empty document of a
child frame in the CreateChildFrame mojo message, so that the browser
process knows about it and can report an appropriate DocumentCreated
metric for the Identifiability Study.

We explicitly skip reporting the corresponding DocumentCreated event
to UKM in this case, see https://crbug.com/1326431 for more
explanation.

Note that this CL still does not do anything for the initial empty
document of popups. However, in such case, the top-level URL is anyway
about:blank, so attributing those metrics is not super helpful.

Bug: 1326431
Change-Id: I358cdf762bca8925755a9679b33d96660616657d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3934274
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Robert Kaplow <rkaplow@chromium.org>
Reviewed-by: Yue Ru Sun <yrsun@chromium.org>
Commit-Queue: Antonio Sartori <antoniosartori@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1077331}
2022-11-30 09:17:56 +00:00
Ali Hijazi
5812f3cef9 DanglingPtr: Mark all of them as untriaged [10/N]
This patch is a no-op with all the common build flags.

Add the "DanglingUntriaged" raw_ptr annotation. It indicates a raw_ptr
becomes dangling, and it should be triaged/fixed. This will also disable
dangling protection for those pointers, once enabled.

These were identified by running the linux-lacros-rel CQ bot with DPD
activated (both build + runtime here: https://crrev.com/c/3941825)

Bug: 1291138
Change-Id: Id00ef560214bcc3ce1e38fd97e84f1e733586703
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4027920
Commit-Queue: Ali Hijazi <ahijazi@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Owners-Override: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1072127}
2022-11-16 09:48:50 +00:00
Victor Tan
60260cdf3b Support first-party ReduceAcceptLanguage origin trial
Add ReduceAcceptLanguage origin trial support for first party.
This cl also introduces a feature flag to gate access to codes which is
required to the origin trial.

Add a couple of browser_tests covering origin trial in same-origin,
cross-origin redirect cases, the WPT is limited to test the reduce accept-language feature since we can't change the user's accept-language explicitly and we skip reducing when overrides accept-language happens.

Implementation doc: https://docs.google.com/document/d/1RkPDf7DNtcOj4KXeW8wNCuYfto-drnGYST_NvZe3GoY/edit#heading=h.b6kmd248xsy4

Bug: 1323776
Change-Id: Ic7ed9a8d956c7fa4b19169e8833546e37d5c0fa4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3932979
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Victor Tan <victortan@chromium.org>
Reviewed-by: Nathan Eliason <eliason@chromium.org>
Reviewed-by: Clark DuVall <cduvall@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Andrew Williams <awillia@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1068703}
2022-11-08 19:11:33 +00:00
Victor Tan
371f0117a1 Support delegate clears its cache if the user's preferences changed
Address TODO to clear the reduce accept language cache if the user's
preferences changed.

Public explainer: https://github.com/Tanych/accept-language
I2P:
https://groups.google.com/a/chromium.org/g/blink-dev/c/V4FS3zMbZ08/m/gY02lQaeAgAJ
Design doc[Google internal]: https://docs.google.com/document/d/1bDaCMJP9w6VJjlM_5nRO1KxyB2fkV3JRtKkfUS0GJ_Y
Implementation doc: https://docs.google.com/document/d/1RkPDf7DNtcOj4KXeW8wNCuYfto-drnGYST_NvZe3GoY

Bug: 1323776
Change-Id: Icf2a79abfc55f5962c1036e08847662392a9e425
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3900577
Reviewed-by: Charlie Reis <creis@chromium.org>
Reviewed-by: Andrew Williams <awillia@chromium.org>
Commit-Queue: Victor Tan <victortan@chromium.org>
Reviewed-by: Clark DuVall <cduvall@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1064960}
2022-10-28 19:07:37 +00:00
Arthur Hemery
c2f98e3d1b Remove hidden header dependency.
browsing_context_state.h includes browsing_instance.h but would be fine
with just BrowsingInstanceId. This include is used unknowingly
by other files that construct BrowserContext's sometimes without even
importing browsing_context_state.h in the first place.

Replace browsing_instance.h import by browsing_instance_id.h and
add explicit dependencies where needed.

Change-Id: I629af039b886aa0ce37a3faab1007aca24ffbfbe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3926070
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Arthur Hemery <ahemery@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1054176}
2022-10-03 15:37:26 +00:00
Daniel Cheng
284c389485 Create blink::DocumentToken and populate it when a navigation commits.
== Background ==
blink::DocumentToken will be used for features like GPU's pipeline
caching, allowing the cache to be partitioned using storage keys. The
renderer process is considered untrustworthy, but communicates directly
with the GPU process; rather than having the untrustworthy renderer
directly specify a potentially spoofed storage key, it will send a
document token to the GPU process, which will then ask the trustworthy
browser process for the corresponding storage key.

== Implementation details ==
On the browser side, the blink::DocumentToken is bound to the
RenderFrameHostImpl's DocumentAssociatedMetadata; on the renderer side,
the token is bound to the blink::Document.

When creating a new window or child frame, the browser side allocates a
new DocumentToken and also passes that token to the renderer to plumb
through frame initialization.

When committing a new navigation, the browser side allocates a new
DocumentToken on the NavigationRequest and passes that token to the
renderer in the `CommitNavigation()` IPC.

The intended behavior is that blink::DocumentToken changes each time the
Document changes, though there are some exceptions:
- things like javascript: URLs that end up resulting in a new document
  reuse the old DocumentToken: from the perspective of the browser, the
  document has not really changed.
- when processing something like `window.open()`, Blink has a historical
  quirk where it creates the initial empty document and then immediately
  replaces it with a synchronously-completed navigation to about:blank.
  Like javascript: URLs, this also reuses the old DocumentToken: this
  quirk is renderer-internal and invisible to the browser.

There is also a small hack for speculative RenderFrameHosts: committing
a navigation in a speculative RenderFrameHost does not construct a new
DocumentAssociatedMetadata, instead, the DocumentAssociatedMetadata's
token is simply updated. The hope is that there will be minimal other
document-associated data prior to committing a navigation in a
speculative RenderFrameHost, so this quirk will be mostly invisible
outside the //content implementation.

One open question: when navigating away from the initial empty document
and reusing the Window object, should the DocumentToken be reused
instead of generating a new one? Reusing the token would more closely
mirror the lifetime of LocalDOMWindow and allow it to be a logical
replacement for LocalFrameToken in ExecutionContextToken; however,
reuse of the Window object is also one of the weird edge cases in the
HTML standard that would be nice to minimize if possible.

For now, the implementation chooses not to reuse the DocumentToken even
if the LocalDOMWindow would be reused for a navigation from the initial
empty document to another same-origin page (note that this is distinct
from the synchronous re-navigation to about:blank noted above).

Finally, this CL does not add the ability to look up a RenderFrameHost
by DocumentToken yet: this CL is already far too large due to the amount
of boilerplate changes required.

Bug: 1362938
Change-Id: I4431ed4a7a0739905579fd1585b2a42701d84d7d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3849601
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Nate Chapin <japhet@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Nate Chapin <japhet@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1050447}
2022-09-22 23:30:34 +00:00
Peter Kasting
d794054578 Simplify base::ranges::find_if*() invocations: content/
Goal: Slightly simpler and/or more semantically-accurate code.

Bug: none
Change-Id: I0755c5b352eb73699e19cb3382971406358473d1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3900426
Commit-Queue: Dmitry Gozman <dgozman@chromium.org>
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1048179}
2022-09-16 20:01:07 +00:00
Avi Drissman
4e1b7bc33d Update copyright headers in content/
The methodology used to generate this CL is documented in
https://crbug.com/1098010#c34.

No-Try: true
No-Presubmit: true
Bug: 1098010
Change-Id: I8c0f009d16350271f07d8e5e561085822cc9dd27
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3895935
Owners-Override: Avi Drissman <avi@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1047456}
2022-09-15 14:03:50 +00:00
Tom Anderson
740573b24a Fix -Wextra-semi warnings in Chrome (Linux, ChromeOS, Windows)
CC=thakis

Bug: 1355871
Change-Id: I39294aaeed2166b99e7ca5fb26150f13919ceed5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3851944
Owners-Override: Nico Weber <thakis@chromium.org>
Auto-Submit: Thomas Anderson <thomasanderson@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1038999}
2022-08-24 23:05:39 +00:00
Victor Tan
9aa6381a42 4) Add implementation for language negotiation restarts
Implement the Variants and Content-Language response header as a URL
Loader throttle. This restarts/internally redirects the request when it
sees a better user's accept-language available during language
negotiation. For details example: see design docs.

Public explainer: https://github.com/Tanych/accept-language
I2P:
https://groups.google.com/a/chromium.org/g/blink-dev/c/V4FS3zMbZ08/m/gY02lQaeAgAJ
Design doc[Google internal]: https://docs.google.com/document/d/1bDaCMJP9w6VJjlM_5nRO1KxyB2fkV3JRtKkfUS0GJ_Y
Implementation doc[Google internal]:https://docs.google.com/document/d/1iNHwOG_6CDnX0f16SGwWLmZRzmLeJpE8xkkpb1RLZJI


Bug: 1323776
Change-Id: I7eb96393ddbe4d592d8afbaaeffadf9a23da8280
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3703626
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Hao Dong <spdonghao@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1034512}
2022-08-12 16:46:28 +00:00
Victor Tan
10d93aca3b 3) Add implementation of reduce accept language service
Implementation of reduce accept language service delegate in browser
context. Support adding the reduce accept language in http header when
initializing a NavigationRequest. On top of that, this CL also adds a
ContentShell persistency layer for reduce accept language.

Only persist the language of choice for an origin if it differs from the
user’s preferred language. Also, add language negotiation logic to
determine whether a request needs to be resent.

A follow-up Cl will add implementation of resending the request based on
the language negotiation.

Public explainer: https://github.com/Tanych/accept-language
I2P:
https://groups.google.com/a/chromium.org/g/blink-dev/c/V4FS3zMbZ08/m/gY02lQaeAgAJ
Design doc[Google internal]: https://docs.google.com/document/d/1bDaCMJP9w6VJjlM_5nRO1KxyB2fkV3JRtKkfUS0GJ_Y
Implementation doc:https://docs.google.com/document/d/1RkPDf7DNtcOj4KXeW8wNCuYfto-drnGYST_NvZe3GoY


Bug: 1323776
Change-Id: I7fb12a8e803470fc5f1cd0a705ce5530101a46d0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3687391
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Emily Stark <estark@chromium.org>
Reviewed-by: David Dorwin <ddorwin@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Yoav Weiss <yoavweiss@chromium.org>
Reviewed-by: Dominic Farolino <dom@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Luke Halliwell <halliwell@chromium.org>
Reviewed-by: Richard Coles <torne@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1034511}
2022-08-12 16:46:28 +00:00