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

Side by Side Diff: third_party/WebKit/Source/wtf/ArrayBufferView.cpp

Issue 1436153002: Apply clang-format with Chromium-style without column limit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 13 matching lines...) Expand all
24 */ 24 */
25 25
26 #include "config.h" 26 #include "config.h"
27 #include "ArrayBufferView.h" 27 #include "ArrayBufferView.h"
28 28
29 #include "ArrayBuffer.h" 29 #include "ArrayBuffer.h"
30 30
31 namespace WTF { 31 namespace WTF {
32 32
33 ArrayBufferView::ArrayBufferView(PassRefPtr<ArrayBuffer> buffer, unsigned byteOf fset) 33 ArrayBufferView::ArrayBufferView(PassRefPtr<ArrayBuffer> buffer, unsigned byteOf fset)
34 : m_byteOffset(byteOffset) 34 : m_byteOffset(byteOffset), m_isNeuterable(true), m_buffer(buffer), m_prevVi ew(nullptr), m_nextView(nullptr) {
35 , m_isNeuterable(true) 35 m_baseAddress = m_buffer ? (static_cast<char*>(m_buffer->data()) + m_byteOffse t) : nullptr;
36 , m_buffer(buffer) 36 if (m_buffer)
37 , m_prevView(nullptr) 37 m_buffer->addView(this);
38 , m_nextView(nullptr)
39 {
40 m_baseAddress = m_buffer ? (static_cast<char*>(m_buffer->data()) + m_byteOff set) : nullptr;
41 if (m_buffer)
42 m_buffer->addView(this);
43 } 38 }
44 39
45 ArrayBufferView::~ArrayBufferView() 40 ArrayBufferView::~ArrayBufferView() {
46 { 41 if (m_buffer)
47 if (m_buffer) 42 m_buffer->removeView(this);
48 m_buffer->removeView(this);
49 } 43 }
50 44
51 void ArrayBufferView::neuter() 45 void ArrayBufferView::neuter() {
52 { 46 m_buffer = nullptr;
53 m_buffer = nullptr; 47 m_byteOffset = 0;
54 m_byteOffset = 0;
55 } 48 }
56 49
57 const char* ArrayBufferView::typeName() 50 const char* ArrayBufferView::typeName() {
58 { 51 switch (type()) {
59 switch (type()) {
60 case TypeInt8: 52 case TypeInt8:
61 return "Int8"; 53 return "Int8";
62 break; 54 break;
63 case TypeUint8: 55 case TypeUint8:
64 return "UInt8"; 56 return "UInt8";
65 break; 57 break;
66 case TypeUint8Clamped: 58 case TypeUint8Clamped:
67 return "UInt8Clamped"; 59 return "UInt8Clamped";
68 break; 60 break;
69 case TypeInt16: 61 case TypeInt16:
70 return "Int16"; 62 return "Int16";
71 break; 63 break;
72 case TypeUint16: 64 case TypeUint16:
73 return "UInt16"; 65 return "UInt16";
74 break; 66 break;
75 case TypeInt32: 67 case TypeInt32:
76 return "Int32"; 68 return "Int32";
77 break; 69 break;
78 case TypeUint32: 70 case TypeUint32:
79 return "Uint32"; 71 return "Uint32";
80 break; 72 break;
81 case TypeFloat32: 73 case TypeFloat32:
82 return "Float32"; 74 return "Float32";
83 break; 75 break;
84 case TypeFloat64: 76 case TypeFloat64:
85 return "Float64"; 77 return "Float64";
86 break; 78 break;
87 case TypeDataView: 79 case TypeDataView:
88 return "DataView"; 80 return "DataView";
89 break; 81 break;
90 } 82 }
91 ASSERT_NOT_REACHED(); 83 ASSERT_NOT_REACHED();
92 return "Unknown"; 84 return "Unknown";
93 } 85 }
94
95 } 86 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/ArrayBufferView.h ('k') | third_party/WebKit/Source/wtf/ArrayPiece.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698