| 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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 const base::CommandLine& command_line, | 323 const base::CommandLine& command_line, |
| 324 int child_process_id, | 324 int child_process_id, |
| 325 content::FileDescriptorInfo* mappings, | 325 content::FileDescriptorInfo* mappings, |
| 326 std::map<int, base::MemoryMappedFile::Region>* regions) { | 326 std::map<int, base::MemoryMappedFile::Region>* regions) { |
| 327 mappings->Share( | 327 mappings->Share( |
| 328 kShellPakDescriptor, | 328 kShellPakDescriptor, |
| 329 base::GlobalDescriptors::GetInstance()->Get(kShellPakDescriptor)); | 329 base::GlobalDescriptors::GetInstance()->Get(kShellPakDescriptor)); |
| 330 regions->insert(std::make_pair( | 330 regions->insert(std::make_pair( |
| 331 kShellPakDescriptor, | 331 kShellPakDescriptor, |
| 332 base::GlobalDescriptors::GetInstance()->GetRegion(kShellPakDescriptor))); | 332 base::GlobalDescriptors::GetInstance()->GetRegion(kShellPakDescriptor))); |
| 333 | 333 breakpad::CrashDumpObserver::GetInstance()->BrowserChildProcessStarted( |
| 334 if (breakpad::IsCrashReporterEnabled()) { | 334 child_process_id, mappings); |
| 335 base::File f(breakpad::CrashDumpManager::GetInstance()->CreateMinidumpFile( | |
| 336 child_process_id)); | |
| 337 if (!f.IsValid()) { | |
| 338 LOG(ERROR) << "Failed to create file for minidump, crash reporting will " | |
| 339 << "be disabled for this process."; | |
| 340 } else { | |
| 341 mappings->Transfer(kAndroidMinidumpDescriptor, | |
| 342 base::ScopedFD(f.TakePlatformFile())); | |
| 343 } | |
| 344 } | |
| 345 } | 335 } |
| 346 #elif defined(OS_POSIX) && !defined(OS_MACOSX) | 336 #elif defined(OS_POSIX) && !defined(OS_MACOSX) |
| 347 void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess( | 337 void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess( |
| 348 const base::CommandLine& command_line, | 338 const base::CommandLine& command_line, |
| 349 int child_process_id, | 339 int child_process_id, |
| 350 content::FileDescriptorInfo* mappings) { | 340 content::FileDescriptorInfo* mappings) { |
| 351 int crash_signal_fd = GetCrashSignalFD(command_line); | 341 int crash_signal_fd = GetCrashSignalFD(command_line); |
| 352 if (crash_signal_fd >= 0) { | 342 if (crash_signal_fd >= 0) { |
| 353 mappings->Share(kCrashDumpSignal, crash_signal_fd); | 343 mappings->Share(kCrashDumpSignal, crash_signal_fd); |
| 354 } | 344 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 375 ShellBrowserContext* ShellContentBrowserClient::browser_context() { | 365 ShellBrowserContext* ShellContentBrowserClient::browser_context() { |
| 376 return shell_browser_main_parts_->browser_context(); | 366 return shell_browser_main_parts_->browser_context(); |
| 377 } | 367 } |
| 378 | 368 |
| 379 ShellBrowserContext* | 369 ShellBrowserContext* |
| 380 ShellContentBrowserClient::off_the_record_browser_context() { | 370 ShellContentBrowserClient::off_the_record_browser_context() { |
| 381 return shell_browser_main_parts_->off_the_record_browser_context(); | 371 return shell_browser_main_parts_->off_the_record_browser_context(); |
| 382 } | 372 } |
| 383 | 373 |
| 384 } // namespace content | 374 } // namespace content |
| OLD | NEW |