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

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

Issue 906233002: Use nullptr instead of 0 in WebAudio (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 years, 10 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
« no previous file with comments | « Source/modules/webaudio/ScriptProcessorNode.cpp ('k') | Source/platform/audio/AudioBus.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 20 matching lines...) Expand all
31 31
32 #include <string.h> 32 #include <string.h>
33 #include "wtf/FastMalloc.h" 33 #include "wtf/FastMalloc.h"
34 #include "wtf/Vector.h" 34 #include "wtf/Vector.h"
35 35
36 namespace blink { 36 namespace blink {
37 37
38 template<typename T> 38 template<typename T>
39 class AudioArray { 39 class AudioArray {
40 public: 40 public:
41 AudioArray() : m_allocation(0), m_alignedData(0), m_size(0) { } 41 AudioArray() : m_allocation(nullptr), m_alignedData(nullptr), m_size(0) { }
42 explicit AudioArray(size_t n) : m_allocation(0), m_alignedData(0), m_size(0) 42 explicit AudioArray(size_t n) : m_allocation(nullptr), m_alignedData(nullptr ), m_size(0)
43 { 43 {
44 allocate(n); 44 allocate(n);
45 } 45 }
46 46
47 ~AudioArray() 47 ~AudioArray()
48 { 48 {
49 fastFree(m_allocation); 49 fastFree(m_allocation);
50 } 50 }
51 51
52 // It's OK to call allocate() multiple times, but data will *not* be copied from an initial allocation 52 // It's OK to call allocate() multiple times, but data will *not* be copied from an initial allocation
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 T* m_alignedData; 153 T* m_alignedData;
154 size_t m_size; 154 size_t m_size;
155 }; 155 };
156 156
157 typedef AudioArray<float> AudioFloatArray; 157 typedef AudioArray<float> AudioFloatArray;
158 typedef AudioArray<double> AudioDoubleArray; 158 typedef AudioArray<double> AudioDoubleArray;
159 159
160 } // namespace blink 160 } // namespace blink
161 161
162 #endif // AudioArray_h 162 #endif // AudioArray_h
OLDNEW
« no previous file with comments | « Source/modules/webaudio/ScriptProcessorNode.cpp ('k') | Source/platform/audio/AudioBus.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698