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

Unified Diff: shell/android/main.cc

Issue 1364243002: Bundle core applicatons in the shell. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Follow review Created 5 years, 3 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: shell/android/main.cc
diff --git a/shell/android/main.cc b/shell/android/main.cc
index 05e62cea1c9a4864e69b1a952f0c0e08e27f8626..92d4bb3e5a3ff8f355a795612127eb00e22bc2cc 100644
--- a/shell/android/main.cc
+++ b/shell/android/main.cc
@@ -32,6 +32,7 @@
#include "shell/android/java_application_loader.h"
#include "shell/android/native_viewport_application_loader.h"
#include "shell/android/ui_application_loader_android.h"
+#include "shell/android/url_response_disk_cache_delegate_impl.h"
#include "shell/application_manager/application_loader.h"
#include "shell/background_application_loader.h"
#include "shell/command_line_util.h"
@@ -95,6 +96,10 @@ struct InternalShellData {
// Event signalling when the shell task runner has been initialized.
scoped_ptr<base::WaitableEvent> shell_runner_ready;
+
+ // Delegate for URLResponseDiskCache. Allows to access bundled application on
+ // cold start.
+ scoped_ptr<URLResponseDiskCacheDelegateImpl> url_response_disk_cache_delegate;
};
LazyInstance<InternalShellData> g_internal_data = LAZY_INSTANCE_INITIALIZER;
@@ -147,7 +152,9 @@ void MojoShellRunner::Run() {
Context* context = g_internal_data.Get().context.get();
ConfigureAndroidServices(context);
- CHECK(context->InitWithPaths(mojo_shell_child_path_));
+ CHECK(context->InitWithPaths(
+ mojo_shell_child_path_,
+ g_internal_data.Get().url_response_disk_cache_delegate.get()));
RunCommandLineApps(context);
@@ -219,6 +226,7 @@ void UploadCrashes(const base::FilePath& dumps_path) {
static void Start(JNIEnv* env,
jclass clazz,
jobject application_context,
+ jobject j_asset_manager,
jstring mojo_shell_child_path,
jobjectArray jparameters,
jstring j_local_apps_directory,
@@ -284,6 +292,9 @@ static void Start(JNIEnv* env,
base::android::ConvertJavaStringToUTF8(env, j_local_apps_directory)));
g_internal_data.Get().context.reset(shell_context);
+ g_internal_data.Get().url_response_disk_cache_delegate.reset(
+ new URLResponseDiskCacheDelegateImpl(shell_context, j_asset_manager));
+
g_internal_data.Get().java_message_loop.reset(new base::MessageLoopForUI);
base::MessageLoopForUI::current()->Start();
tracer->DidCreateMessageLoop();
« no previous file with comments | « shell/android/apk/src/org/chromium/mojo/shell/ShellService.java ('k') | shell/android/url_response_disk_cache_delegate_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698