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 21 matching lines...) Expand all Loading... |
32 //! data is read, it will be passed to a delegate method. | 32 //! data is read, it will be passed to a delegate method. |
33 class Delegate { | 33 class Delegate { |
34 public: | 34 public: |
35 virtual ~Delegate() {} | 35 virtual ~Delegate() {} |
36 | 36 |
37 //! \brief Called by MemorySnapshot::Read() to provide data requested by a | 37 //! \brief Called by MemorySnapshot::Read() to provide data requested by a |
38 //! call to that method. | 38 //! call to that method. |
39 //! | 39 //! |
40 //! \param[in] data A pointer to the data that was read. The callee does not | 40 //! \param[in] data A pointer to the data that was read. The callee does not |
41 //! take ownership of this data. This data is only valid for the | 41 //! take ownership of this data. This data is only valid for the |
42 //! duration of the call to this method. | 42 //! duration of the call to this method. This parameter may be `nullptr` |
| 43 //! if \a size is `0`. |
43 //! \param[in] size The size of the data that was read. | 44 //! \param[in] size The size of the data that was read. |
44 //! | 45 //! |
45 //! \return `true` on success, `false` on failure. MemoryDelegate::Read() | 46 //! \return `true` on success, `false` on failure. MemoryDelegate::Read() |
46 //! will use this as its own return value. | 47 //! will use this as its own return value. |
47 virtual bool MemorySnapshotDelegateRead(void* data, size_t size) = 0; | 48 virtual bool MemorySnapshotDelegateRead(void* data, size_t size) = 0; |
48 }; | 49 }; |
49 | 50 |
50 virtual ~MemorySnapshot() {} | 51 virtual ~MemorySnapshot() {} |
51 | 52 |
52 //! \brief The base address of the memory snapshot in the snapshot process’ | 53 //! \brief The base address of the memory snapshot in the snapshot process’ |
(...skipping 14 matching lines...) Expand all Loading... |
67 //! | 68 //! |
68 //! \return `false` on failure, otherwise, the return value of | 69 //! \return `false` on failure, otherwise, the return value of |
69 //! Delegate::MemorySnapshotDelegateRead(), which should be `true` on | 70 //! Delegate::MemorySnapshotDelegateRead(), which should be `true` on |
70 //! success and `false` on failure. | 71 //! success and `false` on failure. |
71 virtual bool Read(Delegate* delegate) const = 0; | 72 virtual bool Read(Delegate* delegate) const = 0; |
72 }; | 73 }; |
73 | 74 |
74 } // namespace crashpad | 75 } // namespace crashpad |
75 | 76 |
76 #endif // CRASHPAD_SNAPSHOT_MEMORY_SNAPSHOT_H_ | 77 #endif // CRASHPAD_SNAPSHOT_MEMORY_SNAPSHOT_H_ |
OLD | NEW |