OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef COMPONENTS_CRASH_CONTENT_APP_CRASH_KEYS_WIN_H_ | 5 #ifndef COMPONENTS_CRASH_CONTENT_APP_CRASH_KEYS_WIN_H_ |
6 #define COMPONENTS_CRASH_CONTENT_APP_CRASH_KEYS_WIN_H_ | 6 #define COMPONENTS_CRASH_CONTENT_APP_CRASH_KEYS_WIN_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
| 11 #include <memory> |
11 #include <string> | 12 #include <string> |
12 #include <vector> | 13 #include <vector> |
13 | 14 |
14 #include "base/macros.h" | 15 #include "base/macros.h" |
15 #include "base/memory/scoped_ptr.h" | |
16 #include "base/synchronization/lock.h" | 16 #include "base/synchronization/lock.h" |
17 | 17 |
18 namespace base { | 18 namespace base { |
19 class CommandLine; | 19 class CommandLine; |
20 } // namespace base | 20 } // namespace base |
21 | 21 |
22 namespace crash_reporter { | 22 namespace crash_reporter { |
23 class CrashReporterClient; | 23 class CrashReporterClient; |
24 } | 24 } |
25 | 25 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 } | 63 } |
64 | 64 |
65 static CrashKeysWin* keeper() { return keeper_; } | 65 static CrashKeysWin* keeper() { return keeper_; } |
66 | 66 |
67 private: | 67 private: |
68 // One-time initialization of private key/value pairs. | 68 // One-time initialization of private key/value pairs. |
69 void SetPluginPath(const std::wstring& path); | 69 void SetPluginPath(const std::wstring& path); |
70 void SetBreakpadDumpPath(crash_reporter::CrashReporterClient* crash_client); | 70 void SetBreakpadDumpPath(crash_reporter::CrashReporterClient* crash_client); |
71 | 71 |
72 // Must not be resized after GetCustomInfo is invoked. | 72 // Must not be resized after GetCustomInfo is invoked. |
73 scoped_ptr<std::vector<google_breakpad::CustomInfoEntry>> custom_entries_; | 73 std::unique_ptr<std::vector<google_breakpad::CustomInfoEntry>> |
| 74 custom_entries_; |
74 | 75 |
75 typedef std::map<std::wstring, google_breakpad::CustomInfoEntry*> | 76 typedef std::map<std::wstring, google_breakpad::CustomInfoEntry*> |
76 DynamicEntriesMap; | 77 DynamicEntriesMap; |
77 base::Lock lock_; | 78 base::Lock lock_; |
78 // Keeps track of the next index for a new dynamic entry. | 79 // Keeps track of the next index for a new dynamic entry. |
79 size_t dynamic_keys_offset_; // Under lock_. | 80 size_t dynamic_keys_offset_; // Under lock_. |
80 // Maintains key->entry information for dynamic key/value entries | 81 // Maintains key->entry information for dynamic key/value entries |
81 // in custom_entries_. | 82 // in custom_entries_. |
82 DynamicEntriesMap dynamic_entries_; // Under lock_. | 83 DynamicEntriesMap dynamic_entries_; // Under lock_. |
83 | 84 |
84 // Stores the sole instance of this class allowed per process. | 85 // Stores the sole instance of this class allowed per process. |
85 static CrashKeysWin* keeper_; | 86 static CrashKeysWin* keeper_; |
86 | 87 |
87 DISALLOW_COPY_AND_ASSIGN(CrashKeysWin); | 88 DISALLOW_COPY_AND_ASSIGN(CrashKeysWin); |
88 }; | 89 }; |
89 | 90 |
90 } // namespace breakpad | 91 } // namespace breakpad |
91 | 92 |
92 #endif // COMPONENTS_CRASH_CONTENT_APP_CRASH_KEYS_WIN_H_ | 93 #endif // COMPONENTS_CRASH_CONTENT_APP_CRASH_KEYS_WIN_H_ |
OLD | NEW |