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 12 matching lines...) Expand all Loading... |
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 "minidump/minidump_extensions.h" | 26 #include "minidump/minidump_extensions.h" |
27 #include "minidump/minidump_stream_writer.h" | 27 #include "minidump/minidump_stream_writer.h" |
28 #include "minidump/minidump_writable.h" | 28 #include "minidump/minidump_writable.h" |
29 #include "util/stdlib/pointer_container.h" | 29 #include "util/stdlib/pointer_container.h" |
30 | 30 |
31 namespace crashpad { | 31 namespace crashpad { |
32 | 32 |
| 33 class ProcessSnapshot; |
| 34 |
33 //! \brief The root-level object in a minidump file. | 35 //! \brief The root-level object in a minidump file. |
34 //! | 36 //! |
35 //! This object writes a MINIDUMP_HEADER and list of MINIDUMP_DIRECTORY entries | 37 //! This object writes a MINIDUMP_HEADER and list of MINIDUMP_DIRECTORY entries |
36 //! to a minidump file. | 38 //! to a minidump file. |
37 class MinidumpFileWriter final : public internal::MinidumpWritable { | 39 class MinidumpFileWriter final : public internal::MinidumpWritable { |
38 public: | 40 public: |
39 MinidumpFileWriter(); | 41 MinidumpFileWriter(); |
40 ~MinidumpFileWriter() override; | 42 ~MinidumpFileWriter() override; |
41 | 43 |
| 44 //! \brief Initializes the MinidumpFileWriter and populates it with |
| 45 //! appropriate child streams based on \a process_snapshot. |
| 46 //! |
| 47 //! This method will add additional streams to the minidump file as children |
| 48 //! of the MinidumpFileWriter object and as pointees of the top-level |
| 49 //! MINIDUMP_DIRECTORY. To do so, it will obtain other snapshot information |
| 50 //! from \a process_snapshot, such as a SystemSnapshot, lists of |
| 51 //! ThreadSnapshot and ModuleSnapshot objects, and, if available, an |
| 52 //! ExceptionSnapshot. |
| 53 //! |
| 54 //! \param[in] process_snapshot The process snapshot to use as source data. |
| 55 //! |
| 56 //! \note Valid in #kStateMutable. No mutator methods may be called before |
| 57 //! this method, and it is not normally necessary to call any mutator |
| 58 //! methods after this method. |
| 59 void InitializeFromSnapshot(const ProcessSnapshot* process_snapshot); |
| 60 |
42 //! \brief Sets MINIDUMP_HEADER::Timestamp. | 61 //! \brief Sets MINIDUMP_HEADER::Timestamp. |
43 //! | 62 //! |
44 //! \note Valid in #kStateMutable. | 63 //! \note Valid in #kStateMutable. |
45 void SetTimestamp(time_t timestamp); | 64 void SetTimestamp(time_t timestamp); |
46 | 65 |
47 //! \brief Adds a stream to the minidump file and arranges for a | 66 //! \brief Adds a stream to the minidump file and arranges for a |
48 //! MINIDUMP_DIRECTORY entry to point to it. | 67 //! MINIDUMP_DIRECTORY entry to point to it. |
49 //! | 68 //! |
50 //! This object takes ownership of \a stream and becomes its parent in the | 69 //! This object takes ownership of \a stream and becomes its parent in the |
51 //! overall tree of internal::MinidumpWritable objects. | 70 //! overall tree of internal::MinidumpWritable objects. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 102 |
84 // Protects against multiple streams with the same ID being added. | 103 // Protects against multiple streams with the same ID being added. |
85 std::set<MinidumpStreamType> stream_types_; | 104 std::set<MinidumpStreamType> stream_types_; |
86 | 105 |
87 DISALLOW_COPY_AND_ASSIGN(MinidumpFileWriter); | 106 DISALLOW_COPY_AND_ASSIGN(MinidumpFileWriter); |
88 }; | 107 }; |
89 | 108 |
90 } // namespace crashpad | 109 } // namespace crashpad |
91 | 110 |
92 #endif // CRASHPAD_MINIDUMP_MINIDUMP_WRITER_H_ | 111 #endif // CRASHPAD_MINIDUMP_MINIDUMP_WRITER_H_ |
OLD | NEW |