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

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

Issue 1964183004: Revert of Move DOMArrayBuffer, DOMArrayBufferViews and DataView to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 DOMArrayBuffer* arrayBuffer = arrayBufferOrView.getAsArrayBuffer(); 14 RefPtr<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 DOMArrayBufferView* arrayBufferView = arrayBufferOrView.getAsArrayBuffer View(); 17 RefPtr<DOMArrayBufferView> arrayBufferView =
18 arrayBufferOrView.getAsArrayBufferView();
18 initWithData(arrayBufferView->baseAddress(), arrayBufferView->byteLength ()); 19 initWithData(arrayBufferView->baseAddress(), arrayBufferView->byteLength ());
19 } else if (arrayBufferOrView.isNull() && option == AllowNullPointToNullWithZ eroSize) { 20 } else if (arrayBufferOrView.isNull() && option == AllowNullPointToNullWithZ eroSize) {
20 initWithData(nullptr, 0); 21 initWithData(nullptr, 0);
21 } // Otherwise, leave the obejct as null. 22 } // Otherwise, leave the obejct as null.
22 } 23 }
23 24
24 } // namespace blink 25 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/DOMArrayBufferView.h ('k') | third_party/WebKit/Source/core/dom/DOMDataView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698