| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 //! \note This method will only be called in #kStateFrozen. | 68 //! \note This method will only be called in #kStateFrozen. |
| 69 virtual uint64_t MemoryRangeBaseAddress() const = 0; | 69 virtual uint64_t MemoryRangeBaseAddress() const = 0; |
| 70 | 70 |
| 71 //! \brief Returns the size of the memory region in bytes. | 71 //! \brief Returns the size of the memory region in bytes. |
| 72 //! | 72 //! |
| 73 //! \note This method will only be called in #kStateFrozen or a subsequent | 73 //! \note This method will only be called in #kStateFrozen or a subsequent |
| 74 //! state. | 74 //! state. |
| 75 virtual size_t MemoryRangeSize() const = 0; | 75 virtual size_t MemoryRangeSize() const = 0; |
| 76 | 76 |
| 77 // MinidumpWritable: | 77 // MinidumpWritable: |
| 78 virtual bool Freeze() override; | 78 bool Freeze() override; |
| 79 virtual size_t SizeOfObject() override final; | 79 size_t SizeOfObject() final; |
| 80 | 80 |
| 81 //! \brief Returns the object’s desired byte-boundary alignment. | 81 //! \brief Returns the object’s desired byte-boundary alignment. |
| 82 //! | 82 //! |
| 83 //! Memory regions are aligned to a 16-byte boundary. The actual alignment | 83 //! Memory regions are aligned to a 16-byte boundary. The actual alignment |
| 84 //! requirements of any data within the memory region are unknown, and may be | 84 //! requirements of any data within the memory region are unknown, and may be |
| 85 //! more or less strict than this depending on the platform. | 85 //! more or less strict than this depending on the platform. |
| 86 //! | 86 //! |
| 87 //! \return `16`. | 87 //! \return `16`. |
| 88 //! | 88 //! |
| 89 //! \note Valid in #kStateFrozen or any subsequent state. | 89 //! \note Valid in #kStateFrozen or any subsequent state. |
| 90 virtual size_t Alignment() override; | 90 size_t Alignment() override; |
| 91 | 91 |
| 92 virtual bool WillWriteAtOffsetImpl(off_t offset) override; | 92 bool WillWriteAtOffsetImpl(off_t offset) override; |
| 93 | 93 |
| 94 //! \brief Returns the object’s desired write phase. | 94 //! \brief Returns the object’s desired write phase. |
| 95 //! | 95 //! |
| 96 //! Memory regions are written at the end of minidump files, because it is | 96 //! Memory regions are written at the end of minidump files, because it is |
| 97 //! expected that unlike most other data in a minidump file, the contents of | 97 //! expected that unlike most other data in a minidump file, the contents of |
| 98 //! memory regions will be accessed sparsely. | 98 //! memory regions will be accessed sparsely. |
| 99 //! | 99 //! |
| 100 //! \return #kPhaseLate. | 100 //! \return #kPhaseLate. |
| 101 //! | 101 //! |
| 102 //! \note Valid in any state. | 102 //! \note Valid in any state. |
| 103 virtual Phase WritePhase() override final; | 103 Phase WritePhase() final; |
| 104 | 104 |
| 105 private: | 105 private: |
| 106 MINIDUMP_MEMORY_DESCRIPTOR memory_descriptor_; | 106 MINIDUMP_MEMORY_DESCRIPTOR memory_descriptor_; |
| 107 | 107 |
| 108 // weak | 108 // weak |
| 109 std::vector<MINIDUMP_MEMORY_DESCRIPTOR*> registered_memory_descriptors_; | 109 std::vector<MINIDUMP_MEMORY_DESCRIPTOR*> registered_memory_descriptors_; |
| 110 | 110 |
| 111 DISALLOW_COPY_AND_ASSIGN(MinidumpMemoryWriter); | 111 DISALLOW_COPY_AND_ASSIGN(MinidumpMemoryWriter); |
| 112 }; | 112 }; |
| 113 | 113 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 137 //! This method exists to be called by objects that have their own | 137 //! This method exists to be called by objects that have their own |
| 138 //! MinidumpMemoryWriter children but wish for them to also appear in the | 138 //! MinidumpMemoryWriter children but wish for them to also appear in the |
| 139 //! minidump file’s MINIDUMP_MEMORY_LIST. MinidumpThreadWriter, which has a | 139 //! minidump file’s MINIDUMP_MEMORY_LIST. MinidumpThreadWriter, which has a |
| 140 //! MinidumpMemoryWriter for thread stack memory, is an example. | 140 //! MinidumpMemoryWriter for thread stack memory, is an example. |
| 141 //! | 141 //! |
| 142 //! \note Valid in #kStateMutable. | 142 //! \note Valid in #kStateMutable. |
| 143 void AddExtraMemory(MinidumpMemoryWriter* memory_writer); | 143 void AddExtraMemory(MinidumpMemoryWriter* memory_writer); |
| 144 | 144 |
| 145 protected: | 145 protected: |
| 146 // MinidumpWritable: | 146 // MinidumpWritable: |
| 147 virtual bool Freeze() override; | 147 bool Freeze() override; |
| 148 virtual size_t SizeOfObject() override; | 148 size_t SizeOfObject() override; |
| 149 virtual std::vector<MinidumpWritable*> Children() override; | 149 std::vector<MinidumpWritable*> Children() override; |
| 150 virtual bool WriteObject(FileWriterInterface* file_writer) override; | 150 bool WriteObject(FileWriterInterface* file_writer) override; |
| 151 | 151 |
| 152 // MinidumpStreamWriter: | 152 // MinidumpStreamWriter: |
| 153 virtual MinidumpStreamType StreamType() const override; | 153 MinidumpStreamType StreamType() const override; |
| 154 | 154 |
| 155 private: | 155 private: |
| 156 MINIDUMP_MEMORY_LIST memory_list_base_; | 156 MINIDUMP_MEMORY_LIST memory_list_base_; |
| 157 std::vector<MinidumpMemoryWriter*> memory_writers_; // weak | 157 std::vector<MinidumpMemoryWriter*> memory_writers_; // weak |
| 158 std::vector<MinidumpWritable*> children_; // weak | 158 std::vector<MinidumpWritable*> children_; // weak |
| 159 | 159 |
| 160 DISALLOW_COPY_AND_ASSIGN(MinidumpMemoryListWriter); | 160 DISALLOW_COPY_AND_ASSIGN(MinidumpMemoryListWriter); |
| 161 }; | 161 }; |
| 162 | 162 |
| 163 } // namespace crashpad | 163 } // namespace crashpad |
| 164 | 164 |
| 165 #endif // CRASHPAD_MINIDUMP_MINIDUMP_MEMORY_WRITER_H_ | 165 #endif // CRASHPAD_MINIDUMP_MINIDUMP_MEMORY_WRITER_H_ |
| OLD | NEW |