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

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

Issue 1577783004: [v8] don't crash when ArrayBuffer allocation fails (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a solution which doesn't modify behaviour of existing code, apart from JS TypedArrays Created 4 years, 11 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 60a08f45f17fb57d0187a7c66cb405651f2c4aff..ef312a464381e2c483c643274e13af9b9b44c645 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp
@@ -332,14 +332,14 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
void* Allocate(size_t size) override
{
void* data;
- WTF::ArrayBufferContents::allocateMemory(size, WTF::ArrayBufferContents::ZeroInitialize, data);
+ WTF::ArrayBufferContents::allocateMemoryOrNull(size, WTF::ArrayBufferContents::ZeroInitialize, data);
haraken 2016/01/14 01:52:33 I'm a bit confused. If you call allocateMemoryOrNu
caitp (gmail) 2016/01/14 01:59:04 The ArrayBufferAllocator is used (only) by v8, whi
haraken 2016/01/14 02:17:31 Thanks, makes sense. Can you add a comment about i
return data;
}
void* AllocateUninitialized(size_t size) override
{
void* data;
- WTF::ArrayBufferContents::allocateMemory(size, WTF::ArrayBufferContents::DontInitialize, data);
+ WTF::ArrayBufferContents::allocateMemoryOrNull(size, WTF::ArrayBufferContents::DontInitialize, data);
return data;
}

Powered by Google App Engine
This is Rietveld 408576698