Chromium Code Reviews| 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_TEST_TEST_PROCESS_SNAPSHOT_H_ | 15 #ifndef CRASHPAD_SNAPSHOT_TEST_TEST_PROCESS_SNAPSHOT_H_ |
| 16 #define CRASHPAD_SNAPSHOT_TEST_TEST_PROCESS_SNAPSHOT_H_ | 16 #define CRASHPAD_SNAPSHOT_TEST_TEST_PROCESS_SNAPSHOT_H_ |
| 17 | 17 |
| 18 #include <stdint.h> | 18 #include <stdint.h> |
| 19 #include <sys/time.h> | 19 #include <sys/time.h> |
| 20 #include <sys/types.h> | 20 #include <sys/types.h> |
| 21 | 21 |
| 22 #include <vector> | 22 #include <vector> |
| 23 | 23 |
| 24 #include "base/basictypes.h" | 24 #include "base/basictypes.h" |
| 25 #include "base/memory/scoped_ptr.h" | 25 #include "base/memory/scoped_ptr.h" |
| 26 #include "snapshot/exception_snapshot.h" | 26 #include "snapshot/exception_snapshot.h" |
| 27 #include "snapshot/module_snapshot.h" | |
|
Mark Mentovai
2015/02/05 14:48:36
You can remove the #includes for module_snapshot.h
scottmg
2015/02/05 17:24:52
Done.
| |
| 27 #include "snapshot/process_snapshot.h" | 28 #include "snapshot/process_snapshot.h" |
| 28 #include "snapshot/system_snapshot.h" | 29 #include "snapshot/system_snapshot.h" |
| 30 #include "snapshot/thread_snapshot.h" | |
| 29 #include "util/stdlib/pointer_container.h" | 31 #include "util/stdlib/pointer_container.h" |
| 30 | 32 |
| 31 namespace crashpad { | 33 namespace crashpad { |
| 32 | 34 |
|
Mark Mentovai
2015/02/05 14:48:36
You can get rid of this blank line too, since ther
scottmg
2015/02/05 17:24:52
Done.
| |
| 33 class ModuleSnapshot; | |
| 34 class ThreadSnapshot; | |
| 35 | |
| 36 namespace test { | 35 namespace test { |
| 37 | 36 |
| 38 //! \brief A test ProcessSnapshot that can carry arbitrary data for testing | 37 //! \brief A test ProcessSnapshot that can carry arbitrary data for testing |
| 39 //! purposes. | 38 //! purposes. |
| 40 class TestProcessSnapshot final : public ProcessSnapshot { | 39 class TestProcessSnapshot final : public ProcessSnapshot { |
| 41 public: | 40 public: |
| 42 TestProcessSnapshot(); | 41 TestProcessSnapshot(); |
| 43 ~TestProcessSnapshot() override; | 42 ~TestProcessSnapshot() override; |
| 44 | 43 |
| 45 void SetProcessID(pid_t process_id) { process_id_ = process_id; } | 44 void SetProcessID(pid_t process_id) { process_id_ = process_id; } |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 61 //! \brief Sets the system snapshot to be returned by System(). | 60 //! \brief Sets the system snapshot to be returned by System(). |
| 62 //! | 61 //! |
| 63 //! \param[in] system The system snapshot that System() will return. The | 62 //! \param[in] system The system snapshot that System() will return. The |
| 64 //! TestProcessSnapshot object takes ownership of \a system. | 63 //! TestProcessSnapshot object takes ownership of \a system. |
| 65 void SetSystem(scoped_ptr<SystemSnapshot> system) { system_ = system.Pass(); } | 64 void SetSystem(scoped_ptr<SystemSnapshot> system) { system_ = system.Pass(); } |
| 66 | 65 |
| 67 //! \brief Adds a thread snapshot to be returned by Threads(). | 66 //! \brief Adds a thread snapshot to be returned by Threads(). |
| 68 //! | 67 //! |
| 69 //! \param[in] thread The thread snapshot that will be included in Threads(). | 68 //! \param[in] thread The thread snapshot that will be included in Threads(). |
| 70 //! The TestProcessSnapshot object takes ownership of \a thread. | 69 //! The TestProcessSnapshot object takes ownership of \a thread. |
| 71 void AddThread(scoped_ptr<ThreadSnapshot> thread) { | 70 void AddThread(scoped_ptr<ThreadSnapshot> thread) { |
|
Mark Mentovai
2015/02/05 14:48:36
These scoped_ptr<> arguments are why the forward d
scottmg
2015/02/05 17:24:52
Right. I noticed the members and out-of-line destr
| |
| 72 threads_.push_back(thread.release()); | 71 threads_.push_back(thread.release()); |
| 73 } | 72 } |
| 74 | 73 |
| 75 //! \brief Adds a module snapshot to be returned by Modules(). | 74 //! \brief Adds a module snapshot to be returned by Modules(). |
| 76 //! | 75 //! |
| 77 //! \param[in] module The module snapshot that will be included in Modules(). | 76 //! \param[in] module The module snapshot that will be included in Modules(). |
| 78 //! The TestProcessSnapshot object takes ownership of \a module. | 77 //! The TestProcessSnapshot object takes ownership of \a module. |
| 79 void AddModule(scoped_ptr<ModuleSnapshot> module) { | 78 void AddModule(scoped_ptr<ModuleSnapshot> module) { |
| 80 modules_.push_back(module.release()); | 79 modules_.push_back(module.release()); |
| 81 } | 80 } |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 112 PointerVector<ModuleSnapshot> modules_; | 111 PointerVector<ModuleSnapshot> modules_; |
| 113 scoped_ptr<ExceptionSnapshot> exception_; | 112 scoped_ptr<ExceptionSnapshot> exception_; |
| 114 | 113 |
| 115 DISALLOW_COPY_AND_ASSIGN(TestProcessSnapshot); | 114 DISALLOW_COPY_AND_ASSIGN(TestProcessSnapshot); |
| 116 }; | 115 }; |
| 117 | 116 |
| 118 } // namespace test | 117 } // namespace test |
| 119 } // namespace crashpad | 118 } // namespace crashpad |
| 120 | 119 |
| 121 #endif // CRASHPAD_SNAPSHOT_TEST_TEST_PROCESS_SNAPSHOT_H_ | 120 #endif // CRASHPAD_SNAPSHOT_TEST_TEST_PROCESS_SNAPSHOT_H_ |
| OLD | NEW |