OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/tools/crash_service/crash_service.h" | 5 #include "chrome/tools/crash_service/crash_service.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include <fstream> | 9 #include <fstream> |
10 #include <map> | 10 #include <map> |
(...skipping 22 matching lines...) Expand all Loading... |
33 bool CustomInfoToMap(const google_breakpad::ClientInfo* client_info, | 33 bool CustomInfoToMap(const google_breakpad::ClientInfo* client_info, |
34 const std::wstring& reporter_tag, CrashMap* map) { | 34 const std::wstring& reporter_tag, CrashMap* map) { |
35 google_breakpad::CustomClientInfo info = client_info->GetCustomInfo(); | 35 google_breakpad::CustomClientInfo info = client_info->GetCustomInfo(); |
36 | 36 |
37 for (uintptr_t i = 0; i < info.count; ++i) { | 37 for (uintptr_t i = 0; i < info.count; ++i) { |
38 (*map)[info.entries[i].name] = info.entries[i].value; | 38 (*map)[info.entries[i].name] = info.entries[i].value; |
39 } | 39 } |
40 | 40 |
41 (*map)[L"rept"] = reporter_tag; | 41 (*map)[L"rept"] = reporter_tag; |
42 | 42 |
43 return (map->size() > 0); | 43 return !map->empty(); |
44 } | 44 } |
45 | 45 |
46 bool WriteCustomInfoToFile(const std::wstring& dump_path, const CrashMap& map) { | 46 bool WriteCustomInfoToFile(const std::wstring& dump_path, const CrashMap& map) { |
47 std::wstring file_path(dump_path); | 47 std::wstring file_path(dump_path); |
48 size_t last_dot = file_path.rfind(L'.'); | 48 size_t last_dot = file_path.rfind(L'.'); |
49 if (last_dot == std::wstring::npos) | 49 if (last_dot == std::wstring::npos) |
50 return false; | 50 return false; |
51 file_path.resize(last_dot); | 51 file_path.resize(last_dot); |
52 file_path += L".txt"; | 52 file_path += L".txt"; |
53 | 53 |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 SDDL_REVISION, | 470 SDDL_REVISION, |
471 &sec_desc, NULL)) { | 471 &sec_desc, NULL)) { |
472 if (::GetSecurityDescriptorSacl(sec_desc, &sacl_present, &sacl, | 472 if (::GetSecurityDescriptorSacl(sec_desc, &sacl_present, &sacl, |
473 &sacl_defaulted)) { | 473 &sacl_defaulted)) { |
474 return sec_desc; | 474 return sec_desc; |
475 } | 475 } |
476 } | 476 } |
477 | 477 |
478 return NULL; | 478 return NULL; |
479 } | 479 } |
OLD | NEW |