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

Unified Diff: chrome/app/kasko_client.cc

Issue 985613002: ScopedCrashKey doesn't appear to be configured to work on Windows. Manually set the crash key. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@kasko_0_0_7_0
Patch Set: Fix namespace/headers. Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/kasko_client.cc
diff --git a/chrome/app/kasko_client.cc b/chrome/app/kasko_client.cc
index b20dbd361f88a50ca187df2c56ac51a7ac2c5707..bdbe4b0ca059bcf87527f90d8cb91956c45e5ede 100644
--- a/chrome/app/kasko_client.cc
+++ b/chrome/app/kasko_client.cc
@@ -10,10 +10,10 @@
#include <string>
-#include "base/debug/crash_logging.h"
#include "base/guid.h"
#include "base/logging.h"
#include "base/process/process_handle.h"
+#include "base/strings/utf_string_conversions.h"
#include "base/win/wrapped_window_proc.h"
#include "breakpad/src/client/windows/common/ipc_protocol.h"
#include "chrome/app/chrome_watcher_client_win.h"
@@ -61,33 +61,45 @@ extern "C" void __declspec(dllexport) ReportCrashWithProtobuf(
sizeof(reinterpret_cast<google_breakpad::CustomInfoEntry*>(0)->value),
"CrashKey and CustomInfoEntry structs are not compatible.");
+ breakpad::CrashKeysWin* keeper = breakpad::CrashKeysWin::keeper();
+ if (!keeper)
+ return;
+
// Assign a GUID that can be used to correlate the Kasko report to the
// Breakpad report, to verify data consistency.
std::string guid = base::GenerateGUID();
{
+ keeper->SetCrashKeyValue(base::ASCIIToUTF16(crash_keys::kKaskoGuid).c_str(),
+ base::ASCIIToUTF16(guid).c_str());
+
base::debug::ScopedCrashKey kasko_guid(crash_keys::kKaskoGuid, guid);
- size_t crash_key_count =
- breakpad::CrashKeysWin::keeper()->custom_info_entries().size();
+ size_t crash_key_count = keeper->custom_info_entries().size();
const kasko::api::CrashKey* crash_keys =
reinterpret_cast<const kasko::api::CrashKey*>(
- breakpad::CrashKeysWin::keeper()->custom_info_entries().data());
+ keeper->custom_info_entries().data());
if (g_chrome_watcher_client &&
g_chrome_watcher_client->EnsureInitialized()) {
kasko::api::SendReport(info, protobuf, protobuf_length, crash_keys,
crash_key_count);
}
+
+ keeper->ClearCrashKeyValue(
+ base::ASCIIToUTF16(crash_keys::kKaskoGuid).c_str());
}
{
- base::debug::ScopedCrashKey kasko_equivalent_guid(
- crash_keys::kKaskoEquivalentGuid, guid);
+ keeper->SetCrashKeyValue(
+ base::ASCIIToUTF16(crash_keys::kKaskoEquivalentGuid).c_str(),
+ base::ASCIIToUTF16(guid).c_str());
// While Kasko remains experimental, also report via Breakpad.
base::win::WinProcExceptionFilter crash_for_exception =
reinterpret_cast<base::win::WinProcExceptionFilter>(::GetProcAddress(
::GetModuleHandle(chrome::kBrowserProcessExecutableName),
"CrashForException"));
crash_for_exception(info);
+ keeper->ClearCrashKeyValue(
+ base::ASCIIToUTF16(crash_keys::kKaskoEquivalentGuid).c_str());
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698