Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1992)

Unified Diff: content/public/android/java/org/chromium/content/browser/AndroidBrowserProcess.java

Issue 10626017: Provide a common interface for all Android app resources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/public/android/java/org/chromium/content/browser/AndroidBrowserProcess.java
diff --git a/content/public/android/java/org/chromium/content/browser/AndroidBrowserProcess.java b/content/public/android/java/org/chromium/content/browser/AndroidBrowserProcess.java
index f848e17f9668c3e3b80ab56fbad906ac25981dee..28f163de853f1a489a4942f0e45da922a48afc80 100644
--- a/content/public/android/java/org/chromium/content/browser/AndroidBrowserProcess.java
+++ b/content/public/android/java/org/chromium/content/browser/AndroidBrowserProcess.java
@@ -9,6 +9,7 @@ import android.content.Context;
import android.content.res.Resources;
import android.util.Log;
+import org.chromium.content.app.AppResource;
import org.chromium.content.app.ContentMain;
import org.chromium.content.app.LibraryLoader;
import org.chromium.content.browser.ContentView;
@@ -89,6 +90,23 @@ public class AndroidBrowserProcess {
Context appContext = context.getApplicationContext();
+ // This block is inside genericChromiumProcessInit() instead
+ // of initChromiumBrowserProcess() to make sure we do it once.
+ // In here it is protected with the sInitialized.
+ if (hostIsChrome) {
+ if (nativeIsOfficialBuild() ||
+ CommandLine.getInstance().hasSwitch(CommandLine.ADD_OFFICIAL_COMMAND_LINE)) {
+ Resources res = context.getResources();
+ try {
+ String[] switches = res.getStringArray(AppResource.ARRAY_OFFICIAL_COMMAND_LINE);
+ CommandLine.getInstance().appendSwitchesAndArguments(switches);
+ } catch (Resources.NotFoundException e) {
+ // Do nothing. It is fine to have no command line
+ // additions for an official build.
+ }
+ }
+ }
+
int maxRenderers = normalizeMaxRendererProcesses(appContext, maxRendererProcesses);
Log.i(TAG, "Initializing chromium process, renderers=" + maxRenderers +
" hostIsChrome=" + hostIsChrome);

Powered by Google App Engine
This is Rietveld 408576698