Index: src/snapshot-source-sink.cc |
diff --git a/src/snapshot-source-sink.cc b/src/snapshot-source-sink.cc |
index 9935ff73963c7e157b40b33c3e4c2da6dbe5b380..30b282d3b99870890ef74d4a0c0e147b76f051d0 100644 |
--- a/src/snapshot-source-sink.cc |
+++ b/src/snapshot-source-sink.cc |
@@ -14,9 +14,8 @@ namespace v8 { |
namespace internal { |
-SnapshotByteSource::SnapshotByteSource(const byte* array, int length) |
- : data_(array), length_(length), position_(0) { |
-} |
+SnapshotByteSource::SnapshotByteSource(Vector<const byte> payload) |
+ : data_(payload.start()), length_(payload.length()), position_(0) {} |
SnapshotByteSource::~SnapshotByteSource() { } |
@@ -52,15 +51,17 @@ void SnapshotByteSink::PutInt(uintptr_t integer, const char* description) { |
if (bytes > 3) Put(static_cast<int>((integer >> 24) & 0xff), "IntPart4"); |
} |
-void SnapshotByteSink::PutRaw(byte* data, int number_of_bytes, |
+ |
+void SnapshotByteSink::PutRaw(const byte* data, int number_of_bytes, |
const char* description) { |
- data_.AddAll(Vector<byte>(data, number_of_bytes)); |
+ data_.AddAll(Vector<byte>(const_cast<byte*>(data), number_of_bytes)); |
} |
-void SnapshotByteSink::PutBlob(byte* data, int number_of_bytes, |
+ |
+void SnapshotByteSink::PutBlob(Vector<const byte> blob, |
const char* description) { |
- PutInt(number_of_bytes, description); |
- PutRaw(data, number_of_bytes, description); |
+ PutInt(blob.length(), description); |
+ PutRaw(blob.start(), blob.length(), description); |
} |