Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include <map> | |
| 6 #include <vector> | |
| 7 | |
| 8 #include "base/command_line.h" | |
|
erikwright (departed)
2014/06/11 13:27:48
forward decl?
Sigurður Ásgeirsson
2014/06/11 13:55:27
Done.
| |
| 9 #include "base/synchronization/lock.h" | |
| 10 #include "breakpad/src/client/windows/handler/exception_handler.h" | |
| 11 | |
| 12 namespace breakpad { | |
| 13 | |
| 14 class BreakpadClient; | |
| 15 | |
| 16 // Manages the breakpad key/value pair stash, there may only be one instance | |
| 17 // of this class per process at one time. | |
| 18 class CrashKeysWin { | |
| 19 public: | |
| 20 CrashKeysWin(); | |
| 21 ~CrashKeysWin(); | |
| 22 | |
| 23 // May only be called once. | |
| 24 // |exe_path| is the path to the executable running, which may be used | |
| 25 // to figure out whether this is a user or system install. | |
| 26 // |type| is the process type, or mode this process is running in e.g. | |
| 27 // something like "browser" or "renderer". | |
| 28 // |profile_type| is a string describing the kind of the user's Windows | |
| 29 // profile, e.g. "mandatory", or "roaming" or similar. | |
| 30 // |cmd_line| is the current process' command line consulted for explicit | |
| 31 // crash reporting flags. | |
| 32 // |breakpad_client| is consulted for crash reporting settings. | |
| 33 google_breakpad::CustomClientInfo* GetCustomInfo( | |
|
erikwright (departed)
2014/06/11 13:27:48
forward-decl or IWYU?
Sigurður Ásgeirsson
2014/06/11 13:55:27
Done.
| |
| 34 const std::wstring& exe_path, | |
|
erikwright (departed)
2014/06/11 13:27:47
IWYU
Sigurður Ásgeirsson
2014/06/11 13:55:26
Done.
| |
| 35 const std::wstring& type, | |
| 36 const std::wstring& profile_type, | |
| 37 CommandLine* cmd_line, | |
| 38 BreakpadClient* breakpad_client); | |
| 39 | |
| 40 void SetCrashKeyValue(const std::wstring& key, const std::wstring& value); | |
| 41 void ClearCrashKeyValue(const std::wstring& key); | |
| 42 | |
| 43 static CrashKeysWin* keeper() { return keeper_; } | |
| 44 | |
| 45 private: | |
| 46 // One-time initialization of private key/value pairs. | |
| 47 void SetPluginPath(const std::wstring& path); | |
| 48 void SetBreakpadDumpPath(BreakpadClient* breakpad_client); | |
| 49 | |
| 50 // Must not be resized after GetCustomInfo is invoked. | |
| 51 std::vector<google_breakpad::CustomInfoEntry> custom_entries_; | |
|
erikwright (departed)
2014/06/11 13:27:47
IWYU?
Sigurður Ásgeirsson
2014/06/11 13:55:27
Done.
| |
| 52 | |
| 53 typedef std::map<std::wstring, google_breakpad::CustomInfoEntry*> | |
| 54 DynamicEntriesMap; | |
| 55 base::Lock lock_; | |
| 56 // Keeps track of the next index for a new dynamic entry. | |
| 57 size_t dynamic_keys_offset_; // Under lock_. | |
| 58 // Maintains key->entry information for dynamic key/value entries | |
| 59 // in custom_entries_. | |
| 60 DynamicEntriesMap dynamic_entries_; // Under lock_. | |
| 61 | |
| 62 // Stores the sole instance of this class allowed per process. | |
| 63 static CrashKeysWin* keeper_; | |
| 64 }; | |
|
erikwright (departed)
2014/06/11 13:27:48
DISALLOW_COPY_AND_ASSIGN?
Sigurður Ásgeirsson
2014/06/11 13:55:27
Done.
| |
| 65 | |
| 66 } // namespace breakpad | |
| OLD | NEW |