Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(980)

Unified Diff: third_party/WebKit/Source/modules/fetch/BytesConsumer.cpp

Issue 2847543003: Report BytesConsumer::Chunk buffer size to V8 (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(); }
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698