summaryrefslogtreecommitdiffstats
path: root/components/crash
diff options
context:
space:
mode:
authorchrisha <chrisha@chromium.org>2015-12-22 09:45:32 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-22 17:46:41 +0000
commitc1875be6226ce3c7c777591637e2772c67f98a38 (patch)
tree622e9515fad4157aff60278939a456dc5f94d897 /components/crash
parent8026a5d52b11b52cabf3ed0ec7955cd7bf06ec08 (diff)
downloadchromium_src-c1875be6226ce3c7c777591637e2772c67f98a38.zip
chromium_src-c1875be6226ce3c7c777591637e2772c67f98a38.tar.gz
chromium_src-c1875be6226ce3c7c777591637e2772c67f98a38.tar.bz2
[win] Set Crashpad GUID in crashkeys returned to Kasko.
TBR=scottmg@chromium.org BUG=564329 Review URL: https://codereview.chromium.org/1545623003 Cr-Commit-Position: refs/heads/master@{#366608}
Diffstat (limited to 'components/crash')
-rw-r--r--components/crash/content/app/crashpad.cc24
1 files changed, 23 insertions, 1 deletions
diff --git a/components/crash/content/app/crashpad.cc b/components/crash/content/app/crashpad.cc
index 1525764..eab401b 100644
--- a/components/crash/content/app/crashpad.cc
+++ b/components/crash/content/app/crashpad.cc
@@ -244,13 +244,35 @@ void GetUploadedReports(std::vector<UploadedReport>* uploaded_reports) {
#if defined(KASKO)
void GetCrashKeysForKasko(std::vector<kasko::api::CrashKey>* crash_keys) {
+ // Reserve room for an extra key, the guid.
crash_keys->clear();
- crash_keys->reserve(g_simple_string_dictionary->GetCount());
+ crash_keys->reserve(g_simple_string_dictionary->GetCount() + 1);
+
+ // Set the Crashpad client ID in the crash keys.
+ bool got_guid = false;
+ if (g_database) {
+ crashpad::Settings* settings = g_database->GetSettings();
+ crashpad::UUID uuid;
+ if (settings->GetClientID(&uuid)) {
+ kasko::api::CrashKey kv;
+ wcsncpy_s(kv.name, L"guid", _TRUNCATE);
+ wcsncpy_s(kv.value, base::UTF8ToWide(uuid.ToString()).c_str(), _TRUNCATE);
+ crash_keys->push_back(kv);
+ got_guid = true;
+ }
+ }
+
crashpad::SimpleStringDictionary::Iterator iter(*g_simple_string_dictionary);
for (;;) {
const auto* entry = iter.Next();
if (!entry)
break;
+
+ // Skip the 'guid' key if it was already set.
+ static const char kGuid[] = "guid";
+ if (got_guid && ::strncmp(entry->key, kGuid, arraysize(kGuid)) == 0)
+ continue;
+
kasko::api::CrashKey kv;
wcsncpy_s(kv.name, base::UTF8ToWide(entry->key).c_str(), _TRUNCATE);
wcsncpy_s(kv.value, base::UTF8ToWide(entry->value).c_str(), _TRUNCATE);