This ensures the Service Manager is always initialized by
ContentMainRunnerImpl early in process startup, rather than potentially
deferring until BrowserMainLoop runs. The main motivation here is to
have only one place in browser code where the Service Manager is
initialized.
This also begins peeling away at some of the unnecessary dependencies on
ServiceManagerConnection and ServiceManagerContext, since both are slated
for deletion.
Finally, this adds a public content::GetSystemConnector API to
content/public/browser as a drop-in replacement for
ServiceManagerConnection::GetForProcess()->GetConnector(). Moving
forward, this is the API that new browser code should use when
connecting to services. The API is available very early in browser
startup, even before BrowserMainLoop is instantiated.
Bug: 904240, 968147
Change-Id: I933dc8a4bf268cec92eaa4cbdc452c1fc2a08898
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1650155
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Xi Han <hanxi@chromium.org>
Reviewed-by: Olga Sharonova <olka@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#668977}
Currently the globally accessible PowerMonitor is created and owned by
BrowserMainLoop which is not created/run in reduced. In order to allow
PowerMonitor to be used in reduced mode, it is created in
ContentMainRunner and passed to BrowserMainLoop once full browser
starts.
Bug: 968247
Change-Id: If307dcbfb7f8ff0c7d34c2f4740f4a19ec77bf20
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1635861
Reviewed-by: Xi Han <hanxi@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Mohamed Heikal <mheikal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664566}
This relands commit f481306ad9. The CL
got reverted because BrowserMainLoopTest.CreateThreadsInSingleProcess
is falling on Windows. In this CL, we remove the call of
BrowserMainLoop#InitilaizeMojo() which isn't necessary for the test.
Beside, also re-enable two tests which were disabled when the reverting
CL landed:
* RenderThreadImplBrowserTest.NonResourceDispatchIPCTasksDontGoThroughScheduler
The original cl description is:
This CL instantiates the ServiceManagerContext before creating
the BrowserMainRunner. It splits the startup path into two,
with/without starting the full browser. The changes are implemented
behind a flag "allow-start-service-manager-only".
Bug: 846846,902311
Change-Id: I6e3f6518e414e1298e57b55bd188879461d8f342
Reviewed-on: https://chromium-review.googlesource.com/c/1327413
Commit-Queue: Xi Han <hanxi@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611340}
This reverts commit f481306ad9 and
disables following tests on Windows:
* RenderThreadImplBrowserTest.NonResourceDispatchIPCTasksDontGoThroughScheduler
* UserScriptListenerTest.NavigationWaitsForContentScriptsToLoad
Reason for revert: Causes BrowserMainLoopTest, CreateThreadsInSingleProcess to fail every time content_unittests is run, if DCHECKs are enabled.
Original change's description:
> Reland "Start ServiceManger before creating BrowserMainLoop."
>
> This relands commit aa60c21940. The original CL
> (https://crrev.com/c/1113802) got reverted becuase FeatureList and field
> trials are not setup properly in early startup in Android WebView, but
> ServiceMangerContext has checked features. See crbug.com/899376. The fix is
> in a separate CL: https://crrev.com/c/1305876. Another related precursor CL
> is: https://crrev.com/c/1308096.
>
> This CL is an exact copy of the original CL.
>
> The original cl description is:
> This CL instantiates the ServiceManagerContext before creating
> the BrowserMainRunner. It splits the startup path into two,
> with/without starting the full browser. The changes are implemented
> behind a flag "allow-start-service-manager-only".
>
> Bug: 846846,729596
> TBR: jam@chromium.org
> Change-Id: I5214af850d4ef256c9d223db059ed009a42de714
> Reviewed-on: https://chromium-review.googlesource.com/c/1305822
> Commit-Queue: Xi Han <hanxi@chromium.org>
> Reviewed-by: Gabriel Charette <gab@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#604969}
TBR=gab@chromium.org,jam@chromium.org,hanxi@chromium.org
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: 846846, 729596, 902311
Change-Id: I8b46711602a240023f4a03a69aa70f66d4eee726
Reviewed-on: https://chromium-review.googlesource.com/c/1322343
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606004}
This relands commit aa60c21940. The original CL
(https://crrev.com/c/1113802) got reverted becuase FeatureList and field
trials are not setup properly in early startup in Android WebView, but
ServiceMangerContext has checked features. See crbug.com/899376. The fix is
in a separate CL: https://crrev.com/c/1305876. Another related precursor CL
is: https://crrev.com/c/1308096.
This CL is an exact copy of the original CL.
The original cl description is:
This CL instantiates the ServiceManagerContext before creating
the BrowserMainRunner. It splits the startup path into two,
with/without starting the full browser. The changes are implemented
behind a flag "allow-start-service-manager-only".
Bug: 846846,729596
TBR: jam@chromium.org
Change-Id: I5214af850d4ef256c9d223db059ed009a42de714
Reviewed-on: https://chromium-review.googlesource.com/c/1305822
Commit-Queue: Xi Han <hanxi@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604969}
This reverts commit aa60c21940.
Reason for revert: it breaks network_service_webview_instrumentation_test_apk on Mojo Android Build:
https://bugs.chromium.org/p/chromium/issues/detail?id=899376
Bug:899376
Original change's description:
> Start ServiceManger before creating BrowserMainLoop.
>
> This CL instantiates the ServiceManagerContext before creating
> the BrowserMainRunner. It splits the startup path into two,
> with/without starting the full browser. The changes are implemented
> behind a flag "allow-start-service-manager-only".
>
> Bug: 846846,729596
> Change-Id: I3584db0d89a10e59d6041e0f4412aaffdc840568
> Reviewed-on: https://chromium-review.googlesource.com/c/1113802
> Commit-Queue: Xi Han <hanxi@chromium.org>
> Reviewed-by: John Abd-El-Malek <jam@chromium.org>
> Reviewed-by: Gabriel Charette <gab@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#603092}
TBR=gab@chromium.org,jam@chromium.org,hanxi@chromium.org
Change-Id: I866cc2148d529d0d7a02d0ac75b2817d1695a8c9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 846846, 729596
Reviewed-on: https://chromium-review.googlesource.com/c/1303042
Reviewed-by: Xi Han <hanxi@chromium.org>
Commit-Queue: Xi Han <hanxi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#603194}
This CL instantiates the ServiceManagerContext before creating
the BrowserMainRunner. It splits the startup path into two,
with/without starting the full browser. The changes are implemented
behind a flag "allow-start-service-manager-only".
Bug: 846846,729596
Change-Id: I3584db0d89a10e59d6041e0f4412aaffdc840568
Reviewed-on: https://chromium-review.googlesource.com/c/1113802
Commit-Queue: Xi Han <hanxi@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#603092}
Introduce StartupData in /content/public/browser, and
StartupDataImpl in /content/browser.
This is a precursor CL for: https://crrev.com/c/1108178. In the
follow up CL, StartupData* will be plumbed via
MainFunctionParams to create the browser main loop.
Bug: 846846, 853308
Change-Id: Ic192cfa696439996dec07435f1980d78282f15db
Reviewed-on: https://chromium-review.googlesource.com/1117471
Commit-Queue: Xi Han <hanxi@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#573943}