Commit f62ac057 authored by Min Qin's avatar Min Qin Committed by Commit Bot

Don't call ProcessInitializationHandler.initializePostNative() when running ServiceManager only.

All codes in ProcessInitializationHandler.initializePostNative() requires
full browser to run. And some of the class uses profile during initialization,
which will crash when only service manager is running. As a result, there is
no need to run this method if full browser is not launched.
For services, they should add their own required tasks in
ChromeBrowserInitializer.handlePostNativeStartup.

BUG=695115

Change-Id: I66f314cfcb56df00553f017d3e5b6989e3a9ef60
Reviewed-on: https://chromium-review.googlesource.com/1182008Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Reviewed-by: default avatarXi Han <hanxi@chromium.org>
Commit-Queue: Min Qin <qinmin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585341}
parent 389f290c
...@@ -272,12 +272,16 @@ public class ChromeBrowserInitializer { ...@@ -272,12 +272,16 @@ public class ChromeBrowserInitializer {
+ "ChromeBrowserInitializer.postInflationStartup has been run."); + "ChromeBrowserInitializer.postInflationStartup has been run.");
} }
final ChainedTasks tasks = new ChainedTasks(); final ChainedTasks tasks = new ChainedTasks();
tasks.add(new Runnable() { // If full browser process is not going to be launched, it is up to individual service to
@Override // launch its required components.
public void run() { if (!delegate.startServiceManagerOnly()) {
ProcessInitializationHandler.getInstance().initializePostNative(); tasks.add(new Runnable() {
} @Override
}); public void run() {
ProcessInitializationHandler.getInstance().initializePostNative();
}
});
}
tasks.add(new Runnable() { tasks.add(new Runnable() {
@Override @Override
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment