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

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+more tweaks Created 5 years, 1 month 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..557823eb2a231adefc52612371b58fce71e13358 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp
@@ -352,14 +352,20 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
void* Allocate(size_t size) override
{
void* data;
- WTF::ArrayBufferContents::allocateMemory(size, WTF::ArrayBufferContents::ZeroInitialize, data);
+ // TODO(junov): crbug.com/536816
+ // Use AllocateMemoryOrNull. Requires verification that all
+ // 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);
+ // TODO(junov): crbug.com/536816
+ // 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