Chromium Code Reviews| Index: src/snapshot/serializer-common.h |
| diff --git a/src/snapshot/serializer-common.h b/src/snapshot/serializer-common.h |
| index 02f97628b5a080b9e7683744b20b24b421127afe..c357df8743e426504d3730d96c447c92336dd929 100644 |
| --- a/src/snapshot/serializer-common.h |
| +++ b/src/snapshot/serializer-common.h |
| @@ -239,11 +239,19 @@ class SerializedData { |
| SerializedData(byte* data, int size) |
| : data_(data), size_(size), owns_data_(false) {} |
| SerializedData() : data_(NULL), size_(0), owns_data_(false) {} |
| + SerializedData(SerializedData&& other) |
| + : data_(other.data_), size_(other.size_), owns_data_(other.owns_data_) { |
| + // Ensure |other| will not attempt to destroy our data in destructor. |
| + other.owns_data_ = false; |
| + } |
| ~SerializedData() { |
| if (owns_data_) DeleteArray<byte>(data_); |
| } |
| + SerializedData(const SerializedData&) = delete; |
| + const SerializedData& operator=(const SerializedData&) = delete; |
| + |
|
Yang
2017/03/29 17:06:59
We have a macro called DISALLOW_COPY_AND_ASSIGN or
Slava Chigrin
2017/03/30 09:40:06
Done. Thanks - didn't notice that V8 also have thi
|
| uint32_t GetMagicNumber() const { return GetHeaderValue(kMagicNumberOffset); } |
| uint32_t GetExtraReferences() const { |
| return GetHeaderValue(kExtraExternalReferencesOffset); |