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_MINIDUMP_MINIDUMP_CRASHPAD_INFO_WRITER_H_ | 15 #ifndef CRASHPAD_MINIDUMP_MINIDUMP_CRASHPAD_INFO_WRITER_H_ |
16 #define CRASHPAD_MINIDUMP_MINIDUMP_CRASHPAD_INFO_WRITER_H_ | 16 #define CRASHPAD_MINIDUMP_MINIDUMP_CRASHPAD_INFO_WRITER_H_ |
17 | 17 |
18 #include <stdint.h> | |
19 #include <sys/types.h> | |
20 | |
21 #include <string> | |
22 #include <vector> | 18 #include <vector> |
23 | 19 |
24 #include "base/basictypes.h" | 20 #include "base/basictypes.h" |
25 #include "minidump/minidump_extensions.h" | 21 #include "minidump/minidump_extensions.h" |
26 #include "minidump/minidump_simple_string_dictionary_writer.h" | |
27 #include "minidump/minidump_stream_writer.h" | 22 #include "minidump/minidump_stream_writer.h" |
28 #include "minidump/minidump_writable.h" | |
29 #include "util/file/file_writer.h" | |
30 | 23 |
31 namespace crashpad { | 24 namespace crashpad { |
32 | 25 |
| 26 class MinidumpModuleCrashpadInfoListWriter; |
| 27 |
33 //! \brief The writer for a MinidumpCrashpadInfo stream in a minidump file. | 28 //! \brief The writer for a MinidumpCrashpadInfo stream in a minidump file. |
34 class MinidumpCrashpadInfoWriter final : public internal::MinidumpStreamWriter { | 29 class MinidumpCrashpadInfoWriter final : public internal::MinidumpStreamWriter { |
35 public: | 30 public: |
36 MinidumpCrashpadInfoWriter(); | 31 MinidumpCrashpadInfoWriter(); |
37 ~MinidumpCrashpadInfoWriter(); | 32 ~MinidumpCrashpadInfoWriter(); |
38 | 33 |
39 //! \brief Arranges for MinidumpCrashpadInfo::simple_annotations to point to | 34 //! \brief Arranges for MinidumpCrashpadInfo::module_list to point to the |
40 //! the MinidumpSimpleStringDictionaryWriter object to be written by \a | 35 //! MinidumpModuleCrashpadInfoList object to be written by \a |
41 //! simple_annotations. | 36 //! module_list. |
42 //! | 37 //! |
43 //! \a simple_annotations will become a child of this object in the overall | 38 //! \a module_list will become a child of this object in the overall tree of |
44 //! tree of internal::MinidumpWritable objects. | 39 //! internal::MinidumpWritable objects. |
45 //! | 40 //! |
46 //! \note Valid in #kStateMutable. | 41 //! \note Valid in #kStateMutable. |
47 void SetSimpleAnnotations( | 42 void SetModuleList(MinidumpModuleCrashpadInfoListWriter* module_list); |
48 MinidumpSimpleStringDictionaryWriter* simple_annotations); | |
49 | 43 |
50 protected: | 44 protected: |
51 // MinidumpWritable: | 45 // MinidumpWritable: |
52 bool Freeze() override; | 46 bool Freeze() override; |
53 size_t SizeOfObject() override; | 47 size_t SizeOfObject() override; |
54 std::vector<MinidumpWritable*> Children() override; | 48 std::vector<MinidumpWritable*> Children() override; |
55 bool WriteObject(FileWriterInterface* file_writer) override; | 49 bool WriteObject(FileWriterInterface* file_writer) override; |
56 | 50 |
57 // MinidumpStreamWriter: | 51 // MinidumpStreamWriter: |
58 MinidumpStreamType StreamType() const override; | 52 MinidumpStreamType StreamType() const override; |
59 | 53 |
60 private: | 54 private: |
61 MinidumpCrashpadInfo crashpad_info_; | 55 MinidumpCrashpadInfo crashpad_info_; |
62 MinidumpSimpleStringDictionaryWriter* simple_annotations_; // weak | 56 MinidumpModuleCrashpadInfoListWriter* module_list_; // weak |
63 | 57 |
64 DISALLOW_COPY_AND_ASSIGN(MinidumpCrashpadInfoWriter); | 58 DISALLOW_COPY_AND_ASSIGN(MinidumpCrashpadInfoWriter); |
65 }; | 59 }; |
66 | 60 |
67 } // namespace crashpad | 61 } // namespace crashpad |
68 | 62 |
69 #endif // CRASHPAD_MINIDUMP_MINIDUMP_CRASHPAD_INFO_WRITER_H_ | 63 #endif // CRASHPAD_MINIDUMP_MINIDUMP_CRASHPAD_INFO_WRITER_H_ |
OLD | NEW |