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 14 matching lines...) Expand all Loading... |
25 namespace crashpad { | 25 namespace crashpad { |
26 | 26 |
27 class FileWriterInterface; | 27 class FileWriterInterface; |
28 | 28 |
29 namespace internal { | 29 namespace internal { |
30 | 30 |
31 //! \brief The base class for all content that might be written to a minidump | 31 //! \brief The base class for all content that might be written to a minidump |
32 //! file. | 32 //! file. |
33 class MinidumpWritable { | 33 class MinidumpWritable { |
34 public: | 34 public: |
| 35 virtual ~MinidumpWritable(); |
| 36 |
35 //! \brief Writes an object and all of its children to a minidump file. | 37 //! \brief Writes an object and all of its children to a minidump file. |
36 //! | 38 //! |
37 //! Use this on the root object of a tree of MinidumpWritable objects, | 39 //! Use this on the root object of a tree of MinidumpWritable objects, |
38 //! typically on a MinidumpFileWriter object. | 40 //! typically on a MinidumpFileWriter object. |
39 //! | 41 //! |
40 //! \param[in] file_writer The file writer to receive the minidump file’s | 42 //! \param[in] file_writer The file writer to receive the minidump file’s |
41 //! content. | 43 //! content. |
42 //! | 44 //! |
43 //! \return `true` on success. `false` on failure, with an appropriate message | 45 //! \return `true` on success. `false` on failure, with an appropriate message |
44 //! logged. | 46 //! logged. |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 //! not need to be consulted in order to process a minidump file. | 129 //! not need to be consulted in order to process a minidump file. |
128 kPhaseLate, | 130 kPhaseLate, |
129 }; | 131 }; |
130 | 132 |
131 //! \brief A size value used to signal failure by methods that return | 133 //! \brief A size value used to signal failure by methods that return |
132 //! `size_t`. | 134 //! `size_t`. |
133 static const size_t kInvalidSize; | 135 static const size_t kInvalidSize; |
134 | 136 |
135 MinidumpWritable(); | 137 MinidumpWritable(); |
136 | 138 |
137 // This doesn’t really need to be virtual because nothing ever deletes a | |
138 // MinidumpWritable* through an interface pointer with that type, and this is | |
139 // guaranteed by being protected. Regardless, the style guide is somewhat | |
140 // insistent. | |
141 // http://google-styleguide.googlecode.com/svn/trunk/cppguide.html#Inheritance | |
142 virtual ~MinidumpWritable(); | |
143 | |
144 //! \brief The state of the object. | 139 //! \brief The state of the object. |
145 State state() const { return state_; } | 140 State state() const { return state_; } |
146 | 141 |
147 //! \brief Transitions the object from #kStateMutable to #kStateFrozen. | 142 //! \brief Transitions the object from #kStateMutable to #kStateFrozen. |
148 //! | 143 //! |
149 //! The default implementation marks the object as frozen and recursively | 144 //! The default implementation marks the object as frozen and recursively |
150 //! calls Freeze() on all of its children. Subclasses may override this method | 145 //! calls Freeze() on all of its children. Subclasses may override this method |
151 //! to perform processing that should only be done once callers have finished | 146 //! to perform processing that should only be done once callers have finished |
152 //! populating an object with data. Typically, a subclass implementation would | 147 //! populating an object with data. Typically, a subclass implementation would |
153 //! call RegisterRVA() or RegisterLocationDescriptor() on other objects as | 148 //! call RegisterRVA() or RegisterLocationDescriptor() on other objects as |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 size_t leading_pad_bytes_; | 268 size_t leading_pad_bytes_; |
274 State state_; | 269 State state_; |
275 | 270 |
276 DISALLOW_COPY_AND_ASSIGN(MinidumpWritable); | 271 DISALLOW_COPY_AND_ASSIGN(MinidumpWritable); |
277 }; | 272 }; |
278 | 273 |
279 } // namespace internal | 274 } // namespace internal |
280 } // namespace crashpad | 275 } // namespace crashpad |
281 | 276 |
282 #endif // CRASHPAD_MINIDUMP_MINIDUMP_WRITABLE_H_ | 277 #endif // CRASHPAD_MINIDUMP_MINIDUMP_WRITABLE_H_ |
OLD | NEW |