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

Side by Side Diff: third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp

Issue 2530323002: Replace boolean return value SharedBuffer::getAsBytes with DCHECK (Closed)
Patch Set: Created 4 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2005-2007 Alexey Proskuryakov <ap@webkit.org> 3 * Copyright (C) 2005-2007 Alexey Proskuryakov <ap@webkit.org>
4 * Copyright (C) 2007, 2008 Julien Chaffraix <jchaffraix@webkit.org> 4 * Copyright (C) 2007, 2008 Julien Chaffraix <jchaffraix@webkit.org>
5 * Copyright (C) 2008, 2011 Google Inc. All rights reserved. 5 * Copyright (C) 2008, 2011 Google Inc. All rights reserved.
6 * Copyright (C) 2012 Intel Corporation 6 * Copyright (C) 2012 Intel Corporation
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public 9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 384
385 if (!m_responseArrayBuffer) { 385 if (!m_responseArrayBuffer) {
386 if (m_binaryResponseBuilder && m_binaryResponseBuilder->size()) { 386 if (m_binaryResponseBuilder && m_binaryResponseBuilder->size()) {
387 DOMArrayBuffer* buffer = DOMArrayBuffer::createUninitialized( 387 DOMArrayBuffer* buffer = DOMArrayBuffer::createUninitialized(
388 m_binaryResponseBuilder->size(), 1); 388 m_binaryResponseBuilder->size(), 1);
389 if (!m_binaryResponseBuilder->getAsBytes( 389 if (!m_binaryResponseBuilder->getAsBytes(
390 buffer->data(), static_cast<size_t>(buffer->byteLength()))) { 390 buffer->data(), static_cast<size_t>(buffer->byteLength()))) {
391 // m_binaryResponseBuilder failed to allocate an ArrayBuffer. 391 // m_binaryResponseBuilder failed to allocate an ArrayBuffer.
392 // We need to crash the renderer since there's no way defined in 392 // We need to crash the renderer since there's no way defined in
393 // the spec to tell this to the user. 393 // the spec to tell this to the user.
394 CRASH(); 394 OOM_CRASH();
tyoshino (SeeGerritForStatus) 2016/11/28 05:29:33 This comment was correct when it was written. But
395 } 395 }
396 m_responseArrayBuffer = buffer; 396 m_responseArrayBuffer = buffer;
397 m_binaryResponseBuilder.clear(); 397 m_binaryResponseBuilder.clear();
398 } else { 398 } else {
399 m_responseArrayBuffer = DOMArrayBuffer::create(nullptr, 0); 399 m_responseArrayBuffer = DOMArrayBuffer::create(nullptr, 0);
400 } 400 }
401 } 401 }
402 402
403 return m_responseArrayBuffer.get(); 403 return m_responseArrayBuffer.get();
404 } 404 }
(...skipping 1446 matching lines...) Expand 10 before | Expand all | Expand 10 after
1851 visitor->traceWrappers(m_responseDocument); 1851 visitor->traceWrappers(m_responseDocument);
1852 visitor->traceWrappers(m_responseArrayBuffer); 1852 visitor->traceWrappers(m_responseArrayBuffer);
1853 XMLHttpRequestEventTarget::traceWrappers(visitor); 1853 XMLHttpRequestEventTarget::traceWrappers(visitor);
1854 } 1854 }
1855 1855
1856 std::ostream& operator<<(std::ostream& ostream, const XMLHttpRequest* xhr) { 1856 std::ostream& operator<<(std::ostream& ostream, const XMLHttpRequest* xhr) {
1857 return ostream << "XMLHttpRequest " << static_cast<const void*>(xhr); 1857 return ostream << "XMLHttpRequest " << static_cast<const void*>(xhr);
1858 } 1858 }
1859 1859
1860 } // namespace blink 1860 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698