Chromium Code Reviews| Index: third_party/WebKit/Source/modules/fetch/BytesConsumer.cpp |
| diff --git a/third_party/WebKit/Source/modules/fetch/BytesConsumer.cpp b/third_party/WebKit/Source/modules/fetch/BytesConsumer.cpp |
| index 7bf2ce96295625d00e70aa55c2e33993e8711261..4e8020c6c7c3b0d0b9bb9f930a72ec00e907bc9d 100644 |
| --- a/third_party/WebKit/Source/modules/fetch/BytesConsumer.cpp |
| +++ b/third_party/WebKit/Source/modules/fetch/BytesConsumer.cpp |
| @@ -13,6 +13,7 @@ |
| #include "platform/blob/BlobData.h" |
| #include "platform/wtf/Functional.h" |
| #include "platform/wtf/RefPtr.h" |
| +#include "v8/include/v8.h" |
| namespace blink { |
| @@ -114,6 +115,12 @@ class TeeHelper final : public GarbageCollectedFinalized<TeeHelper>, |
| Chunk(const char* data, size_t size) { |
| buffer_.ReserveInitialCapacity(size); |
| buffer_.Append(data, size); |
| + v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory( |
|
haraken
2017/04/27 09:11:44
Would it be possible to pass in Isolate* to Chunk'
horo
2017/04/27 09:39:32
Please write comment about why we need to call it.
keishi
2017/05/08 07:08:35
Done.
|
| + static_cast<int64_t>(buffer_.size())); |
| + } |
| + ~Chunk() { |
| + v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory( |
| + -static_cast<int64_t>(buffer_.size())); |
| } |
| const char* data() const { return buffer_.data(); } |
| size_t size() const { return buffer_.size(); } |