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 11 matching lines...) Expand all Loading... |
22 #include <vector> | 22 #include <vector> |
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 | 29 |
30 namespace crashpad { | 30 namespace crashpad { |
31 | 31 |
| 32 class SystemSnapshot; |
| 33 |
32 namespace internal { | 34 namespace internal { |
33 class MinidumpUTF16StringWriter; | 35 class MinidumpUTF16StringWriter; |
34 } // namespace internal | 36 } // namespace internal |
35 | 37 |
36 //! \brief The writer for a MINIDUMP_SYSTEM_INFO stream in a minidump file. | 38 //! \brief The writer for a MINIDUMP_SYSTEM_INFO stream in a minidump file. |
37 class MinidumpSystemInfoWriter final : public internal::MinidumpStreamWriter { | 39 class MinidumpSystemInfoWriter final : public internal::MinidumpStreamWriter { |
38 public: | 40 public: |
39 MinidumpSystemInfoWriter(); | 41 MinidumpSystemInfoWriter(); |
40 ~MinidumpSystemInfoWriter() override; | 42 ~MinidumpSystemInfoWriter() override; |
41 | 43 |
| 44 //! \brief Initializes MINIDUMP_SYSTEM_INFO based on \a system_snapshot. |
| 45 //! |
| 46 //! \param[in] system_snapshot The system snapshot to use as source data. |
| 47 //! |
| 48 //! \note Valid in #kStateMutable. No mutator methods may be called before |
| 49 //! this method, and it is not normally necessary to call any mutator |
| 50 //! methods after this method. |
| 51 void InitializeFromSnapshot(const SystemSnapshot* system_snapshot); |
| 52 |
42 //! \brief Sets MINIDUMP_SYSTEM_INFO::ProcessorArchitecture. | 53 //! \brief Sets MINIDUMP_SYSTEM_INFO::ProcessorArchitecture. |
43 void SetCPUArchitecture(MinidumpCPUArchitecture processor_architecture) { | 54 void SetCPUArchitecture(MinidumpCPUArchitecture processor_architecture) { |
44 system_info_.ProcessorArchitecture = processor_architecture; | 55 system_info_.ProcessorArchitecture = processor_architecture; |
45 } | 56 } |
46 | 57 |
47 //! \brief Sets MINIDUMP_SYSTEM_INFO::ProcessorLevel and | 58 //! \brief Sets MINIDUMP_SYSTEM_INFO::ProcessorLevel and |
48 //! MINIDUMP_SYSTEM_INFO::ProcessorRevision. | 59 //! MINIDUMP_SYSTEM_INFO::ProcessorRevision. |
49 void SetCPULevelAndRevision(uint16_t processor_level, | 60 void SetCPULevelAndRevision(uint16_t processor_level, |
50 uint16_t processor_revision) { | 61 uint16_t processor_revision) { |
51 system_info_.ProcessorLevel = processor_level; | 62 system_info_.ProcessorLevel = processor_level; |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 private: | 186 private: |
176 MINIDUMP_SYSTEM_INFO system_info_; | 187 MINIDUMP_SYSTEM_INFO system_info_; |
177 scoped_ptr<internal::MinidumpUTF16StringWriter> csd_version_; | 188 scoped_ptr<internal::MinidumpUTF16StringWriter> csd_version_; |
178 | 189 |
179 DISALLOW_COPY_AND_ASSIGN(MinidumpSystemInfoWriter); | 190 DISALLOW_COPY_AND_ASSIGN(MinidumpSystemInfoWriter); |
180 }; | 191 }; |
181 | 192 |
182 } // namespace crashpad | 193 } // namespace crashpad |
183 | 194 |
184 #endif // CRASHPAD_MINIDUMP_MINIDUMP_SYSTEM_INFO_WRITER_H_ | 195 #endif // CRASHPAD_MINIDUMP_MINIDUMP_SYSTEM_INFO_WRITER_H_ |
OLD | NEW |