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 #include "snapshot/exception_snapshot.h" | 15 #include "snapshot/exception_snapshot.h" |
16 #include "snapshot/system_snapshot.h" | 16 #include "snapshot/system_snapshot.h" |
17 #include "snapshot/test/test_process_snapshot.h" | 17 #include "snapshot/test/test_process_snapshot.h" |
18 | 18 |
19 namespace crashpad { | 19 namespace crashpad { |
20 namespace test { | 20 namespace test { |
21 | 21 |
22 TestProcessSnapshot::TestProcessSnapshot() | 22 TestProcessSnapshot::TestProcessSnapshot() |
23 : process_id_(0), | 23 : process_id_(0), |
24 parent_process_id_(0), | 24 parent_process_id_(0), |
25 snapshot_time_(), | 25 snapshot_time_(), |
26 process_start_time_(), | 26 process_start_time_(), |
27 process_cpu_user_time_(), | 27 process_cpu_user_time_(), |
28 process_cpu_system_time_(), | 28 process_cpu_system_time_(), |
| 29 annotations_simple_map_(), |
29 system_(), | 30 system_(), |
30 threads_(), | 31 threads_(), |
31 modules_(), | 32 modules_(), |
32 exception_() { | 33 exception_() { |
33 } | 34 } |
34 | 35 |
35 TestProcessSnapshot::~TestProcessSnapshot() { | 36 TestProcessSnapshot::~TestProcessSnapshot() { |
36 } | 37 } |
37 | 38 |
38 pid_t TestProcessSnapshot::ProcessID() const { | 39 pid_t TestProcessSnapshot::ProcessID() const { |
(...skipping 11 matching lines...) Expand all Loading... |
50 void TestProcessSnapshot::ProcessStartTime(timeval* start_time) const { | 51 void TestProcessSnapshot::ProcessStartTime(timeval* start_time) const { |
51 *start_time = process_start_time_; | 52 *start_time = process_start_time_; |
52 } | 53 } |
53 | 54 |
54 void TestProcessSnapshot::ProcessCPUTimes(timeval* user_time, | 55 void TestProcessSnapshot::ProcessCPUTimes(timeval* user_time, |
55 timeval* system_time) const { | 56 timeval* system_time) const { |
56 *user_time = process_cpu_user_time_; | 57 *user_time = process_cpu_user_time_; |
57 *system_time = process_cpu_system_time_; | 58 *system_time = process_cpu_system_time_; |
58 } | 59 } |
59 | 60 |
| 61 const std::map<std::string, std::string>& |
| 62 TestProcessSnapshot::AnnotationsSimpleMap() const { |
| 63 return annotations_simple_map_; |
| 64 } |
| 65 |
60 const SystemSnapshot* TestProcessSnapshot::System() const { | 66 const SystemSnapshot* TestProcessSnapshot::System() const { |
61 return system_.get(); | 67 return system_.get(); |
62 } | 68 } |
63 | 69 |
64 std::vector<const ThreadSnapshot*> TestProcessSnapshot::Threads() const { | 70 std::vector<const ThreadSnapshot*> TestProcessSnapshot::Threads() const { |
65 std::vector<const ThreadSnapshot*> threads; | 71 std::vector<const ThreadSnapshot*> threads; |
66 for (const ThreadSnapshot* thread : threads_) { | 72 for (const ThreadSnapshot* thread : threads_) { |
67 threads.push_back(thread); | 73 threads.push_back(thread); |
68 } | 74 } |
69 return threads; | 75 return threads; |
70 } | 76 } |
71 | 77 |
72 std::vector<const ModuleSnapshot*> TestProcessSnapshot::Modules() const { | 78 std::vector<const ModuleSnapshot*> TestProcessSnapshot::Modules() const { |
73 std::vector<const ModuleSnapshot*> modules; | 79 std::vector<const ModuleSnapshot*> modules; |
74 for (const ModuleSnapshot* module : modules_) { | 80 for (const ModuleSnapshot* module : modules_) { |
75 modules.push_back(module); | 81 modules.push_back(module); |
76 } | 82 } |
77 return modules; | 83 return modules; |
78 } | 84 } |
79 | 85 |
80 const ExceptionSnapshot* TestProcessSnapshot::Exception() const { | 86 const ExceptionSnapshot* TestProcessSnapshot::Exception() const { |
81 return exception_.get(); | 87 return exception_.get(); |
82 } | 88 } |
83 | 89 |
84 } // namespace test | 90 } // namespace test |
85 } // namespace crashpad | 91 } // namespace crashpad |
OLD | NEW |