Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1019)

Side by Side Diff: snapshot/test/test_process_snapshot.h

Issue 1407643004: Some plumbing for the beginning of getting handles into snapshot/minidump (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@handles-redux
Patch Set: . Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « snapshot/snapshot.gyp ('k') | snapshot/test/test_process_snapshot.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 //! \brief Adds a memory map region snapshot to be returned by MemoryMap(). 100 //! \brief Adds a memory map region snapshot to be returned by MemoryMap().
101 //! 101 //!
102 //! \param[in] region The memory map region snapshot that will be included in 102 //! \param[in] region The memory map region snapshot that will be included in
103 //! MemoryMap(). The TestProcessSnapshot object takes ownership of \a 103 //! MemoryMap(). The TestProcessSnapshot object takes ownership of \a
104 //! region. 104 //! region.
105 void AddMemoryMapRegion(scoped_ptr<MemoryMapRegionSnapshot> region) { 105 void AddMemoryMapRegion(scoped_ptr<MemoryMapRegionSnapshot> region) {
106 memory_map_.push_back(region.release()); 106 memory_map_.push_back(region.release());
107 } 107 }
108 108
109 //! \brief Adds a handle snapshot to be returned by Handles().
110 //!
111 //! \param[in] region The handle snapshot that will be included in Handles().
112 void AddHandle(const HandleSnapshot& handle) {
113 handles_.push_back(handle);
114 }
115
109 //! \brief Add a memory snapshot to be returned by ExtraMemory(). 116 //! \brief Add a memory snapshot to be returned by ExtraMemory().
110 //! 117 //!
111 //! \param[in] extra_memory The memory snapshot that will be included in 118 //! \param[in] extra_memory The memory snapshot that will be included in
112 //! ExtraMemory(). The TestProcessSnapshot object takes ownership of \a 119 //! ExtraMemory(). The TestProcessSnapshot object takes ownership of \a
113 //! extra_memory. 120 //! extra_memory.
114 void AddExtraMemory(scoped_ptr<MemorySnapshot> extra_memory) { 121 void AddExtraMemory(scoped_ptr<MemorySnapshot> extra_memory) {
115 extra_memory_.push_back(extra_memory.release()); 122 extra_memory_.push_back(extra_memory.release());
116 } 123 }
117 124
118 // ProcessSnapshot: 125 // ProcessSnapshot:
119 126
120 pid_t ProcessID() const override; 127 pid_t ProcessID() const override;
121 pid_t ParentProcessID() const override; 128 pid_t ParentProcessID() const override;
122 void SnapshotTime(timeval* snapshot_time) const override; 129 void SnapshotTime(timeval* snapshot_time) const override;
123 void ProcessStartTime(timeval* start_time) const override; 130 void ProcessStartTime(timeval* start_time) const override;
124 void ProcessCPUTimes(timeval* user_time, timeval* system_time) const override; 131 void ProcessCPUTimes(timeval* user_time, timeval* system_time) const override;
125 void ReportID(UUID* report_id) const override; 132 void ReportID(UUID* report_id) const override;
126 void ClientID(UUID* client_id) const override; 133 void ClientID(UUID* client_id) const override;
127 const std::map<std::string, std::string>& AnnotationsSimpleMap() 134 const std::map<std::string, std::string>& AnnotationsSimpleMap()
128 const override; 135 const override;
129 const SystemSnapshot* System() const override; 136 const SystemSnapshot* System() const override;
130 std::vector<const ThreadSnapshot*> Threads() const override; 137 std::vector<const ThreadSnapshot*> Threads() const override;
131 std::vector<const ModuleSnapshot*> Modules() const override; 138 std::vector<const ModuleSnapshot*> Modules() const override;
132 const ExceptionSnapshot* Exception() const override; 139 const ExceptionSnapshot* Exception() const override;
133 std::vector<const MemoryMapRegionSnapshot*> MemoryMap() const override; 140 std::vector<const MemoryMapRegionSnapshot*> MemoryMap() const override;
141 std::vector<HandleSnapshot> Handles() const override;
134 std::vector<const MemorySnapshot*> ExtraMemory() const override; 142 std::vector<const MemorySnapshot*> ExtraMemory() const override;
135 143
136 private: 144 private:
137 pid_t process_id_; 145 pid_t process_id_;
138 pid_t parent_process_id_; 146 pid_t parent_process_id_;
139 timeval snapshot_time_; 147 timeval snapshot_time_;
140 timeval process_start_time_; 148 timeval process_start_time_;
141 timeval process_cpu_user_time_; 149 timeval process_cpu_user_time_;
142 timeval process_cpu_system_time_; 150 timeval process_cpu_system_time_;
143 UUID report_id_; 151 UUID report_id_;
144 UUID client_id_; 152 UUID client_id_;
145 std::map<std::string, std::string> annotations_simple_map_; 153 std::map<std::string, std::string> annotations_simple_map_;
146 scoped_ptr<SystemSnapshot> system_; 154 scoped_ptr<SystemSnapshot> system_;
147 PointerVector<ThreadSnapshot> threads_; 155 PointerVector<ThreadSnapshot> threads_;
148 PointerVector<ModuleSnapshot> modules_; 156 PointerVector<ModuleSnapshot> modules_;
149 scoped_ptr<ExceptionSnapshot> exception_; 157 scoped_ptr<ExceptionSnapshot> exception_;
150 PointerVector<MemoryMapRegionSnapshot> memory_map_; 158 PointerVector<MemoryMapRegionSnapshot> memory_map_;
159 std::vector<HandleSnapshot> handles_;
151 PointerVector<MemorySnapshot> extra_memory_; 160 PointerVector<MemorySnapshot> extra_memory_;
152 161
153 DISALLOW_COPY_AND_ASSIGN(TestProcessSnapshot); 162 DISALLOW_COPY_AND_ASSIGN(TestProcessSnapshot);
154 }; 163 };
155 164
156 } // namespace test 165 } // namespace test
157 } // namespace crashpad 166 } // namespace crashpad
158 167
159 #endif // CRASHPAD_SNAPSHOT_TEST_TEST_PROCESS_SNAPSHOT_H_ 168 #endif // CRASHPAD_SNAPSHOT_TEST_TEST_PROCESS_SNAPSHOT_H_
OLDNEW
« no previous file with comments | « snapshot/snapshot.gyp ('k') | snapshot/test/test_process_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698