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

Side by Side Diff: third_party/WebKit/Source/platform/audio/AudioDSPKernelProcessor.cpp

Issue 2470233009: WTF/std normalization: replace WTF::Vector::first() with ::front() (Closed)
Patch Set: rebase Created 4 years 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 ASSERT(!isInitialized()); 119 ASSERT(!isInitialized());
120 if (!isInitialized()) 120 if (!isInitialized())
121 m_numberOfChannels = numberOfChannels; 121 m_numberOfChannels = numberOfChannels;
122 } 122 }
123 123
124 double AudioDSPKernelProcessor::tailTime() const { 124 double AudioDSPKernelProcessor::tailTime() const {
125 ASSERT(!isMainThread()); 125 ASSERT(!isMainThread());
126 MutexTryLocker tryLocker(m_processLock); 126 MutexTryLocker tryLocker(m_processLock);
127 if (tryLocker.locked()) { 127 if (tryLocker.locked()) {
128 // It is expected that all the kernels have the same tailTime. 128 // It is expected that all the kernels have the same tailTime.
129 return !m_kernels.isEmpty() ? m_kernels.first()->tailTime() : 0; 129 return !m_kernels.isEmpty() ? m_kernels.front()->tailTime() : 0;
130 } 130 }
131 // Since we don't want to block the Audio Device thread, we return a large 131 // Since we don't want to block the Audio Device thread, we return a large
132 // value instead of trying to acquire the lock. 132 // value instead of trying to acquire the lock.
133 return std::numeric_limits<double>::infinity(); 133 return std::numeric_limits<double>::infinity();
134 } 134 }
135 135
136 double AudioDSPKernelProcessor::latencyTime() const { 136 double AudioDSPKernelProcessor::latencyTime() const {
137 ASSERT(!isMainThread()); 137 ASSERT(!isMainThread());
138 MutexTryLocker tryLocker(m_processLock); 138 MutexTryLocker tryLocker(m_processLock);
139 if (tryLocker.locked()) { 139 if (tryLocker.locked()) {
140 // It is expected that all the kernels have the same latencyTime. 140 // It is expected that all the kernels have the same latencyTime.
141 return !m_kernels.isEmpty() ? m_kernels.first()->latencyTime() : 0; 141 return !m_kernels.isEmpty() ? m_kernels.front()->latencyTime() : 0;
142 } 142 }
143 // Since we don't want to block the Audio Device thread, we return a large 143 // Since we don't want to block the Audio Device thread, we return a large
144 // value instead of trying to acquire the lock. 144 // value instead of trying to acquire the lock.
145 return std::numeric_limits<double>::infinity(); 145 return std::numeric_limits<double>::infinity();
146 } 146 }
147 147
148 } // namespace blink 148 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698