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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 const base::CommandLine& command_line, | 336 const base::CommandLine& command_line, |
337 int child_process_id, | 337 int child_process_id, |
338 content::FileDescriptorInfo* mappings, | 338 content::FileDescriptorInfo* mappings, |
339 std::map<int, base::MemoryMappedFile::Region>* regions) { | 339 std::map<int, base::MemoryMappedFile::Region>* regions) { |
340 mappings->Share( | 340 mappings->Share( |
341 kShellPakDescriptor, | 341 kShellPakDescriptor, |
342 base::GlobalDescriptors::GetInstance()->Get(kShellPakDescriptor)); | 342 base::GlobalDescriptors::GetInstance()->Get(kShellPakDescriptor)); |
343 regions->insert(std::make_pair( | 343 regions->insert(std::make_pair( |
344 kShellPakDescriptor, | 344 kShellPakDescriptor, |
345 base::GlobalDescriptors::GetInstance()->GetRegion(kShellPakDescriptor))); | 345 base::GlobalDescriptors::GetInstance()->GetRegion(kShellPakDescriptor))); |
346 | 346 breakpad::CrashDumpObserver::GetInstance()->BrowserChildProcessStarted( |
347 if (breakpad::IsCrashReporterEnabled()) { | 347 child_process_id, mappings); |
348 base::File f(breakpad::CrashDumpManager::GetInstance()->CreateMinidumpFile( | |
349 child_process_id)); | |
350 if (!f.IsValid()) { | |
351 LOG(ERROR) << "Failed to create file for minidump, crash reporting will " | |
352 << "be disabled for this process."; | |
353 } else { | |
354 mappings->Transfer(kAndroidMinidumpDescriptor, | |
355 base::ScopedFD(f.TakePlatformFile())); | |
356 } | |
357 } | |
358 } | 348 } |
359 #elif defined(OS_POSIX) && !defined(OS_MACOSX) | 349 #elif defined(OS_POSIX) && !defined(OS_MACOSX) |
360 void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess( | 350 void ShellContentBrowserClient::GetAdditionalMappedFilesForChildProcess( |
361 const base::CommandLine& command_line, | 351 const base::CommandLine& command_line, |
362 int child_process_id, | 352 int child_process_id, |
363 content::FileDescriptorInfo* mappings) { | 353 content::FileDescriptorInfo* mappings) { |
364 int crash_signal_fd = GetCrashSignalFD(command_line); | 354 int crash_signal_fd = GetCrashSignalFD(command_line); |
365 if (crash_signal_fd >= 0) { | 355 if (crash_signal_fd >= 0) { |
366 mappings->Share(kCrashDumpSignal, crash_signal_fd); | 356 mappings->Share(kCrashDumpSignal, crash_signal_fd); |
367 } | 357 } |
(...skipping 20 matching lines...) Expand all Loading... |
388 ShellBrowserContext* ShellContentBrowserClient::browser_context() { | 378 ShellBrowserContext* ShellContentBrowserClient::browser_context() { |
389 return shell_browser_main_parts_->browser_context(); | 379 return shell_browser_main_parts_->browser_context(); |
390 } | 380 } |
391 | 381 |
392 ShellBrowserContext* | 382 ShellBrowserContext* |
393 ShellContentBrowserClient::off_the_record_browser_context() { | 383 ShellContentBrowserClient::off_the_record_browser_context() { |
394 return shell_browser_main_parts_->off_the_record_browser_context(); | 384 return shell_browser_main_parts_->off_the_record_browser_context(); |
395 } | 385 } |
396 | 386 |
397 } // namespace content | 387 } // namespace content |
OLD | NEW |