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

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2393853002: Refactor CrashDump*Manager to use a shared CrashDumpObserver singleton. (Closed)
Patch Set: rebase; review changes Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/chrome_content_browser_client.h" 5 #include "chrome/browser/chrome_content_browser_client.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 2763 matching lines...) Expand 10 before | Expand all | Expand 10 after
2774 &(*regions)[kAndroidUIResourcesPakDescriptor]); 2774 &(*regions)[kAndroidUIResourcesPakDescriptor]);
2775 mappings->Share(kAndroidUIResourcesPakDescriptor, fd); 2775 mappings->Share(kAndroidUIResourcesPakDescriptor, fd);
2776 2776
2777 fd = ui::GetCommonResourcesPackFd( 2777 fd = ui::GetCommonResourcesPackFd(
2778 &(*regions)[kAndroidChrome100PercentPakDescriptor]); 2778 &(*regions)[kAndroidChrome100PercentPakDescriptor]);
2779 mappings->Share(kAndroidChrome100PercentPakDescriptor, fd); 2779 mappings->Share(kAndroidChrome100PercentPakDescriptor, fd);
2780 2780
2781 fd = ui::GetLocalePackFd(&(*regions)[kAndroidLocalePakDescriptor]); 2781 fd = ui::GetLocalePackFd(&(*regions)[kAndroidLocalePakDescriptor]);
2782 mappings->Share(kAndroidLocalePakDescriptor, fd); 2782 mappings->Share(kAndroidLocalePakDescriptor, fd);
2783 2783
2784 if (breakpad::IsCrashReporterEnabled()) { 2784 breakpad::CrashDumpObserver::GetInstance()->BrowserChildProcessStarted(
2785 base::File file = 2785 child_process_id, mappings);
2786 breakpad::CrashDumpManager::GetInstance()->CreateMinidumpFile(
2787 child_process_id);
2788 if (file.IsValid()) {
2789 mappings->Transfer(kAndroidMinidumpDescriptor,
2790 base::ScopedFD(file.TakePlatformFile()));
2791 } else {
2792 LOG(ERROR) << "Failed to create file for minidump, crash reporting will "
2793 "be disabled for this process.";
2794 }
2795 }
2796 2786
2797 base::FilePath app_data_path; 2787 base::FilePath app_data_path;
2798 PathService::Get(base::DIR_ANDROID_APP_DATA, &app_data_path); 2788 PathService::Get(base::DIR_ANDROID_APP_DATA, &app_data_path);
2799 DCHECK(!app_data_path.empty()); 2789 DCHECK(!app_data_path.empty());
2800 } 2790 }
2801 #elif defined(OS_POSIX) && !defined(OS_MACOSX) 2791 #elif defined(OS_POSIX) && !defined(OS_MACOSX)
2802 void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess( 2792 void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
2803 const base::CommandLine& command_line, 2793 const base::CommandLine& command_line,
2804 int child_process_id, 2794 int child_process_id,
2805 FileDescriptorInfo* mappings) { 2795 FileDescriptorInfo* mappings) {
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
3226 kWebRtcDevSwitchNames, 3216 kWebRtcDevSwitchNames,
3227 arraysize(kWebRtcDevSwitchNames)); 3217 arraysize(kWebRtcDevSwitchNames));
3228 } 3218 }
3229 } 3219 }
3230 #endif // defined(ENABLE_WEBRTC) 3220 #endif // defined(ENABLE_WEBRTC)
3231 3221
3232 std::unique_ptr<content::MemoryCoordinatorDelegate> 3222 std::unique_ptr<content::MemoryCoordinatorDelegate>
3233 ChromeContentBrowserClient::GetMemoryCoordinatorDelegate() { 3223 ChromeContentBrowserClient::GetMemoryCoordinatorDelegate() {
3234 return memory::ChromeMemoryCoordinatorDelegate::Create(); 3224 return memory::ChromeMemoryCoordinatorDelegate::Create();
3235 } 3225 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698