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

Side by Side Diff: third_party/WebKit/Source/core/dom/DOMArrayPiece.cpp

Issue 1878463002: Move DOMArrayBuffer, DOMArrayBufferViews and DataView to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tidy Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/dom/DOMArrayPiece.h" 5 #include "core/dom/DOMArrayPiece.h"
6 6
7 #include "bindings/core/v8/UnionTypesCore.h" 7 #include "bindings/core/v8/UnionTypesCore.h"
8 8
9 namespace blink { 9 namespace blink {
10 10
11 DOMArrayPiece::DOMArrayPiece(const ArrayBufferOrArrayBufferView& arrayBufferOrVi ew, InitWithUnionOption option) 11 DOMArrayPiece::DOMArrayPiece(const ArrayBufferOrArrayBufferView& arrayBufferOrVi ew, InitWithUnionOption option)
12 { 12 {
13 if (arrayBufferOrView.isArrayBuffer()) { 13 if (arrayBufferOrView.isArrayBuffer()) {
14 RefPtr<DOMArrayBuffer> arrayBuffer = arrayBufferOrView.getAsArrayBuffer( ); 14 DOMArrayBuffer* arrayBuffer = arrayBufferOrView.getAsArrayBuffer();
15 initWithData(arrayBuffer->data(), arrayBuffer->byteLength()); 15 initWithData(arrayBuffer->data(), arrayBuffer->byteLength());
16 } else if (arrayBufferOrView.isArrayBufferView()) { 16 } else if (arrayBufferOrView.isArrayBufferView()) {
17 RefPtr<DOMArrayBufferView> arrayBufferView = 17 DOMArrayBufferView* arrayBufferView = arrayBufferOrView.getAsArrayBuffer View();
18 arrayBufferOrView.getAsArrayBufferView();
19 initWithData(arrayBufferView->baseAddress(), arrayBufferView->byteLength ()); 18 initWithData(arrayBufferView->baseAddress(), arrayBufferView->byteLength ());
20 } else if (arrayBufferOrView.isNull() && option == AllowNullPointToNullWithZ eroSize) { 19 } else if (arrayBufferOrView.isNull() && option == AllowNullPointToNullWithZ eroSize) {
21 initWithData(nullptr, 0); 20 initWithData(nullptr, 0);
22 } // Otherwise, leave the obejct as null. 21 } // Otherwise, leave the obejct as null.
23 } 22 }
24 23
25 } // namespace blink 24 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698