Chromium Code Reviews| Index: third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp |
| diff --git a/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp b/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp |
| index 0049d6e66d02c98acfbcea0a046416fcee5317d9..600951c14abd411eab16e384ca04cacfe557bb91 100644 |
| --- a/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp |
| +++ b/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp |
| @@ -447,6 +447,13 @@ void SerializedScriptValue:: |
| buffer.unregisterExternalAllocationWithCurrentContext(); |
| m_transferablesNeedExternalAllocationRegistration = true; |
| } |
| + |
| + if (m_imageBitmapContentsArray && |
| + !m_transferablesNeedExternalAllocationRegistration) { |
| + for (auto& buffer : *m_imageBitmapContentsArray) |
| + buffer->unregisterExternalAllocationWithCurrentContext(); |
| + m_transferablesNeedExternalAllocationRegistration = true; |
|
jbroman
2017/04/04 15:44:56
This would need to be fused with the one above. Ot
|
| + } |
| } |
| void SerializedScriptValue::registerMemoryAllocatedWithCurrentScriptContext() { |
| @@ -465,6 +472,12 @@ void SerializedScriptValue::registerMemoryAllocatedWithCurrentScriptContext() { |
| for (auto& buffer : *m_arrayBufferContentsArray) |
| buffer.registerExternalAllocationWithCurrentContext(); |
| } |
| + |
| + if (m_imageBitmapContentsArray && |
| + m_transferablesNeedExternalAllocationRegistration) { |
| + for (auto& buffer : *m_imageBitmapContentsArray) |
| + buffer->registerExternalAllocationWithCurrentContext(); |
| + } |
| } |
| } // namespace blink |