Index: third_party/WebKit/Source/core/fetch/ImageResource.cpp |
diff --git a/third_party/WebKit/Source/core/fetch/ImageResource.cpp b/third_party/WebKit/Source/core/fetch/ImageResource.cpp |
index 36553ba304f6d24fecebb4fe0764a0c8ebe326d5..3f59e1e8b5c788afcf1c68384e287987b1d74544 100644 |
--- a/third_party/WebKit/Source/core/fetch/ImageResource.cpp |
+++ b/third_party/WebKit/Source/core/fetch/ImageResource.cpp |
@@ -40,6 +40,7 @@ |
#include "wtf/CurrentTime.h" |
#include "wtf/StdLibExtras.h" |
#include <memory> |
+#include <v8/include/v8.h> |
haraken
2016/08/12 07:05:09
We normally include <v8.h>
keishi
2016/08/15 08:57:01
Done.
|
namespace blink { |
@@ -247,6 +248,7 @@ PassRefPtr<SharedBuffer> ImageResource::resourceBuffer() const |
void ImageResource::appendData(const char* data, size_t length) |
{ |
+ v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(length); |
if (m_multipartParser) { |
m_multipartParser->appendData(data, length); |
} else { |
@@ -369,6 +371,8 @@ inline void ImageResource::clearImage() |
{ |
if (!m_image) |
return; |
+ size_t length = m_image->data() ? m_image->data()->size() : 0; |
+ v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(-length); |
// If our Image has an observer, it's always us so we need to clear the back pointer |
// before dropping our reference. |