0
Commit Graph

315 Commits

Author SHA1 Message Date
Palak Agarwal
f33fdfef2d Rm CameraMonitoringInVideoCaptureService feature as it's 100% launched
Bug: 1448798
Change-Id: I2e9ab5832725088c407c51af6ac06726a97513be
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5444513
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Palak Agarwal <agpalak@chromium.org>
Reviewed-by: Markus Handell <handellm@google.com>
Cr-Commit-Position: refs/heads/main@{#1287304}
2024-04-15 13:43:41 +00:00
Jan Keitel
748d58e033 Allow registering multiple OnceClosures in RegisterOnNextIdleCallback.
Bug: 1475902
Change-Id: Ic351171b6ef00ae6f4094a47ee06c5012b7aa7d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5144688
Reviewed-by: Francois Pierre Doray <fdoray@chromium.org>
Commit-Queue: Jan Keitel <jkeitel@google.com>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1249558}
2024-01-19 21:55:38 +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
Eriko Kurimoto
bb0e760cd9 [2/N] Use IS_OZONE_{X11, WAYLAND}
This CL substitutes OZONE_PLATFORM_* to IS_OZONE_* which is
platform-independent flags in //content/*.

This CL does not change the behavior.

Bug: 1500494
Change-Id: Ifcaba043564fd4763cfe20545142c697ca4bde30
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5082604
Reviewed-by: Bo Liu <boliu@chromium.org>
Commit-Queue: Eriko Kurimoto <elkurin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1232711}
2023-12-04 15:13:20 +00:00
Greg Thompson
d97b838504 [accessibility] BrowserMainLoop owns BrowserAccessibilityStateImpl
Make the process-wide BrowserAccessibilityStateImpl a member of
BrowserMainLoop rather than a self-contained singleton that outlives the
browser process. This provides deterministic construction and makes it
easier to allow the content embedder to customize the instance.

For the sake of tests:
- content::UnitTestTestSuite owns an instance for use by unit tests.
- content::TestContentClientInitializer owns an instance for use by unit
  tests that run outside of an ordinary content unit test.

Bug: 1470199
AX-Relnotes: n/a.
Change-Id: I33b8606f2113ce6a4cc4f24f4fce1131b84f956d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4742506
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Benjamin Beaudry <benjamin.beaudry@microsoft.com>
Reviewed-by: Jacques Newman <janewman@microsoft.com>
Commit-Queue: Greg Thompson <grt@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1186389}
2023-08-22 10:18:39 +00:00
Alex Attar
63ab3bd526 Add trace report database a local database for tracing.
This patch adds the ability to create and initialize the database and table, and implements methods to add/remove traces to it and update their upload state. It also hooks up database creation to BackgroundTracingManager.

Subsequent patches will add:

- The Ability to write traces into the trace report database from the BackgroundTracingManager.
- A UI to display the traces currently stored in the database.
- Manually upload and download the trace from the UI.

Change-Id: I3e4e3d060f7e8bf7d926faf32fa3b255f29beea2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4288767
Reviewed-by: Alexander Timin <altimin@chromium.org>
Auto-Submit: Alex Attar <aattar@google.com>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Commit-Queue: Alex Attar <aattar@google.com>
Cr-Commit-Position: refs/heads/main@{#1168883}
2023-07-11 19:31:44 +00:00
Michael Thiessen
c8842d0ac9 Support ADPF on the browser IO thread.
ADPF (Android Dynamic Performance Framework) allows dynamic
performance hinting to the Android platform. The IO thread was
initially excluded as an oversight.

# crbug.com/1414157

Validate-Test-Flakiness: skip
Bug: 1415334
Change-Id: I751d7f710572b41554c55092d588f00bf7cb6532
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4245317
Reviewed-by: Bo Liu <boliu@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Commit-Queue: Michael Thiessen <mthiesse@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1106254}
2023-02-16 17:06:02 +00:00
Avi Drissman
adac219925 Update header includes for /base/functional in /content
bind.h, callback.h, callback_forward.h, and callback_helpers.h
moved into /base/functional/. Update the include paths to
directly include them in their new location.

Bug: 1364441
Change-Id: I32ec425b9c0e52ec4b50047bf3290fecc5c905ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4148554
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Auto-Submit: Avi Drissman <avi@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1091567}
2023-01-11 23:46:39 +00:00
Sean Maher
70f2942930 Task posting v3: many manual changes to continue handle refactors
This CL contains:
- removal of references to task runner handles in comments
- removal of nearly all calls, includes, and instantiations of
  thread and sequenced task runner handles

Each of these were replaced with references to the new api:
TaskRunner::CurrentDefaultHandle and associated methods.

After this change, all that should be left to do for this method
refactor is the deletion of the old API.

A few of the changes were done with a script, but they were manually
audited.

Bug: 1026641
Ax-Relnotes: n/a
Change-Id: I0858dccac95b485d982aa5152c6b461c4ce05aa4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4117257
Commit-Queue: Gabriel Charette <gab@chromium.org>
Owners-Override: Gabriel Charette <gab@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Sean Maher <spvw@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1088971}
2023-01-04 22:15:06 +00:00
Ali Hijazi
d87307de3e Rewrite T& into raw_ref<T> under content/
The changes were generated by running
tools/clang/rewrite_raw_ref_fields/rewrite-multiple-platforms.sh with
tool-arg=--enable_raw_ref_rewrite

`raw_ref` is a smart pointer for a pointer which can not be null, and
which provides Use-after-Free protection in the same ways as raw_ptr.
This class acts like a combination of std::reference_wrapper and
raw_ptr.

See raw_ptr and //base/memory/raw_ptr.md for more details on the
Use-after-Free protection.

Bug: 1357022
Change-Id: I14c1f8d4d890715fb9b9f0526ace78ecc625c08a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3999748
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Ali Hijazi <ahijazi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1068278}
2022-11-07 20:15:03 +00:00
kylechar
2d46387daa Switch define(USE_OZONE) to BUILDFLAG(IS_OZONE)
Right now ozone platform usage is checked via #if defined(USE_OZONE).
This is error prone as a typo, eg. defined(USE_OZOEN), will compile but
the #if will always be false. BUILDFLAG(IS_OZONE) improves this by
making the typo into a compile error.

Update files in src/content to use the buildflag.

This CL was uploaded by git cl split.

Bug: 1377327
Change-Id: I4fcdf693b329478e874cbac3f525365d93cd006c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3995279
Auto-Submit: Kyle Charbonneau <kylechar@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Commit-Queue: Kyle Charbonneau <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1066513}
2022-11-02 16:14:30 +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
Eriko Kurimoto
64656465cc Reland: "[NetworkChangeManagerLacros] Pass NetworkChange to notifier and manager"
This is a reland of commit 1f3519099e.

The diff between the orifinal reverted change and the fix change can be
checked by Patchset1 -> Patchset2.
The change only affects testing.

SyncExponentialBackoffTest.OfflineToOnline was flaky because the test
tried to disable network change notifications while it was only
disabling notifier in browser process, not on network manager.
Before my change, network change manager was not appropriately working
on Lacros so it was not notified by notifier in network service
process.

FYI: This issue was happening for Ash as well which was fixed by
crrev.com/c/3758296.

Original change's description:
> [NetworkChangeManagerLacros] Pass NetworkChange to notifier and manager
>
> This CL introduces NetworkChangeManagerBridge in Lacros and let it
> bypass the NetworkChange info from Ash to Lacros notifier on browser
> process and NetworkChangeManager on NetworkService process.
>
> By this change, Lacros will be able to obtain the correct network
> connection type.
>
> Design dos: go/lacros-network-change-manager
>
> Bug: 1329384
> Change-Id: I251448caf3e8fc452568f39aad37dbf13b9ac6e1
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3735829
> Reviewed-by: Colin Blundell <blundell@chromium.org>
> Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
> Commit-Queue: Eriko Kurimoto <elkurin@chromium.org>
> Reviewed-by: Ben Wells <benwells@chromium.org>
> Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
> Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1021113}

Bug: 1329384
Change-Id: I9858f9ea62f30cffb1b1d249fbc28df799bdc3bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3761737
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: David Roger <droger@chromium.org>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Commit-Queue: Eriko Kurimoto <elkurin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1026561}
2022-07-21 01:07:49 +00:00
Andy Paicu
2b1138f45a Revert "[NetworkChangeManagerLacros] Pass NetworkChange to notifier and manager"
This reverts commit 1f3519099e.

Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=1329384#c5, test failures.

Original change's description:
> [NetworkChangeManagerLacros] Pass NetworkChange to notifier and manager
>
> This CL introduces NetworkChangeManagerBridge in Lacros and let it
> bypass the NetworkChange info from Ash to Lacros notifier on browser
> process and NetworkChangeManager on NetworkService process.
>
> By this change, Lacros will be able to obtain the correct network
> connection type.
>
> Design dos: go/lacros-network-change-manager
>
> Bug: 1329384
> Change-Id: I251448caf3e8fc452568f39aad37dbf13b9ac6e1
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3735829
> Reviewed-by: Colin Blundell <blundell@chromium.org>
> Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
> Commit-Queue: Eriko Kurimoto <elkurin@chromium.org>
> Reviewed-by: Ben Wells <benwells@chromium.org>
> Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
> Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1021113}

Bug: 1329384
Change-Id: I2d5656d86e092ee5bd6c3107e524ae8031b345e5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3748824
Auto-Submit: Andy Paicu <andypaicu@chromium.org>
Owners-Override: Andy Paicu <andypaicu@google.com>
Commit-Queue: Andy Paicu <andypaicu@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1021166}
2022-07-06 13:56:13 +00:00
Eriko Kurimoto
1f3519099e [NetworkChangeManagerLacros] Pass NetworkChange to notifier and manager
This CL introduces NetworkChangeManagerBridge in Lacros and let it
bypass the NetworkChange info from Ash to Lacros notifier on browser
process and NetworkChangeManager on NetworkService process.

By this change, Lacros will be able to obtain the correct network
connection type.

Design dos: go/lacros-network-change-manager

Bug: 1329384
Change-Id: I251448caf3e8fc452568f39aad37dbf13b9ac6e1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3735829
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
Commit-Queue: Eriko Kurimoto <elkurin@chromium.org>
Reviewed-by: Ben Wells <benwells@chromium.org>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1021113}
2022-07-06 09:28:56 +00:00
Xiaohan Wang
1ecfd006fd content: Use BUILDFLAG for OS checking
Use BUILDFLAG(IS_XXX) instead of defined(OS_XXX).

Generated by `os_buildflag_migration.py` (https://crrev.com/c/3311983).

R=thakis@chromium.org

Bug: 1234043
Test: No functionality change
Change-Id: Ia0eae6f9396065e190929d42600012c9324c07e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3399774
Commit-Queue: Xiaohan Wang <xhwang@chromium.org>
Owners-Override: Xiaohan Wang <xhwang@chromium.org>
Auto-Submit: Xiaohan Wang <xhwang@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Owners-Override: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#961157}
2022-01-19 22:33:10 +00:00
Alexander Dunaev
0521017be4 [linux] Introduced the graceful way to shutdown at startup.
The platform may fail to initialise, but currently there is no way to
shutdown gracefully, instead platforms have to CHECK or LOG(FATAL),
which essentially crashes the browser.  This seems unnecessary because
harmless things like launching chrome with a wrong platform cause
crashes that are then reported to Crashpad.

This patch introduces the early failure path for the platforms: they can
do primary checks at the stage of initialising the UI, and return
whether they succedeed.  In case of failure, the process exits with
normal status.

Bug: 1280138
Change-Id: I176be3ba914cbdb2544478de5228476dcb3ccd21
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3351790
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: Bo Liu <boliu@chromium.org>
Reviewed-by: Robert Kroeger <rjkroege@chromium.org>
Reviewed-by: David Roger <droger@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Alexander Dunaev <adunaev@igalia.com>
Cr-Commit-Position: refs/heads/main@{#961077}
2022-01-19 19:43:09 +00:00
Gabriel Charette
7870bb6417 Reland "Reland "[content] Standardize "message loop starts" signal across Desktop, Android, and browser tests""
This reverts commit 572ed6584a.

Reason for reland: Fixed FontUniqueNameBrowserTest. This CL
enables all of BrowserMainLoop::PreMainMessageLoopRun() to complete
before running the test hook. The test was flaking because
BrowserMainLoop::PreMainMessageLoopRun() initializes
DWriteFontLookupTableBuilder already and the browser test fixture
was built like a unit test (invoking ResetStateForTesting) which
raced with the BrowserMainLoop's live init request. It is no longer
necessary to explicitly init before the test and never was to
reset after the test (browser tests don't reuse procs).

Original change's description:
> Revert "Reland "[content] Standardize "message loop starts" signal across Desktop, Android, and browser tests""
>
> This reverts commit eea969e4be.
>
> Reason for revert: lines up as culprit for a second time for
> crbug.com/1269720... must be it even though I don't see why.
>
> Original change's description:
> > Reland "[content] Standardize "message loop starts" signal across Desktop, Android, and browser tests"
> >
> > This reverts commit 865c12f322.
> >
> > Reason for revert: attempting reland.
> >
> > Original change's description:
> > > Revert "[content] Standardize "message loop starts" signal across Desktop, Android, and browser tests"
> > >
> > > This reverts commit 67bcc9c2d1.
> > >
> > > Reason for revert: suspect for crbug.com/1269720 though I can't
> > > explain why it would cause that failure (and that one alone)
> > >
> > > Original change's description:
> > > > [content] Standardize "message loop starts" signal across Desktop, Android, and browser tests
> > > >
> > > > And make content (BrowserMainLoop) responsible for running the
> > > > integration test hook (`MainFunctionParams::ui_task`) instead of each
> > > > BrowserMainParts impl doing so slightly differently.
> > > >
> > > > This is mostly a no-op but for some BrowserMainParts which did more work
> > > > after running `ui_task`, that work will now happen before `ui_task`
> > > > runs.
> > > >
> > > > Metrics recording in //chrome is centralized at the end of
> > > > PreMainMessageLoopRun on all platforms.
> > > >
> > > > Standardizing cross-platform ordering avoids forcing 4 awkward ordering
> > > > requirements in
> > > > https://chromium-review.googlesource.com/c/chromium/src/+/2892251 (see
> > > > diff of TODOs no longer needed after rebasing on this CL :
> > > > https://chromium-review.googlesource.com/c/chromium/src/+/2892251/44..47)
> > > >
> > > > This also allows getting rid of a force function in
> > > > startup_metrics_browsertest.cc to pretend some metrics were logged
> > > > (they now actually are without interfering with the product code).
> > > >
> > > > Part of the uncovered portion of BrowserMainLoop::PreMainMessageLoopRun
> > > > in browser tests was the part setting disallowance to do Blocking/Wait
> > > > operations on main thread. Unfortunately adding this ban breaks many
> > > > tests, browser_test_base.cc explicitly inverts those new thread
> > > > restrictions in this CL with a TODO to bring them in-line with the
> > > > product restrictions.
> > > >
> > > > BrowserMainParts overrides can get also rid of their |run_message_loop_|
> > > > variable when moving handling of the browser test hook (`ui_task`) in
> > > > WillRunMainMessageLoop(). And in a follow-up they will be updated to
> > > > only receive a `bool is_integration_test` from CreateBrowserMainParts
> > > > instead of the full MainFunctionParams which none use beyond that bool.
> > > >
> > > > ContentBrowserTestSanityTests verify that browser test bodies still run
> > > > as expected with this change.
> > > >
> > > > Bug: 1175074, 1253634
> > > > Change-Id: Ib757a02bbd982ef2b1132e2791e8ec1ce0305038
> > > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3187153
> > > > Reviewed-by: Alexander Timin <altimin@chromium.org>
> > > > Reviewed-by: Sean Topping <seantopping@chromium.org>
> > > > Reviewed-by: Scott Violet <sky@chromium.org>
> > > > Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
> > > > Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
> > > > Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
> > > > Reviewed-by: Bo <boliu@chromium.org>
> > > > Commit-Queue: Gabriel Charette <gab@chromium.org>
> > > > Cr-Commit-Position: refs/heads/main@{#940917}
> > >
> > > TBR=sky@chromium.org,gab@chromium.org,boliu@chromium.org,rdevlin.cronin@chromium.org,sergeyu@chromium.org,skyostil@chromium.org,altimin@chromium.org,seantopping@chromium.org,chromium-scoped@luci-project-accounts.iam.gserviceaccount.com
> > >
> > > Change-Id: I5ebcb181286d31e3a0bfb293c394da00e7970da4
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Bug: 1175074, 1253634, 1269720
> > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3276956
> > > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> > > Reviewed-by: Gabriel Charette <gab@chromium.org>
> > > Reviewed-by: anthonyvd <anthonyvd@chromium.org>
> > > Auto-Submit: Gabriel Charette <gab@chromium.org>
> > > Owners-Override: anthonyvd <anthonyvd@chromium.org>
> > > Cr-Commit-Position: refs/heads/main@{#941225}
> >
> > # Not skipping CQ checks because this is a reland.
> >
> > Bug: 1175074, 1253634, 1269720
> > Change-Id: Ib0a6a93300425b62458206e2650735850fd68aec
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3279623
> > Reviewed-by: Gabriel Charette <gab@chromium.org>
> > Reviewed-by: anthonyvd <anthonyvd@chromium.org>
> > Reviewed-by: Sean Topping <seantopping@chromium.org>
> > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> > Auto-Submit: Gabriel Charette <gab@chromium.org>
> > Commit-Queue: anthonyvd <anthonyvd@chromium.org>
> > Commit-Queue: Sean Topping <seantopping@chromium.org>
> > Owners-Override: anthonyvd <anthonyvd@chromium.org>
> > Cr-Commit-Position: refs/heads/main@{#941336}
>
> # Not skipping CQ checks because original CL landed > 1 day ago.
>
> Bug: 1175074, 1253634, 1269720
> Change-Id: I8744b1abc5d68e5cc3462e6513ff3b466b3232c6
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3278582
> Reviewed-by: Gabriel Charette <gab@chromium.org>
> Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
> Reviewed-by: Scott Violet <sky@chromium.org>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Owners-Override: Gabriel Charette <gab@chromium.org>
> Commit-Queue: Gabriel Charette <gab@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#941764}

Test: Explicitly ran win7-rel
Bug: 1175074, 1253634, 1269720
Change-Id: Ie75d87045e6e756ef85799afc79519d1fbbe8c9a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3306906
Commit-Queue: Alexander Timin <altimin@chromium.org>
Auto-Submit: Gabriel Charette <gab@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Reviewed-by: Dominik Röttsches <drott@chromium.org>
Owners-Override: Alexander Timin <altimin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#946449}
2021-11-30 14:32:50 +00:00
mark a. foltz
04829f3428 [Media] Remove KeyboardMicRegistration.
This code was to support ChromeOS devices with an extra microphone for
keyboard sounds.  These devices are no longer getting updates, so this
code can be removed.

Bug: 1269538
Change-Id: I9fbfa420c7942f663ea47c0df9d77b9753e43154
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3291857
Reviewed-by: Yu-Hsuan Hsu <yuhsuan@chromium.org>
Reviewed-by: Olga Sharonova <olka@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: mark a. foltz <mfoltz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#943775}
2021-11-20 01:37:26 +00:00
Lei Zhang
7ab31375dd Do IWYU for content_export.h
Headers that use CONTENT_EXPORT should include content_export.h.

Change-Id: I66b65c9c3a963d1f4677172b12ef0966448e1609
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3282640
Commit-Queue: Lei Zhang <thestig@chromium.org>
Auto-Submit: Lei Zhang <thestig@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Owners-Override: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#942394}
2021-11-17 01:26:00 +00:00
Gabriel Charette
572ed6584a Revert "Reland "[content] Standardize "message loop starts" signal across Desktop, Android, and browser tests""
This reverts commit eea969e4be.

Reason for revert: lines up as culprit for a second time for
crbug.com/1269720... must be it even though I don't see why.

Original change's description:
> Reland "[content] Standardize "message loop starts" signal across Desktop, Android, and browser tests"
>
> This reverts commit 865c12f322.
>
> Reason for revert: attempting reland.
>
> Original change's description:
> > Revert "[content] Standardize "message loop starts" signal across Desktop, Android, and browser tests"
> >
> > This reverts commit 67bcc9c2d1.
> >
> > Reason for revert: suspect for crbug.com/1269720 though I can't
> > explain why it would cause that failure (and that one alone)
> >
> > Original change's description:
> > > [content] Standardize "message loop starts" signal across Desktop, Android, and browser tests
> > >
> > > And make content (BrowserMainLoop) responsible for running the
> > > integration test hook (`MainFunctionParams::ui_task`) instead of each
> > > BrowserMainParts impl doing so slightly differently.
> > >
> > > This is mostly a no-op but for some BrowserMainParts which did more work
> > > after running `ui_task`, that work will now happen before `ui_task`
> > > runs.
> > >
> > > Metrics recording in //chrome is centralized at the end of
> > > PreMainMessageLoopRun on all platforms.
> > >
> > > Standardizing cross-platform ordering avoids forcing 4 awkward ordering
> > > requirements in
> > > https://chromium-review.googlesource.com/c/chromium/src/+/2892251 (see
> > > diff of TODOs no longer needed after rebasing on this CL :
> > > https://chromium-review.googlesource.com/c/chromium/src/+/2892251/44..47)
> > >
> > > This also allows getting rid of a force function in
> > > startup_metrics_browsertest.cc to pretend some metrics were logged
> > > (they now actually are without interfering with the product code).
> > >
> > > Part of the uncovered portion of BrowserMainLoop::PreMainMessageLoopRun
> > > in browser tests was the part setting disallowance to do Blocking/Wait
> > > operations on main thread. Unfortunately adding this ban breaks many
> > > tests, browser_test_base.cc explicitly inverts those new thread
> > > restrictions in this CL with a TODO to bring them in-line with the
> > > product restrictions.
> > >
> > > BrowserMainParts overrides can get also rid of their |run_message_loop_|
> > > variable when moving handling of the browser test hook (`ui_task`) in
> > > WillRunMainMessageLoop(). And in a follow-up they will be updated to
> > > only receive a `bool is_integration_test` from CreateBrowserMainParts
> > > instead of the full MainFunctionParams which none use beyond that bool.
> > >
> > > ContentBrowserTestSanityTests verify that browser test bodies still run
> > > as expected with this change.
> > >
> > > Bug: 1175074, 1253634
> > > Change-Id: Ib757a02bbd982ef2b1132e2791e8ec1ce0305038
> > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3187153
> > > Reviewed-by: Alexander Timin <altimin@chromium.org>
> > > Reviewed-by: Sean Topping <seantopping@chromium.org>
> > > Reviewed-by: Scott Violet <sky@chromium.org>
> > > Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
> > > Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
> > > Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
> > > Reviewed-by: Bo <boliu@chromium.org>
> > > Commit-Queue: Gabriel Charette <gab@chromium.org>
> > > Cr-Commit-Position: refs/heads/main@{#940917}
> >
> > TBR=sky@chromium.org,gab@chromium.org,boliu@chromium.org,rdevlin.cronin@chromium.org,sergeyu@chromium.org,skyostil@chromium.org,altimin@chromium.org,seantopping@chromium.org,chromium-scoped@luci-project-accounts.iam.gserviceaccount.com
> >
> > Change-Id: I5ebcb181286d31e3a0bfb293c394da00e7970da4
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: 1175074, 1253634, 1269720
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3276956
> > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> > Reviewed-by: Gabriel Charette <gab@chromium.org>
> > Reviewed-by: anthonyvd <anthonyvd@chromium.org>
> > Auto-Submit: Gabriel Charette <gab@chromium.org>
> > Owners-Override: anthonyvd <anthonyvd@chromium.org>
> > Cr-Commit-Position: refs/heads/main@{#941225}
>
> # Not skipping CQ checks because this is a reland.
>
> Bug: 1175074, 1253634, 1269720
> Change-Id: Ib0a6a93300425b62458206e2650735850fd68aec
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3279623
> Reviewed-by: Gabriel Charette <gab@chromium.org>
> Reviewed-by: anthonyvd <anthonyvd@chromium.org>
> Reviewed-by: Sean Topping <seantopping@chromium.org>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Auto-Submit: Gabriel Charette <gab@chromium.org>
> Commit-Queue: anthonyvd <anthonyvd@chromium.org>
> Commit-Queue: Sean Topping <seantopping@chromium.org>
> Owners-Override: anthonyvd <anthonyvd@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#941336}

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 1175074, 1253634, 1269720
Change-Id: I8744b1abc5d68e5cc3462e6513ff3b466b3232c6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3278582
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Gabriel Charette <gab@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/main@{#941764}
2021-11-15 19:01:40 +00:00
Gabriel Charette
eea969e4be Reland "[content] Standardize "message loop starts" signal across Desktop, Android, and browser tests"
This reverts commit 865c12f322.

Reason for revert: attempting reland.

Original change's description:
> Revert "[content] Standardize "message loop starts" signal across Desktop, Android, and browser tests"
>
> This reverts commit 67bcc9c2d1.
>
> Reason for revert: suspect for crbug.com/1269720 though I can't
> explain why it would cause that failure (and that one alone)
>
> Original change's description:
> > [content] Standardize "message loop starts" signal across Desktop, Android, and browser tests
> >
> > And make content (BrowserMainLoop) responsible for running the
> > integration test hook (`MainFunctionParams::ui_task`) instead of each
> > BrowserMainParts impl doing so slightly differently.
> >
> > This is mostly a no-op but for some BrowserMainParts which did more work
> > after running `ui_task`, that work will now happen before `ui_task`
> > runs.
> >
> > Metrics recording in //chrome is centralized at the end of
> > PreMainMessageLoopRun on all platforms.
> >
> > Standardizing cross-platform ordering avoids forcing 4 awkward ordering
> > requirements in
> > https://chromium-review.googlesource.com/c/chromium/src/+/2892251 (see
> > diff of TODOs no longer needed after rebasing on this CL :
> > https://chromium-review.googlesource.com/c/chromium/src/+/2892251/44..47)
> >
> > This also allows getting rid of a force function in
> > startup_metrics_browsertest.cc to pretend some metrics were logged
> > (they now actually are without interfering with the product code).
> >
> > Part of the uncovered portion of BrowserMainLoop::PreMainMessageLoopRun
> > in browser tests was the part setting disallowance to do Blocking/Wait
> > operations on main thread. Unfortunately adding this ban breaks many
> > tests, browser_test_base.cc explicitly inverts those new thread
> > restrictions in this CL with a TODO to bring them in-line with the
> > product restrictions.
> >
> > BrowserMainParts overrides can get also rid of their |run_message_loop_|
> > variable when moving handling of the browser test hook (`ui_task`) in
> > WillRunMainMessageLoop(). And in a follow-up they will be updated to
> > only receive a `bool is_integration_test` from CreateBrowserMainParts
> > instead of the full MainFunctionParams which none use beyond that bool.
> >
> > ContentBrowserTestSanityTests verify that browser test bodies still run
> > as expected with this change.
> >
> > Bug: 1175074, 1253634
> > Change-Id: Ib757a02bbd982ef2b1132e2791e8ec1ce0305038
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3187153
> > Reviewed-by: Alexander Timin <altimin@chromium.org>
> > Reviewed-by: Sean Topping <seantopping@chromium.org>
> > Reviewed-by: Scott Violet <sky@chromium.org>
> > Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
> > Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
> > Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
> > Reviewed-by: Bo <boliu@chromium.org>
> > Commit-Queue: Gabriel Charette <gab@chromium.org>
> > Cr-Commit-Position: refs/heads/main@{#940917}
>
> TBR=sky@chromium.org,gab@chromium.org,boliu@chromium.org,rdevlin.cronin@chromium.org,sergeyu@chromium.org,skyostil@chromium.org,altimin@chromium.org,seantopping@chromium.org,chromium-scoped@luci-project-accounts.iam.gserviceaccount.com
>
> Change-Id: I5ebcb181286d31e3a0bfb293c394da00e7970da4
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 1175074, 1253634, 1269720
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3276956
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Reviewed-by: Gabriel Charette <gab@chromium.org>
> Reviewed-by: anthonyvd <anthonyvd@chromium.org>
> Auto-Submit: Gabriel Charette <gab@chromium.org>
> Owners-Override: anthonyvd <anthonyvd@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#941225}

# Not skipping CQ checks because this is a reland.

Bug: 1175074, 1253634, 1269720
Change-Id: Ib0a6a93300425b62458206e2650735850fd68aec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3279623
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: anthonyvd <anthonyvd@chromium.org>
Reviewed-by: Sean Topping <seantopping@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Gabriel Charette <gab@chromium.org>
Commit-Queue: anthonyvd <anthonyvd@chromium.org>
Commit-Queue: Sean Topping <seantopping@chromium.org>
Owners-Override: anthonyvd <anthonyvd@chromium.org>
Cr-Commit-Position: refs/heads/main@{#941336}
2021-11-12 21:48:08 +00:00
Gabriel Charette
865c12f322 Revert "[content] Standardize "message loop starts" signal across Desktop, Android, and browser tests"
This reverts commit 67bcc9c2d1.

Reason for revert: suspect for crbug.com/1269720 though I can't
explain why it would cause that failure (and that one alone)

Original change's description:
> [content] Standardize "message loop starts" signal across Desktop, Android, and browser tests
>
> And make content (BrowserMainLoop) responsible for running the
> integration test hook (`MainFunctionParams::ui_task`) instead of each
> BrowserMainParts impl doing so slightly differently.
>
> This is mostly a no-op but for some BrowserMainParts which did more work
> after running `ui_task`, that work will now happen before `ui_task`
> runs.
>
> Metrics recording in //chrome is centralized at the end of
> PreMainMessageLoopRun on all platforms.
>
> Standardizing cross-platform ordering avoids forcing 4 awkward ordering
> requirements in
> https://chromium-review.googlesource.com/c/chromium/src/+/2892251 (see
> diff of TODOs no longer needed after rebasing on this CL :
> https://chromium-review.googlesource.com/c/chromium/src/+/2892251/44..47)
>
> This also allows getting rid of a force function in
> startup_metrics_browsertest.cc to pretend some metrics were logged
> (they now actually are without interfering with the product code).
>
> Part of the uncovered portion of BrowserMainLoop::PreMainMessageLoopRun
> in browser tests was the part setting disallowance to do Blocking/Wait
> operations on main thread. Unfortunately adding this ban breaks many
> tests, browser_test_base.cc explicitly inverts those new thread
> restrictions in this CL with a TODO to bring them in-line with the
> product restrictions.
>
> BrowserMainParts overrides can get also rid of their |run_message_loop_|
> variable when moving handling of the browser test hook (`ui_task`) in
> WillRunMainMessageLoop(). And in a follow-up they will be updated to
> only receive a `bool is_integration_test` from CreateBrowserMainParts
> instead of the full MainFunctionParams which none use beyond that bool.
>
> ContentBrowserTestSanityTests verify that browser test bodies still run
> as expected with this change.
>
> Bug: 1175074, 1253634
> Change-Id: Ib757a02bbd982ef2b1132e2791e8ec1ce0305038
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3187153
> Reviewed-by: Alexander Timin <altimin@chromium.org>
> Reviewed-by: Sean Topping <seantopping@chromium.org>
> Reviewed-by: Scott Violet <sky@chromium.org>
> Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
> Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
> Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
> Reviewed-by: Bo <boliu@chromium.org>
> Commit-Queue: Gabriel Charette <gab@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#940917}

TBR=sky@chromium.org,gab@chromium.org,boliu@chromium.org,rdevlin.cronin@chromium.org,sergeyu@chromium.org,skyostil@chromium.org,altimin@chromium.org,seantopping@chromium.org,chromium-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: I5ebcb181286d31e3a0bfb293c394da00e7970da4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1175074, 1253634, 1269720
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3276956
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: anthonyvd <anthonyvd@chromium.org>
Auto-Submit: Gabriel Charette <gab@chromium.org>
Owners-Override: anthonyvd <anthonyvd@chromium.org>
Cr-Commit-Position: refs/heads/main@{#941225}
2021-11-12 18:05:30 +00:00
Gabriel Charette
67bcc9c2d1 [content] Standardize "message loop starts" signal across Desktop, Android, and browser tests
And make content (BrowserMainLoop) responsible for running the
integration test hook (`MainFunctionParams::ui_task`) instead of each
BrowserMainParts impl doing so slightly differently.

This is mostly a no-op but for some BrowserMainParts which did more work
after running `ui_task`, that work will now happen before `ui_task`
runs.

Metrics recording in //chrome is centralized at the end of
PreMainMessageLoopRun on all platforms.

Standardizing cross-platform ordering avoids forcing 4 awkward ordering
requirements in
https://chromium-review.googlesource.com/c/chromium/src/+/2892251 (see
diff of TODOs no longer needed after rebasing on this CL :
https://chromium-review.googlesource.com/c/chromium/src/+/2892251/44..47)

This also allows getting rid of a force function in
startup_metrics_browsertest.cc to pretend some metrics were logged
(they now actually are without interfering with the product code).

Part of the uncovered portion of BrowserMainLoop::PreMainMessageLoopRun
in browser tests was the part setting disallowance to do Blocking/Wait
operations on main thread. Unfortunately adding this ban breaks many
tests, browser_test_base.cc explicitly inverts those new thread
restrictions in this CL with a TODO to bring them in-line with the
product restrictions.

BrowserMainParts overrides can get also rid of their |run_message_loop_|
variable when moving handling of the browser test hook (`ui_task`) in
WillRunMainMessageLoop(). And in a follow-up they will be updated to
only receive a `bool is_integration_test` from CreateBrowserMainParts
instead of the full MainFunctionParams which none use beyond that bool.

ContentBrowserTestSanityTests verify that browser test bodies still run
as expected with this change.

Bug: 1175074, 1253634
Change-Id: Ib757a02bbd982ef2b1132e2791e8ec1ce0305038
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3187153
Reviewed-by: Alexander Timin <altimin@chromium.org>
Reviewed-by: Sean Topping <seantopping@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/main@{#940917}
2021-11-11 21:13:32 +00:00
Peter Boström
1d6a095400 Remove unused "base/macros.h" in content/
Removes `#include "base/macros.h"` from files in content/ that do not
contain `ignore_result(`.

Bug: 1010217
No-Try: true
Change-Id: I887403408704241047e3bd66e953ff7df195368b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3274993
Commit-Queue: Peter Boström <pbos@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#940781}
2021-11-11 16:07:03 +00:00
Gabriel Charette
fbeeb1c228 [content] Make ContentMainParams and MainFunctionParams move-only
This is taking care of a long-standing TODO to move these OnceClosure
holders rather than copy them around with their OnceClosure* members.

This is a precursor to
https://chromium-review.googlesource.com/c/chromium/src/+/3187153/35#message-fcc92e9f85e73f0e5ba6c03610a95cda8736f1f9
which highlighted a problem where some tests see a non-null
MainFunctionParams::ui_task but running the closure results in a UAF.
Logs show that the test hitting the UAF is not the one setting this
field. This CL makes that impossible and fixes the issue in the
follow-up CL.

This CL is intended to be a logical no-op.
This CL touches a lot of files and must happen all at once.

The core change is that ContentMainParams and MainFunctionParams's
moveable fields (ui_task, created_main_parts_closure, and startup_data)
are now held by moveable types rather than raw pointers.

This trickles in the following chain:
main() (in various *_main.cc)
(or SetUp() in !OS_ANDROID browser_test_base.cc)
  -> ContentMain()
    -> ContentMainRunnerImpl::Initialize()
      (forwards arg into MainFunctionParams)
      -> RunBrowser()
        -> BrowserMain()
          -> BrowserMainRunnerImpl::Initialize()
            -> BrowserMainLoop (stores MainFunctionParams)
            -> BrowserMainLoop::Init
              -> ContentBrowserClient::CreateBrowserMainParts()
                -> (Embedder)ContentBrowserClient::CreateBrowserMainParts()
                  -> (Embedder)BrowserMainParts(Platform)
                    -> (Embedder)BrowserMainParts
      -> RunOtherNamedProcessTypeMain()
        -> (Embedder)ContentMainDelegate::RunProcess()
        (or)
        -> FooMain() (kMainFunctions)
        (or)
        -> RunZygote()
          (creates its own MainFunctionParams)
          -> (Embedder)ContentMainDelegate::RunProcess()
(on OS_ANDROID, browser_test_base.cc calls directly into
 ContentMainDelegate::RunProcess())

Few of these needed the params after passing them down so a move-only
model was simple to adapt (even if invasive). The few exceptions like
BrowserMainRunnerImpl::Initialize consuming |created_main_parts_closure|
are better off in the new model (where they take the OnceClosure before
passing down the params) because that prevents others down the chain
from having access to a OnceClosure they shouldn't invoke anyways.

Noteworthy:
 - ContentMainDelegate::RunProcess():
   Returned an exit_code >= 0 to indicate the embedder elected to handle
   the run request given these params. With move-only semantics it is
   necessary to return the params back when the embedder declines
   handling this run request. An absl::variant return value is used
   to satisfy this requirement.

- content/public/test/test_launcher.h : GetContentMainParams():
  Becomes CopyContentMainParams() and only exposes a copy of copyable
  params. Uses new ContentMainParams::ShallowCopyForTesting() which
  verifies that moveable fields are still null by that time as should be
  the case in the order browser tests are initialized.

- MainFunctionParams::command_line being const& violated the style-guide
  rule to "avoid defining functions that require a const reference
  parameter to outlive the call". This also prevented moving. The type
  was hence switched to a const CommandLine*.

- BUILD.gn changes for nacl_helper_win_64 which requires static linking
  of its minimal //content deps (was previously missing a dep but was
  getting away with it because MainFunctionParams was .h only; required
  now with .cc). This was already done for static_switches and this CL
  adds static_main_function_params, reusing a similar static_features
  target that already existed but was no longer required in
  /c/nacl/broker, cleaning that up by replacing rather than copying that
  target's definition in this CL.

- ContentMainParams::minimal_browser_mode was weirdly passed as a
  parameter to ContentMainRunner::Run(bool start_minimal_browser) but
  that method also has access to the ContentMainParams originally passed
  via ContentMainRunner::Init(). Passing the param again from Run()
  would be a use-after-move in content_main.cc, instead
  content_main_runner_impl.cc was updated to use the param it already
  has in store.

Bug: 1175074
Change-Id: I3af90505525e426383c59107a3903d645d455682
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3244976
Commit-Queue: Gabriel Charette <gab@chromium.org>
Auto-Submit: Gabriel Charette <gab@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Reviewed-by: Brad Nelson <bradnelson@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Clark DuVall <cduvall@chromium.org>
Owners-Override: Alexander Timin <altimin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#940478}
2021-11-10 20:50:06 +00:00
Shelley Vohr
98d8535f02 Add setter for BrowserMainLoop::result_code_.
As part of the refactor in https://chromium-review.googlesource.com/c/chromium/src/+/2725153
the ability to set a custom exit code for the main loop was removed, but
there remain use cases where embedders (e.g. Electron) would still
prefer to be able to set this while remaining in alignment with changes
intended in the above CL.

Electron currently patches this in: https://github.com/electron/electron/blob/main/patches/chromium/add_setter_for_browsermainloop_result_code.patch
and uses it here: cc01272a8d/shell/browser/electron_browser_main_parts.cc (L212-L219)
so upstreaming this would allow us to remove the patch and better align with upstream.

Change-Id: Iaa2729ba85f9e1fcadd051dfbef6e50c408b326e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3241282
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/main@{#935950}
2021-10-28 17:11:36 +00:00
Peter Boström
828b902994 Replace DISALLOW_COPY_AND_ASSIGN in content/
This replaces DISALLOW_COPY_AND_ASSIGN with explicit constructor deletes
where a local script is able to detect its insertion place (~Foo() is
public => insert before this line).

This is incomplete as not all classes have a public ~Foo() declared, so
not all DISALLOW_COPY_AND_ASSIGN occurrences are replaced.

IWYU cleanup is left as a separate pass that is easier when these macros
go away.

Bug: 1010217
Change-Id: Iea478401b7580682c7b9f195f7af9cbbdb6ce315
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3167292
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#923194}
2021-09-21 02:28:43 +00:00
Olivier Li
b0a7b110cf Cover browser UI thread for hang watching beyond main loop.
Bug: 1229627
Change-Id: I90a2ae71fffe5483a4cf27c848e9ac2561c9db18
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3021590
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Olivier Li <olivierli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#902428}
2021-07-16 15:26:56 +00:00
Lei Zhang
698df03c78 Include absl's optional.h in first-party headers.
Many first-party headers reference absl::optional but does not include
the header. Fix this mechanically using the file list generated as
follows:

git ls-files | grep '\.h$' | grep -v third_party | \
    xargs grep -l absl::optional | \
    xargs grep -L '//.*absl::optional' | \
    xargs grep -L override | \
    xargs grep -L '^#include "third_party/abseil-cpp/absl/types/optional\.h"'

Change-Id: I7693f707a416d3088f7cde22cd07b1458c4c5405
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2911952
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Owners-Override: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#885381}
2021-05-21 04:23:34 +00:00
Tom Anderson
b936950aa0 Remove complex GPU->Browser IPC for obtaining GL-compatible visuals
When GLVisualPickerGLX was written, the only way of obtaining
GL-compatible visuals was with libGLX, which loads the GPU driver.
This forced us to rely on the GPU process sending the visuals to the
browser process, which comes with a significant amount of complexity.
Now that we've switched to XProto, we can use x11::Glx to obtain the
visuals, which doesn't require loading the GPU driver.  This allows
us to simplify the visual loading code.

In addition, now that the transparent visual is available early, it
can be used as the visual for browser windows.  This can allow us to
remove usage of the XShape extension which we were using to "cut off"
a few pixels around the corners to give the appearance of rounded
corners.  This solution is not ideal since it:
  1. causes a performance hit on some environments (GNOME/Mutter)
  2. prevents the WM from drawing a shadow on the window
  3. doesn't antialias the corners
Using a transparent visual will solve all 3 issues.  However, we'll
have to draw client-side shadows (just like GTK does).

R=sky

Bug: 650494,811515,1198080
Change-Id: Ie518dfe489d3ba0af9ca73c80cc10792a4214838
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2895228
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: Bo <boliu@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Emily Stark <estark@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Commit-Queue: Emily Stark <estark@chromium.org>
Auto-Submit: Thomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#884257}
2021-05-19 01:06:40 +00:00
Olivier Li
4fc78ac7e7 Support hang watching nested loops
Bug: 1034046
Change-Id: Iab597a55519310d1e2a90bb597b4c9a32e45ae11
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2857195
Commit-Queue: Olivier Li <olivierli@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#883537}
2021-05-17 18:31:47 +00:00
Gabriel Charette
09c6a96eeb [content] Rename MainMessageLoopStart to CreateMainMessageLoop
@QA: This CL is a no-op.

The meaning of this phase has diverged and become increasingly
confusing over the years.
This is not the timing at which the main message loop starts but rather
this is where it is created.

The previous term is easily confused with things like
  VariationsService::PerformPreMainMessageLoopStartup
  startup_metric_utils::RecordBrowserMainMessageLoopStart
that actually represent when the message loop starts.

This confusion has led to new calls being associated with the wrong
phase, e.g.
https://chromium-review.googlesource.com/c/chromium/src/+/2685139/6#message-d1f863178a7982698d1ff5a032b79e33e9e1d5ce

Bug: 1175074
Change-Id: I0535042abe69431501c9b3da3cfb2eae445fde0a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2892278
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Owners-Override: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#883468}
2021-05-17 14:52:59 +00:00
Anton Bikineev
f62d1bf48e content: Replace base::Optional and friends with absl counterparts
This replaces:
- base::Optional -> absl::optional
- include "base/optional.h"
  ->
  include "third_party/abseil-cpp/absl/types/optional.h"
- base::nullopt -> absl::nullopt
- base::make_optional -> absl::make_optional

Bug: 1202909
Change-Id: Ie9f37bcbf6115632a19f4d063387d07b3723926f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2897246
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Owners-Override: Peter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#883270}
2021-05-15 17:56:07 +00:00
Gabriel Charette
e35e7db1eb [content] Fix member ordering documentation in browser_main_loop.h
Most members being explicitly initialized/reset this is intended to be
a logical no-op that brings back the noble intention of documenting
which phase each member is a part of.

R=avi@chromium.org

Bug: 1175074
Change-Id: Iba839f9c430cedc39d9defd88f95da3a81466ead
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2892309
Commit-Queue: Gabriel Charette <gab@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Auto-Submit: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#882068}
2021-05-12 15:30:02 +00:00
Lei Zhang
12341b14c8 Remove unneeded base/files/file_path.h includes in headers.
Headers that do not reference base::FilePath do not need to include
base/files/file_path.h. This reduces the amount of data necessary to
build the chrome target by 175 MB.

Bug: 242216
Change-Id: I7abd8d9fc1862a2dca11292719ab5b9146ab04d1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2878909
Reviewed-by: Peter Boström <pbos@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#880501}
2021-05-07 18:59:39 +00:00
John Abd-El-Malek
f3243dc72e Rename BrowserProcessSubThread to BrowserProcessIOThread to make it clear what it's used for now.
We don't create it in production anymore for UI thread. This wasn't obvious, e.g. see the fix in https://crrev.com/c/2877684.

Bug: 904556
Change-Id: I4e6eaeeafd6144c30c4822a11806dfa24e4363e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2878894
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#880433}
2021-05-07 16:20:01 +00:00
Francois Doray
da23db5bc2 Reland "[base] Stop using ObserverListThreadSafe::NotifySynchronously in FieldTrialList."
== Changes since original CL ==

This CL registers ChildProcessFieldTrialSyncer as a FieldTrialList
observer instead of ChildThreadImpl and it makes
ChildProcessFieldTrialSyncer a leaky singleton. This eliminates
lifetime issues.

An alternative would have been to remove ChildThreadImpl from the list
of FieldTrialList observers upon destruction. We decided not to do that
because it would have required extra synchronization.

Diff: https://crrev.com/c/2867567/1..16

== Original description ==

This CL removes usage of ObserverListThreadSafe::NotifySynchronously
in FieldTrialList, to support the removal of this method in a
separate CL.

Currently, FieldTrialList uses
ObserverListThreadSafe::NotifySynchronously to notify observers when a
group is selected for a field trial. This method dispatches synchronous
notifications to observers which were registered on the current
sequence, and uses PostTask to notify other observers asynchronously.
Through code inspection, we found that all implementations of
FieldTrialList::Observer::OnFieldTrialGroupFinalized are
thread-safe. Therefore, they can always be notified synchronously,
no matter which sequence they were registered from.

This CL makes these changes:

- Observers are stored in a lock-protected std::vector instead of
  in an ObserverListThreadSafe.
- To notify observers, the list of observers is copied to a local
  variable while holding the lock. Then, after releasing the
  lock, all observers in the local list are notified.
- In the scope where observers are notified, an atomic variable is
  incremented. The RemoveObserver method checks that the variable is
  equal to zero. This ensures that no observer is removed while
  dispatching notifications (which could cause a use-after-free).

For reference, the implementations of
FieldTrialList::Observer::OnFieldTrialGroupFinalized are:

base/android/field_trial_list.cc:
  LOG(INFO) is thread-safe

base/metrics/field_trial_unittest.cc:
  The test is single-threaded.

components/variations/child_process_field_trial_syncer_unittest.cc:
  The test is single-threaded.

components/variations/variations_crash_keys.cc:
  The observer checks whether it runs on the UI thread and
  forwards the notification to the UI thread if it's not the case.

components/variations/variations_ids_provider.cc:
  The observer uses a lock.

content/browser/field_trial_synchronizer.cc:
  The observer checks whether it runs on the UI thread and
  forwards the notification to the UI thread if it's not the case.

content/browser/net/network_field_trial_browsertest.cc
  RunLoop::Quit() is thread-safe.

content/child/child_thread_impl.cc
  A mojo::SharedRemote is thread-safe.

Bug: 1193750
Change-Id: I8351a2cbbce4d5deaafbe2aa75f902e6da822d53
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2867567
Commit-Queue: François Doray <fdoray@chromium.org>
Auto-Submit: François Doray <fdoray@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#880105}
2021-05-06 22:34:36 +00:00
Francois Doray
9985b63991 Revert "[base] Stop using ObserverListThreadSafe::NotifySynchronously in FieldTrialList."
This reverts commit c08a6d22da.

Reason: crbug.com/1201501

Bug: 1193750, 1201501
Change-Id: Ia7cddfb32eb3683b55e820190455cef9d164d28d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2867606
Auto-Submit: François Doray <fdoray@chromium.org>
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Commit-Queue: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#879349}
2021-05-05 14:45:37 +00:00
Francois Doray
c08a6d22da [base] Stop using ObserverListThreadSafe::NotifySynchronously in FieldTrialList.
This CL removes usage of ObserverListThreadSafe::NotifySynchronously
in FieldTrialList, to support the removal of this method in a
separate CL.

Currently, FieldTrialList uses
ObserverListThreadSafe::NotifySynchronously to notify observers when a
group is selected for a field trial. This method dispatches synchronous
notifications to observers which were registered on the current
sequence, and uses PostTask to notify other observers asynchronously.
Through code inspection, we found that all implementations of
FieldTrialList::Observer::OnFieldTrialGroupFinalized are
thread-safe. Therefore, they can always be notified synchronously,
no matter which sequence they were registered from.

This CL makes these changes:

- Observers are stored in a lock-protected std::vector instead of
  in an ObserverListThreadSafe.
- To notify observers, the list of observers is copied to a local
  variable while holding the lock. Then, after releasing the
  lock, all observers in the local list are notified.
- In the scope where observers are notified, an atomic variable is
  incremented. The RemoveObserver method checks that the variable is
  equal to zero. This ensures that no observer is removed while
  dispatching notifications (which could cause a use-after-free).

For reference, the implementations of
FieldTrialList::Observer::OnFieldTrialGroupFinalized are:

base/android/field_trial_list.cc:
  LOG(INFO) is thread-safe

base/metrics/field_trial_unittest.cc:
  The test is single-threaded.

components/variations/child_process_field_trial_syncer_unittest.cc:
  The test is single-threaded.

components/variations/variations_crash_keys.cc:
  The observer checks whether it runs on the UI thread and
  forwards the notification to the UI thread if it's not the case.

components/variations/variations_ids_provider.cc:
  The observer uses a lock.

content/browser/field_trial_synchronizer.cc:
  The observer checks whether it runs on the UI thread and
  forwards the notification to the UI thread if it's not the case.

content/browser/net/network_field_trial_browsertest.cc
  RunLoop::Quit() is thread-safe.

content/child/child_thread_impl.cc
  A mojo::SharedRemote is thread-safe.

Bug: 1193750
Change-Id: I0144d3262fca360fbd2a48580e322428510f91d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2785140
Auto-Submit: François Doray <fdoray@chromium.org>
Commit-Queue: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#870762}
2021-04-08 23:38:17 +00:00
Gabriel Charette
a6b6f55521 IWYU for callback_helpers.h
Prereq for https://chromium-review.googlesource.com/c/chromium/src/+/2773408
as we previously had
task_traits.h=>thread_pool.h=>callback_helpers.h

Users that should be including thread_pool.h explicitly did so in
https://chromium-review.googlesource.com/c/chromium/src/+/2775891

These are the remaining users of types in callback_helpers.h that
weren't properly IWYU. e.g.:
../../media/video/software_video_encoder_test.cc:92:54: error: no member named 'NullCallback' in namespace 'base'
std::move(output_cb), base::NullCallback());

Script:

def Fix(file_path):
  content = refactor_lib.ReadFile(file_path)

  # Assume fwd-decls are correct in first pass.
  if 'class ScopedClosureRunner;' in content:
    return False

  # Using base:: prefix ensures we don't match fwd-decls and other
  # things. Will require a few fixups for missing includes in //base
  # proper. Complex prefix in regex attempts to skip comments.
  matches = re.compile(
      r'(\n *[^/\n][^/\n][^/\n]*'
      r'(base::ScopedClosureRunner|base::NullCallback|base::DoNothing)'
      r'\b[^*])',
      re.DOTALL).findall(content)

  if not matches:
    return False

  updated_content = refactor_lib.AddInclude(file_path, content,
                                            "base/callback_helpers.h")

  if updated_content == content:
    return False

  # Write updated file
  refactor_lib.WriteFile(file_path, updated_content)

  return True

Bug: 1026641
Change-Id: Ic7cfec226f1a13b05f4244d5ffcdd2ad8c4e4c3d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2774781
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Owners-Override: François Doray <fdoray@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#865177}
2021-03-22 15:50:35 +00:00
Gabriel Charette
c716bcf3ab [BrowserMainLoop] Do not give embedders the responsibility to run the loop
Refactor BrowserMainParts so that BrowserMainLoop owns the loop and
only gives embedders the opportunity to configure it before it runs it.

This is intended to be a no-op logic wise but will be key in a follow-up
change where the loop will be run in multiple steps (until "first idle"
and then forever with a new BrowserMainParts::OnFirstIdle() phase in
between):
https://chromium-review.googlesource.com/c/chromium/src/+/2678899

It was previously strange to have all phases managed by BrowserMainLoop
(BrowserMainParts is only for Pre/Post); *except* for actually running
the loop.

The key changes are in browser_main_loop.cc and in browser_main_parts.h
where this CL introduces WillRunMainMessageLoop() as a replacement for
an overridable MainMessageLoopRun(). Everything else is a side-effect of
that change (intended to be a no-op).

WillRunMainMessageLoop() was necessary instead of augmenting
PreMainMessageLoopRun() because the latter is part of
CreateStartupTasks() and unintuitively runs in a separate phase of
startup which is not guaranteed to be immediately before
MainMessageLoopRun()...

PreMainMessageLoopRun() was modified slightly to return the |error_code|
like many of its sibling methods already did (this was previously an
out-param on MainMessageLoopRun() but no overrides modified the value
after PreMainMessageLoopRun()).

Also took advantage of this CL to further document each phase's role.

Bug: 1175074
Change-Id: I44f84781340fe15efdeac73c7ac35367b1c216f9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2725153
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Fabrice de Gans-Riberi <fdegans@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Reviewed-by: Sean Topping <seantopping@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#863314}
2021-03-16 16:25:35 +00:00
Alexander Dunaev
344a078ad3 [ozone/x11] Extracted the GPU data manager visual proxy.
This is [1] replicated over the fresh ToT.

There is a proxy class that ensures that GPU sends back correct visuals
on X11.  The class was declared in the anonymous namespace in the
content/browser/browser_main_loop.cc, which made it impossible to use
on Ozone.

This CL extracts the proxy and makes it available to use through the
PlatformGLEGLUtility interface.

In addition, the obsolete VisualID type used in gfx::GpuExtraInfo is
replaced with the x11::VisualId.

[1] https://chromium-review.googlesource.com/c/chromium/src/+/2252102

Bug: 789065
Change-Id: I6390ef8bc89cf118944be42fde78fd64a6c3d36d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2562182
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Robert Kroeger <rjkroege@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Alexander Dunaev <adunaev@igalia.com>
Cr-Commit-Position: refs/heads/master@{#837069}
2020-12-15 13:44:58 +00:00
Ken Rockot
0acd14ae14 Remove Service Manager instance from Content
The Service Manager is no longer used in upstream Chromium or any
upstream embedders other than Cast Shell. This moves ownership of the
browser-process Service Manager instance into //chromecast/browser.

Subsequent changes will also move the implementation into //chromecast
and eliminate other Service Manager public APIs from the rest of the
tree.

Bug: 977637
Change-Id: I9d6351dad1d0ce47f8fcf2594f674ac1b1541e31
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2545764
Reviewed-by: Sean Topping <seantopping@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Ken Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#830321}
2020-11-23 22:14:11 +00:00
Yuta Hijikata
d0a8b6b606 LaCrOS: Replace defined(OS_CHROMEOS) with BUILDFLAG(IS_CHROMEOS_ASH)
The change is mostly mechanical replacing defined(OS_CHROMEOS) with
BUILDFLAG(IS_CHROMEOS_ASH) and GN variable is_chromeos with
is_chromeos_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: Ieb265e116ff6ada5e2f99d609ff12fb9f92727e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2534271
Commit-Queue: Yuta Hijikata <ythjkt@chromium.org>
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#829687}
2020-11-20 16:36:15 +00:00
Sean McAllister
4169556547 Refactor OS_LINUX preprocessor directive for LaCrOS effort.
Currently, ChromeOS defines the OS_LINUX directive as well as
OS_CHROMEOS.  We're working to separate these two, so we're
making the fact that OS_LINUX == OS_LINUX || OS_CHROMEOS
explicit.

Bug: 1110266
Change-Id: Id2f5fbd3e6a41fad40f1cb2920015b6966281557
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2351281
Commit-Queue: Sean McAllister <smcallis@google.com>
Reviewed-by: Greg Thompson <grt@chromium.org>
Reviewed-by: Darwin Huang <huangdarwin@chromium.org>
Reviewed-by: Henrik Grunell <grunell@chromium.org>
Reviewed-by: Henrik Andreasson <henrika@chromium.org>
Reviewed-by: Ilia Samsonov <isamsonov@google.com>
Reviewed-by: Esmael Elmoslimany <aee@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Robert Liao <robliao@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Finnur Thorarinsson <finnur@chromium.org>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Reviewed-by: Tommi <tommi@chromium.org>
Reviewed-by: Eric Roman <eroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799949}
2020-08-20 02:11:09 +00:00
OlivierLi
b4807c2e8f Activate hang watching on the browser UI thread.
This also introduces the first use of HangWatchScopeDisabled to ignore
cases where tasks are not processed because an nested loop is processing
only native events.

Bug: 1034046
Change-Id: I5f425226d20d3c0f75038f0ea234ae7308bcbc9a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2340076
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Commit-Queue: François Doray <fdoray@chromium.org>
Auto-Submit: Oliver Li <olivierli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#798769}
2020-08-17 19:30:25 +00:00
Avi Drissman
7c57be77a7 Migrate to OS_MAC and OS_APPLE in content
Because content is not used by iOS, this migrates
 defined(OS_MACOSX) -> defined(OS_MAC)

Bug: 1105907
Change-Id: Ibf85273fea9c5566594ca00f2589b890515be6c7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2321210
Commit-Queue: Avi Drissman <avi@chromium.org>
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#792842}
2020-07-29 20:09:46 +00:00
Ayu Ishii
ae5d9bf0a9 WebOTP: Revert SmsProvider ownership change
This change reverts this change [1] to give ownership of
SmsProvider back to the BrowserMainLoop to allow incognito
windows to subscribe to the same SmsProvider as non-incognito
windows.

[1] https://crrev.com/c/1960068

Change-Id: Ic88ffaa4019c670be8f77b9a4a1be30c1ea52d70
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2159972
Commit-Queue: Ayu Ishii <ayui@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#764729}
2020-05-01 18:50:09 +00:00
Alex Clarke
9fc39b9b8a Move FieldTrialSynchronizer into content so it can be used by WebLayer
and other embedders.

There doesn't appear to be any existing tests for this functionality
and I'm not sure how to easily test it.

Bug: 1025612
Change-Id: I81354ff16a6bb9c9bc3a9ada99018ad1e2c82031
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1959034
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#737363}
2020-01-31 17:29:47 +00:00