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

Side by Side Diff: minidump/minidump_crashpad_info_writer.h

Issue 675803002: Add MinidumpCrashpadModule, its list form, their writers, and their tests (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 6 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
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,
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> 18 #include <stdint.h>
19 #include <sys/types.h> 19 #include <sys/types.h>
20 20
21 #include <string> 21 #include <string>
22 #include <vector> 22 #include <vector>
23 23
24 #include "base/basictypes.h" 24 #include "base/basictypes.h"
25 #include "minidump/minidump_extensions.h" 25 #include "minidump/minidump_extensions.h"
26 #include "minidump/minidump_simple_string_dictionary_writer.h"
27 #include "minidump/minidump_stream_writer.h" 26 #include "minidump/minidump_stream_writer.h"
28 #include "minidump/minidump_writable.h" 27 #include "minidump/minidump_writable.h"
29 #include "util/file/file_writer.h"
30 28
31 namespace crashpad { 29 namespace crashpad {
32 30
31 class MinidumpCrashpadModuleListWriter;
32
33 //! \brief The writer for a MinidumpCrashpadInfo stream in a minidump file. 33 //! \brief The writer for a MinidumpCrashpadInfo stream in a minidump file.
34 class MinidumpCrashpadInfoWriter final : public internal::MinidumpStreamWriter { 34 class MinidumpCrashpadInfoWriter final : public internal::MinidumpStreamWriter {
35 public: 35 public:
36 MinidumpCrashpadInfoWriter(); 36 MinidumpCrashpadInfoWriter();
37 ~MinidumpCrashpadInfoWriter(); 37 ~MinidumpCrashpadInfoWriter();
38 38
39 //! \brief Arranges for MinidumpCrashpadInfo::simple_annotations to point to 39 //! \brief Arranges for MinidumpCrashpadInfo::crashpad_module_list to point to
40 //! the MinidumpSimpleStringDictionaryWriter object to be written by \a 40 //! the MinidumpCrashpadModuleList object to be written by \a
41 //! simple_annotations. 41 //! crashpad_module_list.
42 //! 42 //!
43 //! \a simple_annotations will become a child of this object in the overall 43 //! \a crashpad_module_list will become a child of this object in the overall
44 //! tree of internal::MinidumpWritable objects. 44 //! tree of internal::MinidumpWritable objects.
45 //! 45 //!
46 //! \note Valid in #kStateMutable. 46 //! \note Valid in #kStateMutable.
47 void SetSimpleAnnotations( 47 void SetCrashpadModuleList(
48 MinidumpSimpleStringDictionaryWriter* simple_annotations); 48 MinidumpCrashpadModuleListWriter* crashpad_module_list);
49 49
50 protected: 50 protected:
51 // MinidumpWritable: 51 // MinidumpWritable:
52 bool Freeze() override; 52 bool Freeze() override;
53 size_t SizeOfObject() override; 53 size_t SizeOfObject() override;
54 std::vector<MinidumpWritable*> Children() override; 54 std::vector<MinidumpWritable*> Children() override;
55 bool WriteObject(FileWriterInterface* file_writer) override; 55 bool WriteObject(FileWriterInterface* file_writer) override;
56 56
57 // MinidumpStreamWriter: 57 // MinidumpStreamWriter:
58 MinidumpStreamType StreamType() const override; 58 MinidumpStreamType StreamType() const override;
59 59
60 private: 60 private:
61 MinidumpCrashpadInfo crashpad_info_; 61 MinidumpCrashpadInfo crashpad_info_;
62 MinidumpSimpleStringDictionaryWriter* simple_annotations_; // weak 62 MinidumpCrashpadModuleListWriter* crashpad_module_list_; // weak
63 63
64 DISALLOW_COPY_AND_ASSIGN(MinidumpCrashpadInfoWriter); 64 DISALLOW_COPY_AND_ASSIGN(MinidumpCrashpadInfoWriter);
65 }; 65 };
66 66
67 } // namespace crashpad 67 } // namespace crashpad
68 68
69 #endif // CRASHPAD_MINIDUMP_MINIDUMP_CRASHPAD_INFO_WRITER_H_ 69 #endif // CRASHPAD_MINIDUMP_MINIDUMP_CRASHPAD_INFO_WRITER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698