Index: chrome/app/kasko_client.cc |
diff --git a/chrome/app/kasko_client.cc b/chrome/app/kasko_client.cc |
index f9699e9073cc0ae3631eb3db4bf1d116b2e177e9..ab163092acb78572a1f0af435ff457eaf528c7f1 100644 |
--- a/chrome/app/kasko_client.cc |
+++ b/chrome/app/kasko_client.cc |
@@ -11,13 +11,14 @@ |
#include <string> |
#include <vector> |
+#include "base/lazy_instance.h" |
#include "base/logging.h" |
#include "base/process/process_handle.h" |
-#include "breakpad/src/client/windows/common/ipc_protocol.h" |
+#include "base/strings/utf_string_conversions.h" |
#include "chrome/app/chrome_watcher_client_win.h" |
#include "chrome/chrome_watcher/chrome_watcher_main_api.h" |
#include "chrome/common/chrome_constants.h" |
-#include "components/crash/content/app/crash_keys_win.h" |
+#include "components/crash/content/app/crashpad.h" |
#include "syzygy/kasko/api/client.h" |
namespace { |
@@ -25,30 +26,24 @@ namespace { |
ChromeWatcherClient* g_chrome_watcher_client = nullptr; |
kasko::api::MinidumpType g_minidump_type = kasko::api::SMALL_DUMP_TYPE; |
+base::LazyInstance<std::vector<kasko::api::CrashKey>>::Leaky |
+ g_kasko_crash_keys = LAZY_INSTANCE_INITIALIZER; |
+ |
void GetKaskoCrashKeys(const kasko::api::CrashKey** crash_keys, |
size_t* crash_key_count) { |
- static_assert( |
- sizeof(kasko::api::CrashKey) == sizeof(google_breakpad::CustomInfoEntry), |
- "CrashKey and CustomInfoEntry structs are not compatible."); |
- static_assert(offsetof(kasko::api::CrashKey, name) == |
- offsetof(google_breakpad::CustomInfoEntry, name), |
- "CrashKey and CustomInfoEntry structs are not compatible."); |
- static_assert(offsetof(kasko::api::CrashKey, value) == |
- offsetof(google_breakpad::CustomInfoEntry, value), |
- "CrashKey and CustomInfoEntry structs are not compatible."); |
- static_assert( |
- sizeof(reinterpret_cast<kasko::api::CrashKey*>(0)->name) == |
- sizeof(reinterpret_cast<google_breakpad::CustomInfoEntry*>(0)->name), |
- "CrashKey and CustomInfoEntry structs are not compatible."); |
- static_assert( |
- sizeof(reinterpret_cast<kasko::api::CrashKey*>(0)->value) == |
- sizeof(reinterpret_cast<google_breakpad::CustomInfoEntry*>(0)->value), |
- "CrashKey and CustomInfoEntry structs are not compatible."); |
- |
- *crash_key_count = |
- breakpad::CrashKeysWin::keeper()->custom_info_entries().size(); |
- *crash_keys = reinterpret_cast<const kasko::api::CrashKey*>( |
- breakpad::CrashKeysWin::keeper()->custom_info_entries().data()); |
+ const auto& pairs = crash_reporter::GetCrashKeys(); |
+ g_kasko_crash_keys.Pointer()->reserve(pairs.size()); |
+ for (const auto& pair : pairs) { |
+ kasko::api::CrashKey kv; |
+ wcscpy_s(kv.name, arraysize(kv.name), |
Mark Mentovai
2015/12/10 23:35:55
OK to clear instead of truncate if arraysize(kv.na
|
+ base::UTF8ToUTF16(pair.first).c_str()); |
+ wcscpy_s(kv.value, arraysize(kv.value), |
+ base::UTF8ToUTF16(pair.second).c_str()); |
+ g_kasko_crash_keys.Pointer()->push_back(kv); |
+ } |
+ |
+ *crash_key_count = g_kasko_crash_keys.Pointer()->size(); |
+ *crash_keys = g_kasko_crash_keys.Pointer()->data(); |
} |
} // namespace |