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

Side by Side Diff: third_party/WebKit/Source/platform/audio/AudioArray.h

Issue 2458003002: Remove ASSERT_WITH_SECURITY_IMPLICATION. (Closed)
Patch Set: Minor formatting fix Created 4 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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google 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 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 } 102 }
103 } 103 }
104 104
105 T* data() { return m_alignedData; } 105 T* data() { return m_alignedData; }
106 const T* data() const { return m_alignedData; } 106 const T* data() const { return m_alignedData; }
107 size_t size() const { return m_size; } 107 size_t size() const { return m_size; }
108 108
109 T& at(size_t i) { 109 T& at(size_t i) {
110 // Note that although it is a size_t, m_size is now guaranteed to be 110 // Note that although it is a size_t, m_size is now guaranteed to be
111 // no greater than max unsigned. This guarantee is enforced in allocate(). 111 // no greater than max unsigned. This guarantee is enforced in allocate().
112 ASSERT_WITH_SECURITY_IMPLICATION(i < size()); 112 SECURITY_DCHECK(i < size());
113 return data()[i]; 113 return data()[i];
114 } 114 }
115 115
116 T& operator[](size_t i) { return at(i); } 116 T& operator[](size_t i) { return at(i); }
117 117
118 void zero() { 118 void zero() {
119 // This multiplication is made safe by the check in allocate(). 119 // This multiplication is made safe by the check in allocate().
120 memset(this->data(), 0, sizeof(T) * this->size()); 120 memset(this->data(), 0, sizeof(T) * this->size());
121 } 121 }
122 122
(...skipping 29 matching lines...) Expand all
152 T* m_alignedData; 152 T* m_alignedData;
153 size_t m_size; 153 size_t m_size;
154 }; 154 };
155 155
156 typedef AudioArray<float> AudioFloatArray; 156 typedef AudioArray<float> AudioFloatArray;
157 typedef AudioArray<double> AudioDoubleArray; 157 typedef AudioArray<double> AudioDoubleArray;
158 158
159 } // namespace blink 159 } // namespace blink
160 160
161 #endif // AudioArray_h 161 #endif // AudioArray_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/SharedBufferChunkReader.cpp ('k') | third_party/WebKit/Source/platform/audio/AudioFIFO.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698