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

Side by Side Diff: minidump/minidump_crashpad_info_writer.h

Issue 654573003: Add MinidumpCrashpadInfoWriter and its test (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Address review feedback 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
« no previous file with comments | « minidump/minidump.gyp ('k') | minidump/minidump_crashpad_info_writer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Crashpad Authors. All rights reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (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
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 #ifndef CRASHPAD_MINIDUMP_MINIDUMP_CRASHPAD_INFO_WRITER_H_
16 #define CRASHPAD_MINIDUMP_MINIDUMP_CRASHPAD_INFO_WRITER_H_
17
18 #include <stdint.h>
19 #include <sys/types.h>
20
21 #include <string>
22 #include <vector>
23
24 #include "base/basictypes.h"
25 #include "minidump/minidump_extensions.h"
26 #include "minidump/minidump_simple_string_dictionary_writer.h"
27 #include "minidump/minidump_stream_writer.h"
28 #include "minidump/minidump_writable.h"
29 #include "util/file/file_writer.h"
30
31 namespace crashpad {
32
33 //! \brief The writer for a MinidumpCrashpadInfo stream in a minidump file.
34 class MinidumpCrashpadInfoWriter final : public internal::MinidumpStreamWriter {
35 public:
36 MinidumpCrashpadInfoWriter();
37 ~MinidumpCrashpadInfoWriter();
38
39 //! \brief Arranges for MinidumpCrashpadInfo::simple_annotations to point to
40 //! the MinidumpSimpleStringDictionaryWriter object to be written by \a
41 //! simple_annotations.
42 //!
43 //! \a simple_annotations will become a child of this object in the overall
44 //! tree of internal::MinidumpWritable objects.
45 //!
46 //! \note Valid in #kStateMutable.
47 void SetSimpleAnnotations(
48 MinidumpSimpleStringDictionaryWriter* simple_annotations);
49
50 protected:
51 // MinidumpWritable:
52 bool Freeze() override;
53 size_t SizeOfObject() override;
54 std::vector<MinidumpWritable*> Children() override;
55 bool WriteObject(FileWriterInterface* file_writer) override;
56
57 // MinidumpStreamWriter:
58 MinidumpStreamType StreamType() const override;
59
60 private:
61 MinidumpCrashpadInfo crashpad_info_;
62 MinidumpSimpleStringDictionaryWriter* simple_annotations_; // weak
63
64 DISALLOW_COPY_AND_ASSIGN(MinidumpCrashpadInfoWriter);
65 };
66
67 } // namespace crashpad
68
69 #endif // CRASHPAD_MINIDUMP_MINIDUMP_CRASHPAD_INFO_WRITER_H_
OLDNEW
« no previous file with comments | « minidump/minidump.gyp ('k') | minidump/minidump_crashpad_info_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698