summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authoreroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-14 01:36:11 +0000
committereroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-14 01:36:11 +0000
commit783f06f30e8f4e9e6635d5e0ea49b258e8274cc0 (patch)
tree7fdc3cce535b96377edf93dff43d05f384110c0e /chrome/common
parent3227bd548c98f90ecabfcd4e3ccc3785ee9409d8 (diff)
downloadchromium_src-783f06f30e8f4e9e6635d5e0ea49b258e8274cc0.zip
chromium_src-783f06f30e8f4e9e6635d5e0ea49b258e8274cc0.tar.gz
chromium_src-783f06f30e8f4e9e6635d5e0ea49b258e8274cc0.tar.bz2
[Windows] Include the about:flags experiments in crash reports.
* Increases the number of command line switches included in dumps from 2 to 15. * Saves the command line flags for all process types (before it was just for browser). * Includes the "fake" command line flags that were added by about:flags experiments. This change will make it possible to cluster crashes with enabled experiments from our server-side analysis. BUG=60992 Review URL: http://codereview.chromium.org/7866033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101009 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/child_process_logging.h5
-rw-r--r--chrome/common/child_process_logging_linux.cc5
-rw-r--r--chrome/common/child_process_logging_mac.mm5
-rw-r--r--chrome/common/child_process_logging_win.cc19
4 files changed, 34 insertions, 0 deletions
diff --git a/chrome/common/child_process_logging.h b/chrome/common/child_process_logging.h
index 0daabb8..1269ecf 100644
--- a/chrome/common/child_process_logging.h
+++ b/chrome/common/child_process_logging.h
@@ -13,6 +13,7 @@
#include "base/mac/crash_logging.h"
#include "googleurl/src/gurl.h"
+class CommandLine;
struct GPUInfo;
#if defined(OS_WIN) || defined(OS_MACOSX)
@@ -61,6 +62,10 @@ void SetNumberOfViews(int number_of_views);
// Sets the data on the gpu to send along with crash reports.
void SetGpuInfo(const GPUInfo& gpu_info);
+// Sets the command line arguments to send along with crash reports to the
+// values in |command_line|.
+void SetCommandLine(const CommandLine* command_line);
+
// Simple wrapper class that sets the active URL in it's constructor and clears
// the active URL in the destructor.
class ScopedActiveURLSetter {
diff --git a/chrome/common/child_process_logging_linux.cc b/chrome/common/child_process_logging_linux.cc
index a730761..28b9a2e 100644
--- a/chrome/common/child_process_logging_linux.cc
+++ b/chrome/common/child_process_logging_linux.cc
@@ -78,4 +78,9 @@ void SetNumberOfViews(int number_of_views) {
// TODO(port)
}
+void SetCommandLine(const CommandLine*) {
+ // TODO: http://crbug.com/60993
+ NOTIMPLEMENTED();
+}
+
} // namespace child_process_logging
diff --git a/chrome/common/child_process_logging_mac.mm b/chrome/common/child_process_logging_mac.mm
index 70ee2a7..abc7c00 100644
--- a/chrome/common/child_process_logging_mac.mm
+++ b/chrome/common/child_process_logging_mac.mm
@@ -173,4 +173,9 @@ void SetNumberOfViews(int number_of_views) {
SetNumberOfViewsImpl(number_of_views, SetCrashKeyValue);
}
+void SetCommandLine(const CommandLine*) {
+ // TODO: http://crbug.com/60991
+ NOTIMPLEMENTED();
+}
+
} // namespace child_process_logging
diff --git a/chrome/common/child_process_logging_win.cc b/chrome/common/child_process_logging_win.cc
index 3a937f8..512a766 100644
--- a/chrome/common/child_process_logging_win.cc
+++ b/chrome/common/child_process_logging_win.cc
@@ -6,6 +6,7 @@
#include <windows.h>
+#include "base/command_line.h"
#include "base/string_util.h"
#include "base/string_number_conversions.h"
#include "base/stringprintf.h"
@@ -39,6 +40,10 @@ typedef void (__cdecl *MainSetGpuInfo)(const wchar_t*, const wchar_t*,
// void __declspec(dllexport) __cdecl SetNumberOfViews.
typedef void (__cdecl *MainSetNumberOfViews)(int);
+// exported in breakpad_win.cc:
+// void __declspec(dllexport) __cdecl SetCommandLine
+typedef void (__cdecl *MainSetCommandLine)(const CommandLine*);
+
void SetActiveURL(const GURL& url) {
static MainSetActiveURL set_active_url = NULL;
// note: benign race condition on set_active_url.
@@ -145,6 +150,20 @@ void SetGpuInfo(const GPUInfo& gpu_info) {
UTF8ToUTF16(gpu_info.vertex_shader_version).c_str());
}
+void SetCommandLine(const CommandLine* command_line) {
+ static MainSetCommandLine set_command_line = NULL;
+ if (!set_command_line) {
+ HMODULE exe_module = GetModuleHandle(chrome::kBrowserProcessExecutableName);
+ if (!exe_module)
+ return;
+ set_command_line = reinterpret_cast<MainSetCommandLine>(
+ GetProcAddress(exe_module, "SetCommandLine"));
+ if (!set_command_line)
+ return;
+ }
+ (set_command_line)(command_line);
+}
+
void SetNumberOfViews(int number_of_views) {
static MainSetNumberOfViews set_number_of_views = NULL;
if (!set_number_of_views) {