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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
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}
@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}
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}
== 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}
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}
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}
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}
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}
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}
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}