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_MAC_PROCESS_SNAPSHOT_MAC_H_ | 15 #ifndef CRASHPAD_SNAPSHOT_MAC_PROCESS_SNAPSHOT_MAC_H_ |
16 #define CRASHPAD_SNAPSHOT_MAC_PROCESS_SNAPSHOT_MAC_H_ | 16 #define CRASHPAD_SNAPSHOT_MAC_PROCESS_SNAPSHOT_MAC_H_ |
17 | 17 |
18 #include <mach/mach.h> | 18 #include <mach/mach.h> |
19 #include <sys/time.h> | 19 #include <sys/time.h> |
20 #include <unistd.h> | 20 #include <unistd.h> |
21 | 21 |
22 #include <map> | 22 #include <map> |
23 #include <string> | 23 #include <string> |
24 #include <vector> | 24 #include <vector> |
25 | 25 |
26 #include "base/basictypes.h" | 26 #include "base/basictypes.h" |
27 #include "base/memory/scoped_ptr.h" | 27 #include "base/memory/scoped_ptr.h" |
| 28 #include "client/crashpad_info.h" |
28 #include "snapshot/exception_snapshot.h" | 29 #include "snapshot/exception_snapshot.h" |
29 #include "snapshot/mac/exception_snapshot_mac.h" | 30 #include "snapshot/mac/exception_snapshot_mac.h" |
30 #include "snapshot/mac/module_snapshot_mac.h" | 31 #include "snapshot/mac/module_snapshot_mac.h" |
31 #include "snapshot/mac/process_reader.h" | 32 #include "snapshot/mac/process_reader.h" |
32 #include "snapshot/mac/system_snapshot_mac.h" | 33 #include "snapshot/mac/system_snapshot_mac.h" |
33 #include "snapshot/mac/thread_snapshot_mac.h" | 34 #include "snapshot/mac/thread_snapshot_mac.h" |
34 #include "snapshot/module_snapshot.h" | 35 #include "snapshot/module_snapshot.h" |
35 #include "snapshot/process_snapshot.h" | 36 #include "snapshot/process_snapshot.h" |
36 #include "snapshot/system_snapshot.h" | 37 #include "snapshot/system_snapshot.h" |
37 #include "snapshot/thread_snapshot.h" | 38 #include "snapshot/thread_snapshot.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 //! | 79 //! |
79 //! On Mac OS X, all process annotations are under the control of the snapshot | 80 //! On Mac OS X, all process annotations are under the control of the snapshot |
80 //! producer, which may call this method to establish these annotations. | 81 //! producer, which may call this method to establish these annotations. |
81 //! Contrast this with module annotations, which are under the control of the | 82 //! Contrast this with module annotations, which are under the control of the |
82 //! process being snapshotted. | 83 //! process being snapshotted. |
83 void SetAnnotationsSimpleMap( | 84 void SetAnnotationsSimpleMap( |
84 const std::map<std::string, std::string>& annotations_simple_map) { | 85 const std::map<std::string, std::string>& annotations_simple_map) { |
85 annotations_simple_map_ = annotations_simple_map; | 86 annotations_simple_map_ = annotations_simple_map; |
86 } | 87 } |
87 | 88 |
| 89 //! \brief Returns options from CrashpadInfo structures found in modules in |
| 90 //! the process. |
| 91 //! |
| 92 //! \param[out] enable_crashpad_handler A value configured by |
| 93 //! CrashpadInfo::SetCrashpadHandlerState(). Each module in the process is |
| 94 //! considered until one has a CrashpadInfo structure with a value other |
| 95 //! than CrashpadInfo::kDefault for this field. If nothing is found, this |
| 96 //! will be CrashpadInfo::kDefault. |
| 97 //! \param[out] enable_crashpad_handler A value configured by |
| 98 //! CrashpadInfo::SetNativeCrashReporterForwarding(). Each module in the |
| 99 //! process is considered until one has a CrashpadInfo structure with a |
| 100 //! value other than CrashpadInfo::kDefault for this field. If nothing is |
| 101 //! found, this will be CrashpadInfo::kDefault. |
| 102 void GetCrashpadOptions( |
| 103 CrashpadInfo::TriState* enable_crashpad_handler, |
| 104 CrashpadInfo::TriState* enable_native_crash_reporter_forwarding); |
| 105 |
88 // ProcessSnapshot: | 106 // ProcessSnapshot: |
89 | 107 |
90 pid_t ProcessID() const override; | 108 pid_t ProcessID() const override; |
91 pid_t ParentProcessID() const override; | 109 pid_t ParentProcessID() const override; |
92 void SnapshotTime(timeval* snapshot_time) const override; | 110 void SnapshotTime(timeval* snapshot_time) const override; |
93 void ProcessStartTime(timeval* start_time) const override; | 111 void ProcessStartTime(timeval* start_time) const override; |
94 void ProcessCPUTimes(timeval* user_time, timeval* system_time) const override; | 112 void ProcessCPUTimes(timeval* user_time, timeval* system_time) const override; |
95 const std::map<std::string, std::string>& AnnotationsSimpleMap() | 113 const std::map<std::string, std::string>& AnnotationsSimpleMap() |
96 const override; | 114 const override; |
97 const SystemSnapshot* System() const override; | 115 const SystemSnapshot* System() const override; |
(...skipping 16 matching lines...) Expand all Loading... |
114 std::map<std::string, std::string> annotations_simple_map_; | 132 std::map<std::string, std::string> annotations_simple_map_; |
115 timeval snapshot_time_; | 133 timeval snapshot_time_; |
116 InitializationStateDcheck initialized_; | 134 InitializationStateDcheck initialized_; |
117 | 135 |
118 DISALLOW_COPY_AND_ASSIGN(ProcessSnapshotMac); | 136 DISALLOW_COPY_AND_ASSIGN(ProcessSnapshotMac); |
119 }; | 137 }; |
120 | 138 |
121 } // namespace crashpad | 139 } // namespace crashpad |
122 | 140 |
123 #endif // CRASHPAD_SNAPSHOT_MAC_PROCESS_SNAPSHOT_MAC_H_ | 141 #endif // CRASHPAD_SNAPSHOT_MAC_PROCESS_SNAPSHOT_MAC_H_ |
OLD | NEW |