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

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

Issue 585203002: Turn FileDescriptorInfo a collection class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing android build error Created 6 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: 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 b1f6e07752f23db5f9c0a135c2ea843991342ff9..8be9b36e0be04d6a41984b89517ab64c278d3730 100644
--- a/content/shell/browser/shell_content_browser_client.cc
+++ b/content/shell/browser/shell_content_browser_client.cc
@@ -357,7 +357,7 @@ ShellContentBrowserClient::GetDevToolsManagerDelegate() {
void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
const CommandLine& command_line,
int child_process_id,
- std::vector<FileDescriptorInfo>* mappings) {
+ FileDescriptorInfo* mappings) {
#if defined(OS_ANDROID)
int flags = base::File::FLAG_OPEN | base::File::FLAG_READ;
base::FilePath pak_file;
@@ -371,8 +371,8 @@ void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
NOTREACHED() << "Failed to open file when creating renderer process: "
<< "content_shell.pak";
}
- mappings->push_back(
- FileDescriptorInfo(kShellPakDescriptor, base::FileDescriptor(f.Pass())));
+
+ mappings->Transfer(kShellPakDescriptor, base::ScopedFD(f.TakePlatformFile()));
if (breakpad::IsCrashReporterEnabled()) {
f = breakpad::CrashDumpManager::GetInstance()->CreateMinidumpFile(
@@ -381,16 +381,14 @@ void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
LOG(ERROR) << "Failed to create file for minidump, crash reporting will "
<< "be disabled for this process.";
} else {
- mappings->push_back(
- FileDescriptorInfo(kAndroidMinidumpDescriptor,
- base::FileDescriptor(f.Pass())));
+ mappings->Transfer(kAndroidMinidumpDescriptor,
+ base::ScopedFD(f.TakePlatformFile()));
}
}
#else // !defined(OS_ANDROID)
int crash_signal_fd = GetCrashSignalFD(command_line);
if (crash_signal_fd >= 0) {
- mappings->push_back(FileDescriptorInfo(
- kCrashDumpSignal, base::FileDescriptor(crash_signal_fd, false)));
+ mappings->Share(kCrashDumpSignal, crash_signal_fd);
}
#endif // defined(OS_ANDROID)
}

Powered by Google App Engine
This is Rietveld 408576698