| Index: Source/wtf/ArrayBufferContents.cpp
|
| diff --git a/Source/wtf/ArrayBufferContents.cpp b/Source/wtf/ArrayBufferContents.cpp
|
| index f6c0c0a76c068b8907f54f41926615fc53555b5d..f62734bf8d5613b43965da9569c91c2f088f751c 100644
|
| --- a/Source/wtf/ArrayBufferContents.cpp
|
| +++ b/Source/wtf/ArrayBufferContents.cpp
|
| @@ -28,6 +28,7 @@
|
| #include "wtf/ArrayBufferContents.h"
|
|
|
| #include "wtf/ArrayBufferDeallocationObserver.h"
|
| +#include <string.h>
|
|
|
| namespace WTF {
|
|
|
| @@ -97,6 +98,17 @@ void ArrayBufferContents::transfer(ArrayBufferContents& other)
|
| clear();
|
| }
|
|
|
| +void ArrayBufferContents::copyTo(ArrayBufferContents& other)
|
| +{
|
| + ASSERT(!other.m_sizeInBytes);
|
| + other.freeMemory(other.m_data);
|
| + allocateMemory(m_sizeInBytes, DontInitialize, other.m_data);
|
| + if (!other.m_data)
|
| + return;
|
| + memcpy(other.m_data, m_data, m_sizeInBytes);
|
| + other.m_sizeInBytes = m_sizeInBytes;
|
| +}
|
| +
|
| bool ArrayBufferContents::allocateMemory(size_t size, InitializationPolicy policy, void*& data)
|
| {
|
| if (policy == ZeroInitialize) {
|
|
|