Index: third_party/crashpad/crashpad/minidump/test/minidump_user_extension_stream_util.cc |
diff --git a/third_party/crashpad/crashpad/minidump/minidump_user_extension_stream_data_source.cc b/third_party/crashpad/crashpad/minidump/test/minidump_user_extension_stream_util.cc |
similarity index 51% |
copy from third_party/crashpad/crashpad/minidump/minidump_user_extension_stream_data_source.cc |
copy to third_party/crashpad/crashpad/minidump/test/minidump_user_extension_stream_util.cc |
index 8056011cf021b0cccafdbcf6286caf9e0f70ed5a..50100822c86a23a27e43e9e7872b435cef44495d 100644 |
--- a/third_party/crashpad/crashpad/minidump/minidump_user_extension_stream_data_source.cc |
+++ b/third_party/crashpad/crashpad/minidump/test/minidump_user_extension_stream_util.cc |
@@ -12,19 +12,32 @@ |
// See the License for the specific language governing permissions and |
// limitations under the License. |
-#include "minidump/minidump_user_extension_stream_data_source.h" |
+#include "minidump/test/minidump_user_extension_stream_util.h" |
+ |
+#include <string.h> |
namespace crashpad { |
+namespace test { |
-MinidumpUserExtensionStreamDataSource::MinidumpUserExtensionStreamDataSource( |
+BufferExtensionStreamDataSource::BufferExtensionStreamDataSource( |
uint32_t stream_type, |
- const void* buffer, |
- size_t buffer_size) |
- : stream_type_(static_cast<MinidumpStreamType>(stream_type)), |
- buffer_(buffer), |
- buffer_size_(buffer_size) {} |
+ const void* data, |
+ size_t data_size) |
+ : MinidumpUserExtensionStreamDataSource(stream_type) { |
+ data_.resize(data_size); |
+ |
+ if (data_size) |
+ memcpy(data_.data(), data, data_size); |
+} |
+ |
+size_t BufferExtensionStreamDataSource::StreamDataSize() { |
+ return data_.size(); |
+} |
-MinidumpUserExtensionStreamDataSource:: |
- ~MinidumpUserExtensionStreamDataSource() {} |
+bool BufferExtensionStreamDataSource::ReadStreamData(Delegate* delegate) { |
+ return delegate->ExtensionStreamDataSourceRead( |
+ data_.size() ? data_.data() : nullptr, data_.size()); |
+} |
+} // namespace test |
} // namespace crashpad |