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

Unified Diff: content/shell/shell_content_browser_client.cc

Issue 10693157: Add pak file support for content shell and android apks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 5 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
« no previous file with comments | « content/shell/shell_content_browser_client.h ('k') | content/shell/shell_main_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/shell_content_browser_client.cc
diff --git a/content/shell/shell_content_browser_client.cc b/content/shell/shell_content_browser_client.cc
index 7dace2bb6e0b6c3277dba9f45dc7e4aff56d97b0..ad99d811075a75f361715ed41133b1de6f43f737 100644
--- a/content/shell/shell_content_browser_client.cc
+++ b/content/shell/shell_content_browser_client.cc
@@ -17,6 +17,13 @@
#include "content/shell/shell_switches.h"
#include "googleurl/src/gurl.h"
+#if defined(OS_ANDROID)
+#include "base/android/path_utils.h"
+#include "base/path_service.h"
+#include "base/platform_file.h"
+#include "content/shell/android/shell_descriptors.h"
+#endif
+
namespace content {
ShellContentBrowserClient::ShellContentBrowserClient()
@@ -56,6 +63,27 @@ std::string ShellContentBrowserClient::GetDefaultDownloadName() {
return "download";
}
+#if defined(OS_ANDROID)
+void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
+ const CommandLine& command_line,
+ base::GlobalDescriptors::Mapping* mappings) {
+ int flags = base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ;
+ FilePath pak_file;
+ DCHECK(PathService::Get(base::DIR_ANDROID_APP_DATA, &pak_file));
+ pak_file = pak_file.Append(FILE_PATH_LITERAL("paks"));
+ pak_file = pak_file.Append(FILE_PATH_LITERAL("content_shell.pak"));
+
+ base::PlatformFile f =
+ base::CreatePlatformFile(pak_file, flags, NULL, NULL);
+ if (f == base::kInvalidPlatformFileValue) {
+ NOTREACHED() << "Failed to open file when creating renderer process: "
+ << "content_shell.pak";
+ }
+ mappings->push_back(std::pair<base::GlobalDescriptors::Key, int>(
+ kShellPakDescriptor, f));
+}
+#endif
+
ShellBrowserContext* ShellContentBrowserClient::browser_context() {
return shell_browser_main_parts_->browser_context();
}
« no previous file with comments | « content/shell/shell_content_browser_client.h ('k') | content/shell/shell_main_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698