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

Side by Side Diff: components/copresence/mediums/audio/audio_manager_impl.cc

Issue 691223002: Replacing NULL with nullptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Using EXPECT_THAT Created 6 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/copresence/mediums/audio/audio_manager_impl.h" 5 #include "components/copresence/mediums/audio/audio_manager_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 22 matching lines...) Expand all
33 return token; 33 return token;
34 } 34 }
35 35
36 const int kSampleExpiryTimeMs = 60 * 60 * 1000; // 60 minutes. 36 const int kSampleExpiryTimeMs = 60 * 60 * 1000; // 60 minutes.
37 const int kMaxSamples = 10000; 37 const int kMaxSamples = 10000;
38 38
39 } // namespace 39 } // namespace
40 40
41 // Public methods. 41 // Public methods.
42 42
43 AudioManagerImpl::AudioManagerImpl() : recorder_(NULL) { 43 AudioManagerImpl::AudioManagerImpl() : recorder_(nullptr) {
44 // TODO(rkc): Move all of these into initializer lists once it is allowed. 44 // TODO(rkc): Move all of these into initializer lists once it is allowed.
45 playing_[AUDIBLE] = false; 45 playing_[AUDIBLE] = false;
46 playing_[INAUDIBLE] = false; 46 playing_[INAUDIBLE] = false;
47 recording_[AUDIBLE] = false; 47 recording_[AUDIBLE] = false;
48 recording_[INAUDIBLE] = false; 48 recording_[INAUDIBLE] = false;
49 49
50 player_[AUDIBLE] = NULL; 50 player_[AUDIBLE] = nullptr;
51 player_[INAUDIBLE] = NULL; 51 player_[INAUDIBLE] = nullptr;
52 } 52 }
53 53
54 void AudioManagerImpl::Initialize(const DecodeSamplesCallback& decode_cb, 54 void AudioManagerImpl::Initialize(const DecodeSamplesCallback& decode_cb,
55 const EncodeTokenCallback& encode_cb) { 55 const EncodeTokenCallback& encode_cb) {
56 samples_cache_.resize(2); 56 samples_cache_.resize(2);
57 samples_cache_[AUDIBLE] = new SamplesMap( 57 samples_cache_[AUDIBLE] = new SamplesMap(
58 base::TimeDelta::FromMilliseconds(kSampleExpiryTimeMs), kMaxSamples); 58 base::TimeDelta::FromMilliseconds(kSampleExpiryTimeMs), kMaxSamples);
59 samples_cache_[INAUDIBLE] = new SamplesMap( 59 samples_cache_[INAUDIBLE] = new SamplesMap(
60 base::TimeDelta::FromMilliseconds(kSampleExpiryTimeMs), kMaxSamples); 60 base::TimeDelta::FromMilliseconds(kSampleExpiryTimeMs), kMaxSamples);
61 61
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 decode_type = BOTH; 184 decode_type = BOTH;
185 else if (recording_[AUDIBLE]) 185 else if (recording_[AUDIBLE])
186 decode_type = AUDIBLE; 186 decode_type = AUDIBLE;
187 else if (recording_[INAUDIBLE]) 187 else if (recording_[INAUDIBLE])
188 decode_type = INAUDIBLE; 188 decode_type = INAUDIBLE;
189 189
190 decode_cb_.Run(decode_type, samples); 190 decode_cb_.Run(decode_type, samples);
191 } 191 }
192 192
193 } // namespace copresence 193 } // namespace copresence
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698