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

Unified Diff: third_party/WebKit/Source/modules/fetch/FetchFormDataConsumerHandleTest.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/modules/fetch/FetchFormDataConsumerHandleTest.cpp
diff --git a/third_party/WebKit/Source/modules/fetch/FetchFormDataConsumerHandleTest.cpp b/third_party/WebKit/Source/modules/fetch/FetchFormDataConsumerHandleTest.cpp
index f97fb0eb9905afc5fd267c271eea067d6c1308ff..23961367d32b7111321ce9fcf85d64e5008ac17b 100644
--- a/third_party/WebKit/Source/modules/fetch/FetchFormDataConsumerHandleTest.cpp
+++ b/third_party/WebKit/Source/modules/fetch/FetchFormDataConsumerHandleTest.cpp
@@ -153,7 +153,7 @@ TEST_F(FetchFormDataConsumerHandleTest, ReadFromStringNonLatin)
TEST_F(FetchFormDataConsumerHandleTest, ReadFromArrayBuffer)
{
const unsigned char data[] = { 0x21, 0xfe, 0x00, 0x00, 0xff, 0xa3, 0x42, 0x30, 0x42, 0x99, 0x88 };
- RefPtr<DOMArrayBuffer> buffer = DOMArrayBuffer::create(data, WTF_ARRAY_LENGTH(data));
+ RefPtr<DOMArrayBuffer> buffer = DOMArrayBuffer::deprecatedCreateOrCrash(data, WTF_ARRAY_LENGTH(data));
OwnPtr<FetchDataConsumerHandle> handle = FetchFormDataConsumerHandle::create(buffer);
HandleReaderRunner<HandleReader> runner(handle.release());
OwnPtr<HandleReadResult> r = runner.wait();
@@ -167,7 +167,7 @@ TEST_F(FetchFormDataConsumerHandleTest, ReadFromArrayBufferView)
{
const unsigned char data[] = { 0x21, 0xfe, 0x00, 0x00, 0xff, 0xa3, 0x42, 0x30, 0x42, 0x99, 0x88 };
const size_t offset = 1, size = 4;
- RefPtr<DOMArrayBuffer> buffer = DOMArrayBuffer::create(data, WTF_ARRAY_LENGTH(data));
+ RefPtr<DOMArrayBuffer> buffer = DOMArrayBuffer::deprecatedCreateOrCrash(data, WTF_ARRAY_LENGTH(data));
OwnPtr<FetchDataConsumerHandle> handle = FetchFormDataConsumerHandle::create(DOMUint8Array::create(buffer, offset, size));
HandleReaderRunner<HandleReader> runner(handle.release());
OwnPtr<HandleReadResult> r = runner.wait();
@@ -251,7 +251,7 @@ TEST_F(FetchFormDataConsumerHandleTest, DrainAsFormDataFromString)
TEST_F(FetchFormDataConsumerHandleTest, DrainAsFormDataFromArrayBuffer)
{
- OwnPtr<FetchDataConsumerHandle> handle = FetchFormDataConsumerHandle::create(DOMArrayBuffer::create("foo", 3));
+ OwnPtr<FetchDataConsumerHandle> handle = FetchFormDataConsumerHandle::create(DOMArrayBuffer::deprecatedCreateOrCrash("foo", 3));
OwnPtr<FetchDataConsumerHandle::Reader> reader = handle->obtainReader(nullptr);
RefPtr<EncodedFormData> formData = reader->drainAsFormData();
ASSERT_TRUE(formData);

Powered by Google App Engine
This is Rietveld 408576698