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

Unified Diff: third_party/WebKit/Source/wtf/ArrayBufferBuilder.h

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
« no previous file with comments | « third_party/WebKit/Source/wtf/ArrayBuffer.cpp ('k') | third_party/WebKit/Source/wtf/ArrayBufferBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/ArrayBufferBuilder.h
diff --git a/third_party/WebKit/Source/wtf/ArrayBufferBuilder.h b/third_party/WebKit/Source/wtf/ArrayBufferBuilder.h
index 38b285a0bf02dbec54bda02d7985b31e80899bda..2a6cf747aa74301a221b280b52c968496df129e7 100644
--- a/third_party/WebKit/Source/wtf/ArrayBufferBuilder.h
+++ b/third_party/WebKit/Source/wtf/ArrayBufferBuilder.h
@@ -53,7 +53,7 @@ public:
: m_bytesUsed(0)
, m_variableCapacity(true)
{
- m_buffer = ArrayBuffer::create(capacity, 1);
+ m_buffer = ArrayBuffer::createOrNull(capacity, 1);
}
bool isValid() const
@@ -82,6 +82,7 @@ public:
// Number of bytes allocated.
unsigned capacity() const
{
+ ASSERT(isValid());
return m_buffer->byteLength();
}
@@ -89,6 +90,7 @@ public:
const void* data() const
{
+ ASSERT(isValid());
return m_buffer->data();
}
« no previous file with comments | « third_party/WebKit/Source/wtf/ArrayBuffer.cpp ('k') | third_party/WebKit/Source/wtf/ArrayBufferBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698