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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp

Issue 1414553002: Fix out-of-memory crashes related to ArrayBuffer allocation Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase and applied senorblanco+haraken feedbac Created 5 years, 2 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
Index: third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp b/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp
index cb060a3914b2c4af8aacaff84e39b6b6390de629..a0e3a72664208c1a0ab38ddbef6d3dbe962c52f6 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp
@@ -352,14 +352,18 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
void* Allocate(size_t size) override
{
void* data;
- WTF::ArrayBufferContents::allocateMemory(size, WTF::ArrayBufferContents::ZeroInitialize, data);
+ // FIXME: Use AllocateMemoryOrNull. Requires verification that all
haraken 2015/10/29 18:58:37 Blink now uses TODO. Update all FIXMEs in this CL
Justin Novosad 2015/11/05 00:17:52 Done.
+ // call sites can handle allocation failures (nullptr) gracefully.
+ WTF::ArrayBufferContents::deprecatedAllocateMemoryOrCrash(size, WTF::ArrayBufferContents::ZeroInitialize, data);
return data;
}
void* AllocateUninitialized(size_t size) override
{
void* data;
- WTF::ArrayBufferContents::allocateMemory(size, WTF::ArrayBufferContents::DontInitialize, data);
+ // FIXME: Use AllocateMemoryOrNull. Requires verification that all
+ // call sites can handle allocation failures (nullptr) gracefully.
+ WTF::ArrayBufferContents::deprecatedAllocateMemoryOrCrash(size, WTF::ArrayBufferContents::DontInitialize, data);
return data;
}

Powered by Google App Engine
This is Rietveld 408576698