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

Unified Diff: Source/wtf/ArrayBufferContents.cpp

Issue 1302193002: Set ArrayBufferContents size to 0 on allocation failure (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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 | « Source/wtf/ArrayBuffer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/ArrayBufferContents.cpp
diff --git a/Source/wtf/ArrayBufferContents.cpp b/Source/wtf/ArrayBufferContents.cpp
index 2e08a1afa2c2f6e337b176ed37afed8f71f4bfa7..1ac56fe8dedd38a4faaff4b28ff6ae301a2f54dc 100644
--- a/Source/wtf/ArrayBufferContents.cpp
+++ b/Source/wtf/ArrayBufferContents.cpp
@@ -134,7 +134,7 @@ void ArrayBufferContents::DataHolder::allocateNew(unsigned sizeInBytes, SharingT
void* data = nullptr;
allocateMemory(sizeInBytes, policy, data);
m_data = data;
- m_sizeInBytes = sizeInBytes;
+ m_sizeInBytes = data ? sizeInBytes : 0;
m_isShared = isShared;
}
« no previous file with comments | « Source/wtf/ArrayBuffer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698