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

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

Issue 1961883002: Generate separate files for union type containers (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/ArrayBufferOrArrayBufferView.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 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 DOMArrayBufferView* arrayBufferView = arrayBufferOrView.getAsArrayBuffer View();
18 initWithData(arrayBufferView->baseAddress(), arrayBufferView->byteLength ()); 18 initWithData(arrayBufferView->baseAddress(), arrayBufferView->byteLength ());
19 } else if (arrayBufferOrView.isNull() && option == AllowNullPointToNullWithZ eroSize) { 19 } else if (arrayBufferOrView.isNull() && option == AllowNullPointToNullWithZ eroSize) {
20 initWithData(nullptr, 0); 20 initWithData(nullptr, 0);
21 } // Otherwise, leave the obejct as null. 21 } // Otherwise, leave the obejct as null.
22 } 22 }
23 23
24 } // namespace blink 24 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698