Commit ba2cd169 authored by jbroman's avatar jbroman Committed by Commit bot

Mark JSArrayBuffer::SetupAllocatingData with WARN_UNUSED_RESULT.

Also update a call in cctest to check the result.

BUG=chromium:681843

Review-Url: https://codereview.chromium.org/2647573003
Cr-Commit-Position: refs/heads/master@{#42513}
parent 7739affa
...@@ -10838,10 +10838,12 @@ class JSArrayBuffer: public JSObject { ...@@ -10838,10 +10838,12 @@ class JSArrayBuffer: public JSObject {
void* data, size_t allocated_length, void* data, size_t allocated_length,
SharedFlag shared = SharedFlag::kNotShared); SharedFlag shared = SharedFlag::kNotShared);
static bool SetupAllocatingData(Handle<JSArrayBuffer> array_buffer, // Returns false if array buffer contents could not be allocated.
Isolate* isolate, size_t allocated_length, // In this case, |array_buffer| will not be set up.
bool initialize = true, static bool SetupAllocatingData(
SharedFlag shared = SharedFlag::kNotShared); Handle<JSArrayBuffer> array_buffer, Isolate* isolate,
size_t allocated_length, bool initialize = true,
SharedFlag shared = SharedFlag::kNotShared) WARN_UNUSED_RESULT;
// Dispatched behavior. // Dispatched behavior.
DECLARE_PRINTER(JSArrayBuffer) DECLARE_PRINTER(JSArrayBuffer)
......
...@@ -115,7 +115,7 @@ UNINITIALIZED_TEST(PagePromotion_NewToNewJSArrayBuffer) { ...@@ -115,7 +115,7 @@ UNINITIALIZED_TEST(PagePromotion_NewToNewJSArrayBuffer) {
// Allocate a buffer we would like to check against. // Allocate a buffer we would like to check against.
Handle<JSArrayBuffer> buffer = Handle<JSArrayBuffer> buffer =
i_isolate->factory()->NewJSArrayBuffer(SharedFlag::kNotShared); i_isolate->factory()->NewJSArrayBuffer(SharedFlag::kNotShared);
JSArrayBuffer::SetupAllocatingData(buffer, i_isolate, 100); CHECK(JSArrayBuffer::SetupAllocatingData(buffer, i_isolate, 100));
std::vector<Handle<FixedArray>> handles; std::vector<Handle<FixedArray>> handles;
// Simulate a full space, filling the interesting page with live objects. // Simulate a full space, filling the interesting page with live objects.
heap::SimulateFullSpace(heap->new_space(), &handles); heap::SimulateFullSpace(heap->new_space(), &handles);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment