diff options
author | aberent@chromium.org <aberent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-27 15:29:56 +0000 |
---|---|---|
committer | aberent@chromium.org <aberent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-27 15:29:56 +0000 |
commit | 232e09d18fa339b9dcb49f30d2e919fe673da1c5 (patch) | |
tree | d1a7e8698c6a7fab8f3f7925a81760f18504d5f7 /content/shell/android | |
parent | dc0fd43f60f29a9167f90cf1559ce1adc17d9969 (diff) | |
download | chromium_src-232e09d18fa339b9dcb49f30d2e919fe673da1c5.zip chromium_src-232e09d18fa339b9dcb49f30d2e919fe673da1c5.tar.gz chromium_src-232e09d18fa339b9dcb49f30d2e919fe673da1c5.tar.bz2 |
Allow overlapping sync and async startup requests
On Android we can get a second request to start the browser while
the an asynchronous request is in progress. Since the second
request may be synchronous, we may have switch to completing
initialization synchronously. This patch handles this by tracking
which initialization tasks have been run, and running the remaining
initialization tasks.
BUG=260574
Review URL: https://chromiumcodereview.appspot.com/22691002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@219795 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/shell/android')
2 files changed, 11 insertions, 13 deletions
diff --git a/content/shell/android/browsertests_apk/src/org/chromium/content_browsertests_apk/ContentBrowserTestsActivity.java b/content/shell/android/browsertests_apk/src/org/chromium/content_browsertests_apk/ContentBrowserTestsActivity.java index 3f25e68..d7aeecf 100644 --- a/content/shell/android/browsertests_apk/src/org/chromium/content_browsertests_apk/ContentBrowserTestsActivity.java +++ b/content/shell/android/browsertests_apk/src/org/chromium/content_browsertests_apk/ContentBrowserTestsActivity.java @@ -7,13 +7,13 @@ package org.chromium.content_browsertests_apk; import android.app.Activity; import android.content.Context; import android.os.Bundle; +import android.util.Log; import android.view.LayoutInflater; import android.view.View; -import android.util.Log; import org.chromium.base.JNINamespace; import org.chromium.content.app.LibraryLoader; -import org.chromium.content.browser.AndroidBrowserProcess; +import org.chromium.content.browser.BrowserStartupController; import org.chromium.content.common.ProcessInitException; import org.chromium.content_shell.ShellManager; import org.chromium.ui.WindowAndroid; @@ -34,7 +34,7 @@ public class ContentBrowserTestsActivity extends Activity { } catch (ProcessInitException e) { Log.i(TAG, "Cannot load content_browsertests:" + e); } - AndroidBrowserProcess.initChromiumBrowserProcessForTests(getApplicationContext()); + BrowserStartupController.get(getApplicationContext()).initChromiumBrowserProcessForTests(); LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); diff --git a/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java b/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java index 2d819e9..c98ba12 100644 --- a/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java +++ b/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java @@ -18,7 +18,6 @@ import org.chromium.base.ChromiumActivity; import org.chromium.base.MemoryPressureListener; import org.chromium.content.app.LibraryLoader; import org.chromium.content.browser.ActivityContentVideoViewClient; -import org.chromium.content.browser.AndroidBrowserProcess; import org.chromium.content.browser.BrowserStartupController; import org.chromium.content.browser.ContentVideoViewClient; import org.chromium.content.browser.ContentView; @@ -47,15 +46,15 @@ public class ContentShellActivity extends ChromiumActivity { public static final String COMMAND_LINE_ARGS_KEY = "commandLineArgs"; /** - * Sending an intent with this action will simulate a memory pressure signal - * at a critical level. + * Sending an intent with this action will simulate a memory pressure signal at a critical + * level. */ private static final String ACTION_LOW_MEMORY = "org.chromium.content_shell.action.ACTION_LOW_MEMORY"; /** - * Sending an intent with this action will simulate a memory pressure signal - * at a moderate level. + * Sending an intent with this action will simulate a memory pressure signal at a moderate + * level. */ private static final String ACTION_TRIM_MEMORY_MODERATE = "org.chromium.content_shell.action.ACTION_TRIM_MEMORY_MODERATE"; @@ -100,11 +99,10 @@ public class ContentShellActivity extends ChromiumActivity { } if (CommandLine.getInstance().hasSwitch(CommandLine.DUMP_RENDER_TREE)) { - try { - if (!AndroidBrowserProcess.init(this, AndroidBrowserProcess.MAX_RENDERERS_LIMIT)) { - finishInitialization(savedInstanceState); - } - } catch (ProcessInitException e) { + if(BrowserStartupController.get(this).startBrowserProcessesSync( + BrowserStartupController.MAX_RENDERERS_LIMIT)) { + finishInitialization(savedInstanceState); + } else { initializationFailed(); } } else { |