NOTREACHED() and NOTREACHED_IN_MIGRATION() are both CHECK-fatal now.
The former is [[noreturn]] so this CL also performs dead-code removal
after the NOTREACHED().
This CL does not attempt to do additional rewrites of any surrounding
code, like:
if (!foo) {
NOTREACHED();
}
to CHECK(foo);
Those transforms take a non-trivial amount of time (and there are
thousands of instances). Cleanup can be left as an exercise for the
reader.
Bug: 40580068
Change-Id: I80696f361f79908132f9a0e3d8654592f2e37c13
Low-Coverage-Reason: OTHER Should-be-unreachable code
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5951563
Commit-Queue: Peter Boström <pbos@chromium.org>
Reviewed-by: Emilia Paz <emiliapaz@chromium.org>
Reviewed-by: Sam McNally <sammc@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1371865}
This CL cleans up Lacros-specific code in this directory and its
subdirectories by doing the following:
1. Lacros-specific sections are removed from BUILD.gn files.
2. References to is_chromeos_ash in BUILD.gn files are collapsed to
is_chrome. Some blocks are merged as a result.
3. Uses of BUILDFLAG(IS_CHROMEOS_ASH) are collapsed to
BUILDFLAG(IS_CHROMEOS) and some adjacent ifdef blocks are combined.
4. ifdef blocks defined by BUILDFLAG(IS_CHROMEOS_LACROS) are deleted.
Bug: b:354842935
Change-Id: I5e2462314e8ce544353681b78978465d635e4b77
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5894159
Auto-Submit: David Bertoni <dbertoni@chromium.org>
Commit-Queue: David Bertoni <dbertoni@chromium.org>
Reviewed-by: Tim <tjudkins@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1363188}
extensions
This landed earlier as https://crrev.com/c/5837697 but was reverted
because a new override was added in the window of time between the
green trybots and the CQ committing the CL.
Bug: 361344235
Change-Id: I5458fe5936510949ba79f41f06678bd1e7e938d3
Low-Coverage-Reason: LARGE_SCALE_REFACTOR
Include-Ci-Only-Tests: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5837249
Auto-Submit: Avi Drissman <avi@chromium.org>
Reviewed-by: David Bertoni <dbertoni@chromium.org>
Commit-Queue: David Bertoni <dbertoni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1351549}
There are different variations of the ExtensionWebContentsObserver based
on the embedder (i.e., one for Shell and one for Chrome). Instead of
having individual callers know about this distinction, instantiate these
WebContentsObservers through the ExtensionsBrowserClient by introducing
ExtensionsBrowserClient::CreateExtensionWebContentsObserver(). The
ExtensionsBrowserClient already had knowledge of these for the
related GetExtensionWebContentsObserver() method, and this allows more
code to be shared across different build configurations.
This CL should have no behavior change.
Bug: 356905053
Change-Id: I75acd6cb2a0a151d193c596d97509c5b26700910
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5825636
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: David Bertoni <dbertoni@chromium.org>
Commit-Queue: Devlin Cronin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1350962}
We are experimenting with desktop-android configurations for Chrome.
This CL adds the //extensions:test_support target to the experimental
desktop-android build config. This includes lots of test utilities
in //extensions/test, as well as a few test utilities in other
directories. A few of these sources are still not compiled due to
dependencies they have on other pieces (platform apps, guest view, or
other APIs).
This is currently experimental and has no production behavior changes.
Cq-Include-Trybots: luci.chromium.try:android-desktop-arm64-compile-rel,android-desktop-x64-compile-rel
Bug: 356905053
Change-Id: Id3c3b73df13cbc14b55de56ca8e31126e9fcc619
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5789202
Reviewed-by: David Bertoni <dbertoni@chromium.org>
Commit-Queue: Devlin Cronin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1342027}
This was generated by replacing " NOTREACHED()" with
" NOTREACHED_IN_MIGRATION()" and running git cl format.
This prepares for making NOTREACHED() [[noreturn]] alongside
NotReachedIsFatal migration of existing inventory.
Bug: 40580068
Change-Id: I56c9ab2c7720718136317c515d32d7f627272284
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5540271
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Auto-Submit: Peter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1300936}
This updates RegisterNonNetworkSubresourceURLLoaderFactories to only
create an IsolatedWebAppURLLoaderFactory if the requesting origin is
an Isolated App, and adds a parameter to IsolatedWebAppURLLoaderFactory
to let it optionally be locked to a specific app so an IWA can only
request resources from its own bundle.
IsolatedWebAppURLLoaderFactory created for navigations aren't
locked to a specific origin as navigation rules are enforced in
IsolatedWebAppThrottle.
Bug: b/335511141
Change-Id: Ibf0c31094dc96477849c47e34ece5d18f55d3a83
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5463431
Reviewed-by: Zelin Liu <zelin@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Commit-Queue: Robbie McElrath <rmcelrath@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1298352}
This CL modifies the extensions system so that when hosts of type
Controlled Frame embedder are used, content scripts that are specified
will be loaded using a fetcher that's provided via the Chrome embedder's
ExtensionsBrowserClient.
Bug: 1511295, b/316171914
Change-Id: Ie5c5aae9ef65c4e9abc690ad2a0d2fd5ae6f812f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5202765
Reviewed-by: Ovidio Ruiz-Henríquez <odejesush@chromium.org>
Reviewed-by: David Bertoni <dbertoni@chromium.org>
Commit-Queue: Chase Phillips <cmp@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1249171}
ExtensionsBrowserClient::IsValidContext() has a static_cast from a
content::BrowserContext to a Profile object. However, if the object is
*not* a valid context (profile), this static cast is unsafe and can
cause clang to crash with an illegal operation exception.
Remove the static_cast'ing in these methods and also update them to take
in `void*`s rather than `content::BrowserContext*`s. This is inline with
the method they effectively map to (ProfileManager::IsValidProfile())
and also guarantees that the implementations don't use the values passed
on the chance they are invalid.
Note that there are more robust fixes for this issue that are being
investigated as part of a larger refactor, but this should fix the
immediate crash.
Bug: 1470579
Change-Id: I446a8e4ebd0289c96126abb5cd9775ef20b31c23
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4784198
Reviewed-by: David Bertoni <dbertoni@chromium.org>
Commit-Queue: Devlin Cronin <rdevlin.cronin@chromium.org>
Auto-Submit: Devlin Cronin <rdevlin.cronin@chromium.org>
Commit-Queue: David Bertoni <dbertoni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1184337}
This is a reland of commit f93ee8bbfe
Original change's description:
> [ProfileSelections] Transition extension keyed factories to use Profile Selections
>
> Make sure that all extension factories (that do not use the
> BrowserContextKeyedAPI) use the Profile Selection logic through the
> ExtensionBrowserClient to have more control over different profile
> types.
> Mainly so that it stops being able to indirectly create services for the
> System Profile and be able to easily control the creation for the Guest
> Profile through the force variable.
>
> Changes:
> - `GetOriginalContext()` --> `GetContextRedirectedToOriginal()`
> - `context` --> `GetContextOwnInstance()`
> - no implementation --> `GetContextForOriginalOnly()`
>
> These changes will indirectly cause those services not to be able to be
> created for the System Profile, and the creation for the Guest Profile
> will be dependant on the `force_guest_profile` variable.
>
> Also added protections to some stacks in extensions to return early in
> case of System Profile (Extensions are disabled in the System Profile).
>
> Bug: 1284664
> Change-Id: I1ca9a345ca769ef42cb17ae38516a399283c4fd2
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4665672
> Reviewed-by: David Roger <droger@chromium.org>
> Commit-Queue: Ryan Sultanem <rsult@google.com>
> Reviewed-by: Dominick Ng <dominickn@chromium.org>
> Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1171652}
Bug: 1284664
Change-Id: Icc4150037510143bb7803301538af81856ca2037
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4704704
Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Commit-Queue: Ryan Sultanem <rsult@google.com>
Reviewed-by: David Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1173410}
This reverts commit f93ee8bbfe.
Reason for revert: causes crashes on Canary, see https://crbug.com/1466101
Original change's description:
> [ProfileSelections] Transition extension keyed factories to use Profile Selections
>
> Make sure that all extension factories (that do not use the
> BrowserContextKeyedAPI) use the Profile Selection logic through the
> ExtensionBrowserClient to have more control over different profile
> types.
> Mainly so that it stops being able to indirectly create services for the
> System Profile and be able to easily control the creation for the Guest
> Profile through the force variable.
>
> Changes:
> - `GetOriginalContext()` --> `GetContextRedirectedToOriginal()`
> - `context` --> `GetContextOwnInstance()`
> - no implementation --> `GetContextForOriginalOnly()`
>
> These changes will indirectly cause those services not to be able to be
> created for the System Profile, and the creation for the Guest Profile
> will be dependant on the `force_guest_profile` variable.
>
> Also added protections to some stacks in extensions to return early in
> case of System Profile (Extensions are disabled in the System Profile).
>
> Bug: 1284664
> Change-Id: I1ca9a345ca769ef42cb17ae38516a399283c4fd2
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4665672
> Reviewed-by: David Roger <droger@chromium.org>
> Commit-Queue: Ryan Sultanem <rsult@google.com>
> Reviewed-by: Dominick Ng <dominickn@chromium.org>
> Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1171652}
Bug: 1284664, 1466101
Change-Id: I4f8b486a0af56172bc2ff90839235bb53ce1c4e6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4701020
Owners-Override: Prudhvikumar Bommana <pbommana@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: David Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1172835}
Make sure that all extension factories (that do not use the
BrowserContextKeyedAPI) use the Profile Selection logic through the
ExtensionBrowserClient to have more control over different profile
types.
Mainly so that it stops being able to indirectly create services for the
System Profile and be able to easily control the creation for the Guest
Profile through the force variable.
Changes:
- `GetOriginalContext()` --> `GetContextRedirectedToOriginal()`
- `context` --> `GetContextOwnInstance()`
- no implementation --> `GetContextForOriginalOnly()`
These changes will indirectly cause those services not to be able to be
created for the System Profile, and the creation for the Guest Profile
will be dependant on the `force_guest_profile` variable.
Also added protections to some stacks in extensions to return early in
case of System Profile (Extensions are disabled in the System Profile).
Bug: 1284664
Change-Id: I1ca9a345ca769ef42cb17ae38516a399283c4fd2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4665672
Reviewed-by: David Roger <droger@chromium.org>
Commit-Queue: Ryan Sultanem <rsult@google.com>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1171652}
Rename functions in the ExtensionsBrowserClient related to Profile
Selections so that they match the Profile Selections terminalogy.
Also removed the `force_system_profile` parameters to simplify the usages, as the System Profile is never used in the Extensions context (the variable was always false, triggering no effect for the System Profile).
Bug: 1284664
Change-Id: Ib272e5e83ce98222a216a2a298f272b6322fbfee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4665670
Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
Commit-Queue: Ryan Sultanem <rsult@google.com>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1167973}
Since KeyedServiceFactory under extensions/ cannot inherit from
`ProfileKeyedServiceFactory` to benefit from the default values for
System and Guest profiles, this will be done through the
`ExtensionsBrowserClient` by adding the equivalent of ProfileSelections
experimental builders methods which will provide a check on the
experiment (follows the same logic as ProfileKeyedServiceFactory, using
ProfileSelections experimental builder).
Also these methods will take a parameter to allow to force the creation
even within the experiment, in case certain Services still need to be
created for the System Profile.
Adapted the main extensions/ base factory to use these new methods
`BrowserContextKeyedAPI`, other independent factories can still use the
new methods from the ExtensionsBrowserClient.
Bug: 1284664
Change-Id: I287253ed5176ffd17904ab37b6ec6fb38be11e9f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3854601
Reviewed-by: David Roger <droger@chromium.org>
Commit-Queue: Ryan Sultanem <rsult@google.com>
Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1043990}
This is the second patch and it adds all the API calls from
Lacros to Ash.
It does this by introducing a new NetworkingPrivateDelegate for
Lacros which re-routes all commands to the Ash side where they
get executed on the ash delegate.
The functionality itself is limited to first profile use only.
BUG=1278560
Change-Id: I31d703855272bddf0f00099158b97aa9218ab055
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3674723
Reviewed-by: Steven Bennetts <stevenjb@chromium.org>
Reviewed-by: Toni Barzic <tbarzic@chromium.org>
Reviewed-by: Erik Chen <erikchen@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Stefan Kuhne <skuhne@chromium.org>
Commit-Queue: Stefan Kuhne <skuhne@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1011173}
This is just a convoluted way of writing nullptr, so rewrite it in the
simpler form. PRESUBMIT.py already disallows new instances of
std::unique_ptr<T>(). This removes existing instances.
Change-Id: I8b27ae2a7bad66d41db92a8c55905be197cdc3fd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2824942
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#872776}
TestExtensionsBrowserClient allows passing a factory callback that can
be used to create UpdateClients. By nature of being a factory, this
should be a repeating callback. We also pass it by value to indicate a
transfer of ownership.
No change to (the only) call site as it already uses BindRepeating.
Bug: 1152268
Change-Id: Ib07a63a48614fe3bb52b8fc060dd3946f64ec42f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2605874
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Commit-Queue: David Bokan <bokan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#840910}
Restrict web_accessible_resources based on site |matches| that
extension developers have supplied in manifest.json.
Manifest V3 includes changes to the web_accessible_resources key of
manifest.json. Use parsed |matches| field to determine which sites have
access to specific resources.
In the following example, a.com can access a.gif, but other sites can't:
"web_accessible_resources": [{
"resources": ["a.gif"],
"matches": ["https://a.com/*"]
}]
Bug: 1133624
Change-Id: Idd0f4a828e2d1a543aaf5e51ab7af6ec6f2f7220
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2485887
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Commit-Queue: Solomon Kinard <solomonkinard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#831961}
The change is mostly mechanical replacing defined(OS_CHROMEOS) with
BUILDFLAG(IS_CHROMEOS_ASH) and GN variable is_chromeos with is_ash
with some special cases (For those cases please refer to
http://go/lacros-macros).
The patch is made in preparation to switching lacros build from
target_os=linux to target_os=chromeos. This will prevent lacros from
changing behaviour after the switch.
Bug: 1052397
Change-Id: Ie1e86a9e513a14f15414ffeaf95d8b30b49e175a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2490915
Commit-Queue: Yuta Hijikata <ythjkt@chromium.org>
Reviewed-by: David Bertoni <dbertoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#826703}
The current mojom struct ResourceLoadInfo defined in //content is used
to notify the status of a resource loading, which is unavailable
inside Blink.
Along with the implementation of OnionSoup of loaders, we are going to
notify the loading status from Blink directly. So we have to move this
mojom struct into Blink in order to leverage it there.
This CL makes the changes below:
- Remove the ResourceType in //content and its typemap and replace with
the mojom one.
- Move the resource_load_info.mojom into Blink.
Change-Id: I11ab3b7107bd4e06ee3ec737f825202c533a466c
Bug: 860403
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1986640
Commit-Queue: Minggang Wang <minggang.wang@intel.com>
Reviewed-by: Charlie Reis <creis@chromium.org>
Reviewed-by: Matt Falkenhagen <falken@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#738417}
The Virtual Keyboard extension on the ChromeOS login screen was
not highlighting keys correctly. Hence, when projecting/mirroring
ChromeOS onto an external display, viewers can see the passwords
being entered into the device when logging in.
The root cause was that off-the-record profiles were not receiving
system info events. Since the extension was running off-the-record
on the login screen, it was not notified when the
chrome.system.display.onDisplayChanged API was triggered.
This change makes it so that all off-the-record extensions will
receive chrome.system.display.onDisplayChanged events
Bug: 824656
Change-Id: I787deb9c37b60032eaa1b743b7dd348973c334bc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1726802
Auto-Submit: Keith Lee <keithlee@chromium.org>
Reviewed-by: Alex Sakhartchouk <alexst@chromium.org>
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Darren Shen <shend@chromium.org>
Commit-Queue: Keith Lee <keithlee@chromium.org>
Cr-Commit-Position: refs/heads/master@{#690644}
Previously a gzipped_resource_file_map_source/header Grit output was used
to determine which component extension resources are gzipped. This is no
longer necessary.
This is in preparation of deleting gzipped_resource_file_map_source Grit
output completely.
Specifically:
- Modify chrome_url_request_util.cc to use ResourceBundle::IsGzipped.
- Remove ComponentExtensionResourceInfo struct and update all signatures,
basically reverting a lot of the changes made at r627283, since
they are no longer necessary.
- Remove last usages of type="gzipped_resource_file_map_source" in grd
files.
Bug: 961063
Change-Id: Ifc9d1535c96e4a168b3d45f3c831976e52c9444a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1601481
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Dominick Ng <dominickn@chromium.org>
Reviewed-by: Sam McNally <sammc@chromium.org>
Reviewed-by: Michael Spang <spang@chromium.org>
Reviewed-by: Darren Shen <shend@chromium.org>
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#658652}
I replaced mojom.h header in files used for compiling browser_process_impl.cc with mojom-forward.h as many as possible.
To fix build failure, I added mojo header files in some cc files too.
This CL improved compile time of browser_process_impl.cc from 14.5s to 13.1s on Linux.
TBR=rockot@google.com, thakis@chromium.org
Bug: 922875
Change-Id: I5311b82f66e97aa7baf5e7a41d2e6358dd670ea3
Reviewed-on: https://chromium-review.googlesource.com/c/1451603
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#629441}