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

Unified Diff: content/shell/browser/shell_content_browser_client.cc

Issue 2613803003: Simplifying ContentBrowserClient::GetAdditionalMappedFiles...() (Closed)
Patch Set: Addressed jam@'s comment Created 3 years, 11 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/browser/shell_content_browser_client.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/browser/shell_content_browser_client.cc
diff --git a/content/shell/browser/shell_content_browser_client.cc b/content/shell/browser/shell_content_browser_client.cc
index 3783b3c0f349ee355b0b761c4154103b1d57dc5c..323544ffdb2a3a9f9468ce6e7552da703e0ab51d 100644
--- a/content/shell/browser/shell_content_browser_client.cc
+++ b/content/shell/browser/shell_content_browser_client.cc
@@ -330,18 +330,16 @@ void ShellContentBrowserClient::OpenURL(
gfx::Size())->web_contents());
}
-#if defined(OS_ANDROID)
+#if defined(OS_POSIX) && !defined(OS_MACOSX)
void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
const base::CommandLine& command_line,
int child_process_id,
- content::FileDescriptorInfo* mappings,
- std::map<int, base::MemoryMappedFile::Region>* regions) {
- mappings->Share(
- kShellPakDescriptor,
- base::GlobalDescriptors::GetInstance()->Get(kShellPakDescriptor));
- regions->insert(std::make_pair(
+ content::FileDescriptorInfo* mappings) {
+#if defined(OS_ANDROID)
+ mappings->ShareWithRegion(
kShellPakDescriptor,
- base::GlobalDescriptors::GetInstance()->GetRegion(kShellPakDescriptor)));
+ base::GlobalDescriptors::GetInstance()->Get(kShellPakDescriptor),
+ base::GlobalDescriptors::GetInstance()->GetRegion(kShellPakDescriptor));
if (breakpad::IsCrashReporterEnabled()) {
base::File f(breakpad::CrashDumpManager::GetInstance()->CreateMinidumpFile(
@@ -354,18 +352,15 @@ void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
base::ScopedFD(f.TakePlatformFile()));
}
}
-}
-#elif defined(OS_POSIX) && !defined(OS_MACOSX)
-void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
- const base::CommandLine& command_line,
- int child_process_id,
- content::FileDescriptorInfo* mappings) {
+
+#else
int crash_signal_fd = GetCrashSignalFD(command_line);
if (crash_signal_fd >= 0) {
mappings->Share(kCrashDumpSignal, crash_signal_fd);
}
-}
#endif // defined(OS_ANDROID)
+}
+#endif // defined(OS_POSIX) && !defined(OS_MACOSX)
#if defined(OS_WIN)
bool ShellContentBrowserClient::PreSpawnRenderer(
« no previous file with comments | « content/shell/browser/shell_content_browser_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698