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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 10876056: Additional file descriptor mappings for Android (Closed) Base URL: http://git.chromium.org/chromium/src.git@x509
Patch Set: Add descriptor_android.h to gyp Created 8 years, 2 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 | « chrome/app/chrome_main_delegate.cc ('k') | chrome/chrome_common.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index fa09d6586cfc175c0352b25489085398a6ffdc79..d2558b73f9b4631ed05f3a870b957c6bc147b32a 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -10,6 +10,7 @@
#include "base/bind.h"
#include "base/command_line.h"
+#include "base/path_service.h"
#include "base/string_tokenizer.h"
#include "base/utf_string_conversions.h"
#include "chrome/app/breakpad_mac.h"
@@ -119,6 +120,7 @@
#include "chrome/browser/chrome_browser_main_linux.h"
#elif defined(OS_ANDROID)
#include "chrome/browser/chrome_browser_main_android.h"
+#include "chrome/common/descriptors_android.h"
#elif defined(OS_POSIX)
#include "chrome/browser/chrome_browser_main_posix.h"
#endif
@@ -132,6 +134,10 @@
#include "chrome/browser/captive_portal/captive_portal_tab_helper.h"
#endif
+#if defined(OS_ANDROID)
+#include "ui/base/ui_base_paths.h"
+#endif
+
#if defined(USE_NSS)
#include "chrome/browser/ui/crypto_module_password_dialog.h"
#endif
@@ -1747,6 +1753,34 @@ void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
FileDescriptor(crash_signal_fd,
false)));
}
+#if defined(OS_ANDROID)
+ FilePath data_path;
+ PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &data_path);
+ DCHECK(!data_path.empty());
+
+ int flags = base::PLATFORM_FILE_OPEN | base::PLATFORM_FILE_READ;
+ FilePath chrome_pak = data_path.AppendASCII("chrome.pak");
+ base::PlatformFile f =
+ base::CreatePlatformFile(chrome_pak, flags, NULL, NULL);
+ DCHECK(f != base::kInvalidPlatformFileValue);
+ mappings->push_back(FileDescriptorInfo(kAndroidChromePakDescriptor,
+ FileDescriptor(f, true)));
+
+ FilePath chrome_resources_pak =
+ data_path.AppendASCII("chrome_100_percent.pak");
+ f = base::CreatePlatformFile(chrome_resources_pak, flags, NULL, NULL);
+ DCHECK(f != base::kInvalidPlatformFileValue);
+ mappings->push_back(FileDescriptorInfo(kAndroidUIResourcesPakDescriptor,
+ FileDescriptor(f, true)));
+
+ const std::string locale = GetApplicationLocale();
+ FilePath locale_pak = ResourceBundle::GetSharedInstance().
+ GetLocaleFilePath(locale, false);
+ f = base::CreatePlatformFile(locale_pak, flags, NULL, NULL);
+ DCHECK(f != base::kInvalidPlatformFileValue);
+ mappings->push_back(FileDescriptorInfo(kAndroidLocalePakDescriptor,
+ FileDescriptor(f, true)));
+#endif // defined(OS_ANDROID)
}
#endif // defined(OS_POSIX) && !defined(OS_MACOSX)
« no previous file with comments | « chrome/app/chrome_main_delegate.cc ('k') | chrome/chrome_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698