OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/shell/browser/shell_content_browser_client.h" | 5 #include "content/shell/browser/shell_content_browser_client.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/base_switches.h" | 10 #include "base/base_switches.h" |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 const base::CommandLine& command_line, | 297 const base::CommandLine& command_line, |
298 int child_process_id, | 298 int child_process_id, |
299 content::FileDescriptorInfo* mappings, | 299 content::FileDescriptorInfo* mappings, |
300 std::map<int, base::MemoryMappedFile::Region>* regions) { | 300 std::map<int, base::MemoryMappedFile::Region>* regions) { |
301 mappings->Share( | 301 mappings->Share( |
302 kShellPakDescriptor, | 302 kShellPakDescriptor, |
303 base::GlobalDescriptors::GetInstance()->Get(kShellPakDescriptor)); | 303 base::GlobalDescriptors::GetInstance()->Get(kShellPakDescriptor)); |
304 regions->insert(std::make_pair( | 304 regions->insert(std::make_pair( |
305 kShellPakDescriptor, | 305 kShellPakDescriptor, |
306 base::GlobalDescriptors::GetInstance()->GetRegion(kShellPakDescriptor))); | 306 base::GlobalDescriptors::GetInstance()->GetRegion(kShellPakDescriptor))); |
307 | 307 breakpad::CrashDumpObserver::GetInstance()->BrowserChildProcessStarted( |
308 if (breakpad::IsCrashReporterEnabled()) { | 308 child_process_id, mappings); |
309 base::File f(breakpad::CrashDumpManager::GetInstance()->CreateMinidumpFile( | |
310 child_process_id)); | |
311 if (!f.IsValid()) { | |
312 LOG(ERROR) << "Failed to create file for minidump, crash reporting will " | |
313 << "be disabled for this process."; | |
314 } else { | |
315 mappings->Transfer(kAndroidMinidumpDescriptor, | |
316 base::ScopedFD(f.TakePlatformFile())); | |
317 } | |
318 } | |
319 } | 309 } |
320 #elif defined(OS_POSIX) && !defined(OS_MACOSX) | 310 #elif defined(OS_POSIX) && !defined(OS_MACOSX) |
321 void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess( | 311 void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess( |
322 const base::CommandLine& command_line, | 312 const base::CommandLine& command_line, |
323 int child_process_id, | 313 int child_process_id, |
324 content::FileDescriptorInfo* mappings) { | 314 content::FileDescriptorInfo* mappings) { |
325 int crash_signal_fd = GetCrashSignalFD(command_line); | 315 int crash_signal_fd = GetCrashSignalFD(command_line); |
326 if (crash_signal_fd >= 0) { | 316 if (crash_signal_fd >= 0) { |
327 mappings->Share(kCrashDumpSignal, crash_signal_fd); | 317 mappings->Share(kCrashDumpSignal, crash_signal_fd); |
328 } | 318 } |
(...skipping 20 matching lines...) Expand all Loading... |
349 ShellBrowserContext* ShellContentBrowserClient::browser_context() { | 339 ShellBrowserContext* ShellContentBrowserClient::browser_context() { |
350 return shell_browser_main_parts_->browser_context(); | 340 return shell_browser_main_parts_->browser_context(); |
351 } | 341 } |
352 | 342 |
353 ShellBrowserContext* | 343 ShellBrowserContext* |
354 ShellContentBrowserClient::off_the_record_browser_context() { | 344 ShellContentBrowserClient::off_the_record_browser_context() { |
355 return shell_browser_main_parts_->off_the_record_browser_context(); | 345 return shell_browser_main_parts_->off_the_record_browser_context(); |
356 } | 346 } |
357 | 347 |
358 } // namespace content | 348 } // namespace content |
OLD | NEW |