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

Unified Diff: src/objects.cc

Issue 2786913004: Add counter for new shared/array buffers that fail to allocate space. (Closed)
Patch Set: Fix merge conflict. Created 3 years, 9 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 | « src/counters.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index e10b4a1edaf454cda22d670cc2dd3411425e47df..2901840af92fbe0b1cd995ba1129a4cb4024befa 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -19485,7 +19485,12 @@ bool JSArrayBuffer::SetupAllocatingData(Handle<JSArrayBuffer> array_buffer,
data = isolate->array_buffer_allocator()->AllocateUninitialized(
allocated_length);
}
- if (data == NULL) return false;
+ if (data == NULL) {
+ isolate->counters()->array_buffer_new_size_failures()->AddSample(
+ sizeof(uint64_t) * kBitsPerByte -
+ base::bits::CountLeadingZeros64(allocated_length));
+ return false;
+ }
} else {
data = NULL;
}
« no previous file with comments | « src/counters.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698