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, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 snapshot_time_ = snapshot_time; | 51 snapshot_time_ = snapshot_time; |
52 } | 52 } |
53 void SetProcessStartTime(const timeval& start_time) { | 53 void SetProcessStartTime(const timeval& start_time) { |
54 process_start_time_ = start_time; | 54 process_start_time_ = start_time; |
55 } | 55 } |
56 void SetProcessCPUTimes(const timeval& user_time, | 56 void SetProcessCPUTimes(const timeval& user_time, |
57 const timeval& system_time) { | 57 const timeval& system_time) { |
58 process_cpu_user_time_ = user_time; | 58 process_cpu_user_time_ = user_time; |
59 process_cpu_system_time_ = system_time; | 59 process_cpu_system_time_ = system_time; |
60 } | 60 } |
| 61 void SetReportID(const UUID& report_id) { report_id_ = report_id; } |
61 void SetClientID(const UUID& client_id) { client_id_ = client_id; } | 62 void SetClientID(const UUID& client_id) { client_id_ = client_id; } |
62 void SetAnnotationsSimpleMap( | 63 void SetAnnotationsSimpleMap( |
63 const std::map<std::string, std::string>& annotations_simple_map) { | 64 const std::map<std::string, std::string>& annotations_simple_map) { |
64 annotations_simple_map_ = annotations_simple_map; | 65 annotations_simple_map_ = annotations_simple_map; |
65 } | 66 } |
66 | 67 |
67 //! \brief Sets the system snapshot to be returned by System(). | 68 //! \brief Sets the system snapshot to be returned by System(). |
68 //! | 69 //! |
69 //! \param[in] system The system snapshot that System() will return. The | 70 //! \param[in] system The system snapshot that System() will return. The |
70 //! TestProcessSnapshot object takes ownership of \a system. | 71 //! TestProcessSnapshot object takes ownership of \a system. |
(...skipping 23 matching lines...) Expand all Loading... |
94 exception_ = exception.Pass(); | 95 exception_ = exception.Pass(); |
95 } | 96 } |
96 | 97 |
97 // ProcessSnapshot: | 98 // ProcessSnapshot: |
98 | 99 |
99 pid_t ProcessID() const override; | 100 pid_t ProcessID() const override; |
100 pid_t ParentProcessID() const override; | 101 pid_t ParentProcessID() const override; |
101 void SnapshotTime(timeval* snapshot_time) const override; | 102 void SnapshotTime(timeval* snapshot_time) const override; |
102 void ProcessStartTime(timeval* start_time) const override; | 103 void ProcessStartTime(timeval* start_time) const override; |
103 void ProcessCPUTimes(timeval* user_time, timeval* system_time) const override; | 104 void ProcessCPUTimes(timeval* user_time, timeval* system_time) const override; |
| 105 void ReportID(UUID* report_id) const override; |
104 void ClientID(UUID* client_id) const override; | 106 void ClientID(UUID* client_id) const override; |
105 const std::map<std::string, std::string>& AnnotationsSimpleMap() | 107 const std::map<std::string, std::string>& AnnotationsSimpleMap() |
106 const override; | 108 const override; |
107 const SystemSnapshot* System() const override; | 109 const SystemSnapshot* System() const override; |
108 std::vector<const ThreadSnapshot*> Threads() const override; | 110 std::vector<const ThreadSnapshot*> Threads() const override; |
109 std::vector<const ModuleSnapshot*> Modules() const override; | 111 std::vector<const ModuleSnapshot*> Modules() const override; |
110 const ExceptionSnapshot* Exception() const override; | 112 const ExceptionSnapshot* Exception() const override; |
111 | 113 |
112 private: | 114 private: |
113 pid_t process_id_; | 115 pid_t process_id_; |
114 pid_t parent_process_id_; | 116 pid_t parent_process_id_; |
115 timeval snapshot_time_; | 117 timeval snapshot_time_; |
116 timeval process_start_time_; | 118 timeval process_start_time_; |
117 timeval process_cpu_user_time_; | 119 timeval process_cpu_user_time_; |
118 timeval process_cpu_system_time_; | 120 timeval process_cpu_system_time_; |
| 121 UUID report_id_; |
119 UUID client_id_; | 122 UUID client_id_; |
120 std::map<std::string, std::string> annotations_simple_map_; | 123 std::map<std::string, std::string> annotations_simple_map_; |
121 scoped_ptr<SystemSnapshot> system_; | 124 scoped_ptr<SystemSnapshot> system_; |
122 PointerVector<ThreadSnapshot> threads_; | 125 PointerVector<ThreadSnapshot> threads_; |
123 PointerVector<ModuleSnapshot> modules_; | 126 PointerVector<ModuleSnapshot> modules_; |
124 scoped_ptr<ExceptionSnapshot> exception_; | 127 scoped_ptr<ExceptionSnapshot> exception_; |
125 | 128 |
126 DISALLOW_COPY_AND_ASSIGN(TestProcessSnapshot); | 129 DISALLOW_COPY_AND_ASSIGN(TestProcessSnapshot); |
127 }; | 130 }; |
128 | 131 |
129 } // namespace test | 132 } // namespace test |
130 } // namespace crashpad | 133 } // namespace crashpad |
131 | 134 |
132 #endif // CRASHPAD_SNAPSHOT_TEST_TEST_PROCESS_SNAPSHOT_H_ | 135 #endif // CRASHPAD_SNAPSHOT_TEST_TEST_PROCESS_SNAPSHOT_H_ |
OLD | NEW |