summaryrefslogtreecommitdiffstats
path: root/chrome/app/breakpad_win.cc
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-23 22:31:15 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-23 22:31:15 +0000
commit8ad78dc546b6d16ba905591db797e32060f869dc (patch)
treef0156250ef810c512d9633dfb009657e42a4f219 /chrome/app/breakpad_win.cc
parenteb51949fa5a73f35c52f58f3f1c8eba8a44d138c (diff)
downloadchromium_src-8ad78dc546b6d16ba905591db797e32060f869dc.zip
chromium_src-8ad78dc546b6d16ba905591db797e32060f869dc.tar.gz
chromium_src-8ad78dc546b6d16ba905591db797e32060f869dc.tar.bz2
Revert 123322 (revert didn't help)
- Revert 123149 (trying to find the cause of http://crbug.com/115479) - Windows Breakpad: Stop doing Breakpad initialisation on a thread The Breakpad setup was being done on a thread because reading metadata chrome.dll was slow, but the code has been changed to read the metadata from chrome.exe which should be faster. I need to remove the use of threading so that I can change the Breakpad enablement checks to happen only in the browser process and be inherited reliably by subprocesses. Also, this will potentially make any crashes on startup more reliably reported by Breakpad. BUG=111265 TEST=none Review URL: http://codereview.chromium.org/9423016 TBR=mseaborn@chromium.org Review URL: https://chromiumcodereview.appspot.com/9456027 TBR=thakis@chromium.org Review URL: https://chromiumcodereview.appspot.com/9447036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123346 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/app/breakpad_win.cc')
-rw-r--r--chrome/app/breakpad_win.cc35
1 files changed, 7 insertions, 28 deletions
diff --git a/chrome/app/breakpad_win.cc b/chrome/app/breakpad_win.cc
index c08cc17..68e23e5c 100644
--- a/chrome/app/breakpad_win.cc
+++ b/chrome/app/breakpad_win.cc
@@ -326,7 +326,7 @@ google_breakpad::CustomClientInfo* GetCustomInfo(const std::wstring& exe_path,
return &custom_client_info;
}
-// Contains the information needed by the worker thread.
+// Contains the information needed by InitCrashReporterMain().
struct CrashReporterInfo {
google_breakpad::CustomClientInfo* custom_info;
std::wstring exe_path;
@@ -605,9 +605,9 @@ static bool MetricsReportingControlledByPolicy(bool* result) {
return false;
}
-static DWORD __stdcall InitCrashReporterThread(void* param) {
- scoped_ptr<CrashReporterInfo> info(
- reinterpret_cast<CrashReporterInfo*>(param));
+// TODO(mseaborn): This function could be merged with InitCrashReporter().
+static void InitCrashReporterMain(CrashReporterInfo* param) {
+ scoped_ptr<CrashReporterInfo> info(param);
bool is_per_user_install =
InstallUtil::IsPerUserInstall(info->exe_path.c_str());
@@ -616,8 +616,6 @@ static DWORD __stdcall InitCrashReporterThread(void* param) {
GoogleUpdateSettings::GetChromeChannelAndModifiers(!is_per_user_install,
&channel_string);
- // GetCustomInfo can take a few milliseconds to get the file information, so
- // we do it here so it can run in a separate thread.
info->custom_info = GetCustomInfo(info->exe_path, info->process_type,
channel_string);
@@ -669,7 +667,7 @@ static DWORD __stdcall InitCrashReporterThread(void* param) {
// for the browser/service processes.
if (default_filter)
InitDefaultCrashCallback(default_filter);
- return 0;
+ return;
}
// Build the pipe name. It can be either:
@@ -680,7 +678,7 @@ static DWORD __stdcall InitCrashReporterThread(void* param) {
if (!base::win::GetUserSidString(&user_sid)) {
if (default_filter)
InitDefaultCrashCallback(default_filter);
- return -1;
+ return;
}
} else {
user_sid = kSystemPrincipalSid;
@@ -738,8 +736,6 @@ static DWORD __stdcall InitCrashReporterThread(void* param) {
// generate a crashdump for these exceptions.
g_breakpad->set_handle_debug_exceptions(true);
}
-
- return 0;
}
void InitDefaultCrashCallback(LPTOP_LEVEL_EXCEPTION_FILTER filter) {
@@ -752,8 +748,6 @@ void InitCrashReporter() {
// Disable the message box for assertions.
_CrtSetReportMode(_CRT_ASSERT, 0);
- // Query the custom_info now because if we do it in the thread it's going to
- // fail in the sandbox. The thread will delete this object.
CrashReporterInfo* info(new CrashReporterInfo);
info->process_type = command.GetSwitchValueNative(switches::kProcessType);
if (info->process_type.empty())
@@ -764,21 +758,6 @@ void InitCrashReporter() {
GetModuleFileNameW(NULL, exe_path, MAX_PATH);
info->exe_path = exe_path;
- // If this is not the browser, we can't be sure that we will be able to
- // initialize the crash_handler in another thread, so we run it right away.
- // This is important to keep the thread for the browser process because
- // it may take some times to initialize the crash_service process. We use
- // the Windows worker pool to make better reuse of the thread.
- if (info->process_type != L"browser") {
- InitCrashReporterThread(info);
- } else {
- if (QueueUserWorkItem(
- &InitCrashReporterThread,
- info,
- WT_EXECUTELONGFUNCTION) == 0) {
- // We failed to queue to the worker pool, initialize in this thread.
- InitCrashReporterThread(info);
- }
- }
+ InitCrashReporterMain(info);
}
}