MiniDumpWithProcessThreadData | // Get PEB and TEB.
MiniDumpWithUnloadedModules); // Get unloaded modules when available.
+const wchar_t kWaitEventFormat[] = L"$1CrashServiceWaitEvent";
const wchar_t kPipeNameFormat[] = L"\\\\.\\pipe\\$1 Crash Service";
} // namespace
base::string16 pipe_name = ReplaceStringPlaceholders(
kPipeNameFormat, base::UTF8ToUTF16(product_name), NULL);
+ base::string16 wait_name = ReplaceStringPlaceholders(
+ kWaitEventFormat, base::UTF8ToUTF16(product_name), NULL);
// Wait until the crash service is started.
- HANDLE waiting_event =
- ::CreateEventW(NULL, TRUE, FALSE, L"g_atom_shell_crash_service");
- if (waiting_event != NULL) {
- WaitForSingleObject(waiting_event, 1000);
- CloseHandle(waiting_event);
+ HANDLE wait_event = ::CreateEventW(NULL, TRUE, FALSE, wait_name.c_str());
+ if (wait_event != NULL) {
+ WaitForSingleObject(wait_event, 1000);
+ CloseHandle(wait_event);
}
// ExceptionHandler() attaches our handler and ~ExceptionHandler() detaches
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
+#include "base/strings/string_util.h"
#include "base/time/time.h"
#include "base/win/windows_version.h"
#include "vendor/breakpad/src/client/windows/crash_generation/client_info.h"
namespace {
+const wchar_t kWaitEventFormat[] = L"$1CrashServiceWaitEvent";
const wchar_t kTestPipeName[] = L"\\\\.\\pipe\\ChromeCrashServices";
const wchar_t kGoogleReportURL[] = L"https://clients2.google.com/cr/report";
delete sender_;
}
-bool CrashService::Initialize(const base::FilePath& operating_dir,
+bool CrashService::Initialize(const base::string16& application_name,
+ const base::FilePath& operating_dir,
const base::FilePath& dumps_path) {
using google_breakpad::CrashReportSender;
using google_breakpad::CrashGenerationServer;
// Create or open an event to signal the browser process that the crash
// service is initialized.
- HANDLE running_event =
- ::CreateEventW(NULL, TRUE, TRUE, L"g_atom_shell_crash_service");
- // If the browser already had the event open, the CreateEvent call did not
- // signal it. We need to do it manually.
- ::SetEvent(running_event);
+ base::string16 wait_name = ReplaceStringPlaceholders(
+ kWaitEventFormat, application_name, NULL);
+ HANDLE wait_event = ::CreateEventW(NULL, TRUE, FALSE, wait_name.c_str());
+ ::SetEvent(wait_event);
return true;
}
// other members in that case. |operating_dir| is where the CrashService
// should store breakpad's checkpoint file. |dumps_path| is the directory
// where the crash dumps should be stored.
- bool Initialize(const base::FilePath& operating_dir,
+ bool Initialize(const base::string16& application_name,
+ const base::FilePath& operating_dir,
const base::FilePath& dumps_path);
// Command line switches:
cmd_line.AppendSwitchNative("pipe-name", pipe_name);
breakpad::CrashService crash_service;
- if (!crash_service.Initialize(operating_dir, operating_dir))
+ if (!crash_service.Initialize(application_name, operating_dir,
+ operating_dir))
return 2;
VLOG(1) << "Ready to process crash requests";