Skip to content

Commit

Permalink
Initialize the application context prior to initializing command line…
Browse files Browse the repository at this point in the history
… flags.

We used to initialize the command line flags prior to setting the
application context in Android's BrowserStartupController.

When determining the command line flags for the renderer, certain flags
may be dependent on the Android SDK version being used. Getting this value
through base::android::BuildInfo requires the application context to be known.

This change makes sure that we initialize the application context prior to
calling the native SetCommandLineFlags function.

BUG=

Review URL: https://codereview.chromium.org/925423002

Cr-Commit-Position: refs/heads/master@{#316565}
  • Loading branch information
beverloo authored and Commit bot committed Feb 17, 2015
1 parent 532e48b commit 5335d25
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,8 @@ void prepareToStartBrowserProcess(boolean singleProcess) throws ProcessInitExcep
// Now we really need to have the resources ready.
resourceExtractor.waitForCompletion();

nativeSetCommandLineFlags(singleProcess, nativeIsPluginEnabled() ? getPlugins() : null);
ContentMain.initApplicationContext(appContext);
nativeSetCommandLineFlags(singleProcess, nativeIsPluginEnabled() ? getPlugins() : null);
}

/**
Expand All @@ -294,6 +294,8 @@ public void initChromiumBrowserProcessForTests() {
ResourceExtractor resourceExtractor = ResourceExtractor.get(mContext);
resourceExtractor.startExtractingResources();
resourceExtractor.waitForCompletion();

ContentMain.initApplicationContext(mContext.getApplicationContext());
nativeSetCommandLineFlags(false, null);
}

Expand Down

0 comments on commit 5335d25

Please sign in to comment.