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

Side by Side Diff: chrome/app/chrome_main_delegate.cc

Issue 25733002: Fix crash reporting of child process command line switches. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/chrome_tests_unit.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/app/chrome_main_delegate.h" 5 #include "chrome/app/chrome_main_delegate.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/environment.h" 8 #include "base/environment.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
11 #include "base/lazy_instance.h" 11 #include "base/lazy_instance.h"
12 #include "base/message_loop/message_loop.h" 12 #include "base/message_loop/message_loop.h"
13 #include "base/metrics/statistics_recorder.h" 13 #include "base/metrics/statistics_recorder.h"
14 #include "base/metrics/stats_counters.h" 14 #include "base/metrics/stats_counters.h"
15 #include "base/path_service.h" 15 #include "base/path_service.h"
16 #include "base/process/memory.h" 16 #include "base/process/memory.h"
17 #include "base/process/process_handle.h" 17 #include "base/process/process_handle.h"
18 #include "base/strings/stringprintf.h" 18 #include "base/strings/stringprintf.h"
19 #include "base/strings/utf_string_conversions.h" 19 #include "base/strings/utf_string_conversions.h"
20 #include "build/build_config.h" 20 #include "build/build_config.h"
21 #include "chrome/browser/chrome_content_browser_client.h" 21 #include "chrome/browser/chrome_content_browser_client.h"
22 #include "chrome/browser/defaults.h" 22 #include "chrome/browser/defaults.h"
23 #include "chrome/browser/policy/policy_path_parser.h" 23 #include "chrome/browser/policy/policy_path_parser.h"
24 #include "chrome/common/chrome_constants.h" 24 #include "chrome/common/chrome_constants.h"
25 #include "chrome/common/chrome_content_client.h" 25 #include "chrome/common/chrome_content_client.h"
26 #include "chrome/common/chrome_paths.h" 26 #include "chrome/common/chrome_paths.h"
27 #include "chrome/common/chrome_paths_internal.h" 27 #include "chrome/common/chrome_paths_internal.h"
28 #include "chrome/common/chrome_switches.h" 28 #include "chrome/common/chrome_switches.h"
29 #include "chrome/common/chrome_version_info.h" 29 #include "chrome/common/chrome_version_info.h"
30 #include "chrome/common/crash_keys.h"
30 #include "chrome/common/logging_chrome.h" 31 #include "chrome/common/logging_chrome.h"
31 #include "chrome/common/profiling.h" 32 #include "chrome/common/profiling.h"
32 #include "chrome/common/url_constants.h" 33 #include "chrome/common/url_constants.h"
33 #include "chrome/plugin/chrome_content_plugin_client.h" 34 #include "chrome/plugin/chrome_content_plugin_client.h"
34 #include "chrome/renderer/chrome_content_renderer_client.h" 35 #include "chrome/renderer/chrome_content_renderer_client.h"
35 #include "chrome/utility/chrome_content_utility_client.h" 36 #include "chrome/utility/chrome_content_utility_client.h"
36 #include "components/nacl/common/nacl_switches.h" 37 #include "components/nacl/common/nacl_switches.h"
37 #include "components/startup_metric_utils/startup_metric_utils.h" 38 #include "components/startup_metric_utils/startup_metric_utils.h"
38 #include "content/public/common/content_client.h" 39 #include "content/public/common/content_client.h"
39 #include "content/public/common/content_paths.h" 40 #include "content/public/common/content_paths.h"
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 // sets this up for the browser process in a different manner. Zygotes 738 // sets this up for the browser process in a different manner. Zygotes
738 // need to call InitCrashReporter() in RunZygote(). 739 // need to call InitCrashReporter() in RunZygote().
739 if (!process_type.empty() && process_type != switches::kZygoteProcess) { 740 if (!process_type.empty() && process_type != switches::kZygoteProcess) {
740 #if defined(OS_ANDROID) 741 #if defined(OS_ANDROID)
741 InitNonBrowserCrashReporterForAndroid(); 742 InitNonBrowserCrashReporterForAndroid();
742 #else 743 #else
743 InitCrashReporter(); 744 InitCrashReporter();
744 #endif 745 #endif
745 } 746 }
746 #endif 747 #endif
748
749 // After all the platform Breakpads have been initialized, store the command
750 // line for crash reporting.
751 crash_keys::SetSwitchesFromCommandLine(&command_line);
747 } 752 }
748 753
749 void ChromeMainDelegate::SandboxInitialized(const std::string& process_type) { 754 void ChromeMainDelegate::SandboxInitialized(const std::string& process_type) {
750 startup_timer_->Stop(); // End of Startup Time Measurement. 755 startup_timer_->Stop(); // End of Startup Time Measurement.
751 756
752 // Note: If you are adding a new process type below, be sure to adjust the 757 // Note: If you are adding a new process type below, be sure to adjust the
753 // AdjustLinuxOOMScore function too. 758 // AdjustLinuxOOMScore function too.
754 #if defined(OS_LINUX) 759 #if defined(OS_LINUX)
755 AdjustLinuxOOMScore(process_type); 760 AdjustLinuxOOMScore(process_type);
756 #endif 761 #endif
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
834 Profiling::ProcessStarted(); 839 Profiling::ProcessStarted();
835 if (Profiling::BeingProfiled()) { 840 if (Profiling::BeingProfiled()) {
836 base::debug::RestartProfilingAfterFork(); 841 base::debug::RestartProfilingAfterFork();
837 SetUpProfilingShutdownHandler(); 842 SetUpProfilingShutdownHandler();
838 } 843 }
839 844
840 #if defined(OS_POSIX) && !defined(OS_MACOSX) 845 #if defined(OS_POSIX) && !defined(OS_MACOSX)
841 // Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain sets 846 // Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain sets
842 // this up for the browser process in a different manner. 847 // this up for the browser process in a different manner.
843 InitCrashReporter(); 848 InitCrashReporter();
849
850 // Reset the command line for the newly spawned process.
851 crash_keys::SetSwitchesFromCommandLine(CommandLine::ForCurrentProcess());
844 #endif 852 #endif
845 } 853 }
846 854
847 #endif // OS_MACOSX 855 #endif // OS_MACOSX
848 856
849 content::ContentBrowserClient* 857 content::ContentBrowserClient*
850 ChromeMainDelegate::CreateContentBrowserClient() { 858 ChromeMainDelegate::CreateContentBrowserClient() {
851 #if defined(CHROME_MULTIPLE_DLL_CHILD) 859 #if defined(CHROME_MULTIPLE_DLL_CHILD)
852 return NULL; 860 return NULL;
853 #else 861 #else
(...skipping 19 matching lines...) Expand all
873 } 881 }
874 882
875 content::ContentUtilityClient* 883 content::ContentUtilityClient*
876 ChromeMainDelegate::CreateContentUtilityClient() { 884 ChromeMainDelegate::CreateContentUtilityClient() {
877 #if defined(CHROME_MULTIPLE_DLL_BROWSER) 885 #if defined(CHROME_MULTIPLE_DLL_BROWSER)
878 return NULL; 886 return NULL;
879 #else 887 #else
880 return &g_chrome_content_utility_client.Get(); 888 return &g_chrome_content_utility_client.Get();
881 #endif 889 #endif
882 } 890 }
OLDNEW
« no previous file with comments | « no previous file | chrome/chrome_tests_unit.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698