OLD | NEW |
---|---|
1 // Copyright 2014 The Crashpad Authors. All rights reserved. | 1 // Copyright 2014 The Crashpad Authors. All rights reserved. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 // See the License for the specific language governing permissions and | 12 // See the License for the specific language governing permissions and |
13 // limitations under the License. | 13 // limitations under the License. |
14 | 14 |
15 #ifndef CRASHPAD_SNAPSHOT_PROCESS_SNAPSHOT_H_ | 15 #ifndef CRASHPAD_SNAPSHOT_PROCESS_SNAPSHOT_H_ |
16 #define CRASHPAD_SNAPSHOT_PROCESS_SNAPSHOT_H_ | 16 #define CRASHPAD_SNAPSHOT_PROCESS_SNAPSHOT_H_ |
17 | 17 |
18 #include <sys/time.h> | 18 #include <sys/time.h> |
19 #include <sys/types.h> | 19 #include <sys/types.h> |
20 | 20 |
21 #include <map> | |
22 #include <string> | |
21 #include <vector> | 23 #include <vector> |
22 | 24 |
23 namespace crashpad { | 25 namespace crashpad { |
24 | 26 |
25 class ExceptionSnapshot; | 27 class ExceptionSnapshot; |
26 class ModuleSnapshot; | 28 class ModuleSnapshot; |
27 class SystemSnapshot; | 29 class SystemSnapshot; |
28 class ThreadSnapshot; | 30 class ThreadSnapshot; |
29 | 31 |
30 //! \brief An abstract interface to a snapshot representing the state of a | 32 //! \brief An abstract interface to a snapshot representing the state of a |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
68 //! \brief Returns the snapshot process’ CPU usage times in \a user_time and | 70 //! \brief Returns the snapshot process’ CPU usage times in \a user_time and |
69 //! \a system_time. | 71 //! \a system_time. |
70 //! | 72 //! |
71 //! \param[out] user_time The time that the process has spent executing in | 73 //! \param[out] user_time The time that the process has spent executing in |
72 //! user mode. | 74 //! user mode. |
73 //! \param[out] system_time The time that the process has spent executing in | 75 //! \param[out] system_time The time that the process has spent executing in |
74 //! system (kernel) mode. | 76 //! system (kernel) mode. |
75 virtual void ProcessCPUTimes(timeval* user_time, | 77 virtual void ProcessCPUTimes(timeval* user_time, |
76 timeval* system_time) const = 0; | 78 timeval* system_time) const = 0; |
77 | 79 |
80 //! \brief Returns key-value string annotations recorded for the process, | |
81 //! system, or snapshot producer. | |
82 //! | |
83 //! This method retrieves annotations recorded for a process. These | |
84 //! annotations are intended for diagnostic use, including crash analysis. | |
85 //! “Simple annotations” are structured as a sequence of key-value pairs, | |
86 //! where all keys and values are strings. These are referred to in Chrome as | |
87 //! “crash keys.” | |
88 //! | |
89 //! Annotations stored here may reflect the process, system, or snapshot | |
90 //! producer. Most annotations not under the client’s direct control will be | |
91 //! retrievable by this method. For clients such as Chrome, this includes the | |
92 //! product name and version. | |
93 //! | |
94 //! Additional per-module annotations may be obtained by calling | |
95 //! ModuleSnapshot::AnnotationsSimpleMap(). | |
96 virtual std::map<std::string, std::string> AnnotationsSimpleMap() const = 0; | |
Robert Sesek
2015/02/17 22:20:35
This could be a const& instead, since the objects
Mark Mentovai
2015/02/17 22:22:01
Robert Sesek wrote:
Robert Sesek
2015/02/17 22:23:14
I don't feel strongly, but the copy seems like it
| |
97 | |
78 //! \brief Returns a SystemSnapshot reflecting the characteristics of the | 98 //! \brief Returns a SystemSnapshot reflecting the characteristics of the |
79 //! system that ran the snapshot process at the time of the snapshot. | 99 //! system that ran the snapshot process at the time of the snapshot. |
80 //! | 100 //! |
81 //! \return A SystemSnapshot object. The caller does not take ownership of | 101 //! \return A SystemSnapshot object. The caller does not take ownership of |
82 //! this object, it is scoped to the lifetime of the ProcessSnapshot | 102 //! this object, it is scoped to the lifetime of the ProcessSnapshot |
83 //! object that it was obtained from. | 103 //! object that it was obtained from. |
84 virtual const SystemSnapshot* System() const = 0; | 104 virtual const SystemSnapshot* System() const = 0; |
85 | 105 |
86 //! \brief Returns ModuleSnapshot objects reflecting the code modules (binary | 106 //! \brief Returns ModuleSnapshot objects reflecting the code modules (binary |
87 //! images) loaded into the snapshot process at the time of the snapshot. | 107 //! images) loaded into the snapshot process at the time of the snapshot. |
(...skipping 18 matching lines...) Expand all Loading... | |
106 //! \return An ExceptionSnapshot object. The caller does not take ownership of | 126 //! \return An ExceptionSnapshot object. The caller does not take ownership of |
107 //! this object, it is scoped to the lifetime of the ProcessSnapshot | 127 //! this object, it is scoped to the lifetime of the ProcessSnapshot |
108 //! object that it was obtained from. If the snapshot is not a result of | 128 //! object that it was obtained from. If the snapshot is not a result of |
109 //! an exception, returns `nullptr`. | 129 //! an exception, returns `nullptr`. |
110 virtual const ExceptionSnapshot* Exception() const = 0; | 130 virtual const ExceptionSnapshot* Exception() const = 0; |
111 }; | 131 }; |
112 | 132 |
113 } // namespace crashpad | 133 } // namespace crashpad |
114 | 134 |
115 #endif // CRASHPAD_SNAPSHOT_PROCESS_SNAPSHOT_H_ | 135 #endif // CRASHPAD_SNAPSHOT_PROCESS_SNAPSHOT_H_ |
OLD | NEW |