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

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.cpp

Issue 2269543003: Minor cosmetic changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « third_party/WebKit/Source/modules/webaudio/AudioNode.h ('k') | no next file » | 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) 2012, Google Inc. All rights reserved. 2 * Copyright (C) 2012, 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 * 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 if (!audioContext->destination()) { 85 if (!audioContext->destination()) {
86 exceptionState.throwDOMException( 86 exceptionState.throwDOMException(
87 NotSupportedError, 87 NotSupportedError,
88 "OfflineAudioContext(" + String::number(numberOfChannels) 88 "OfflineAudioContext(" + String::number(numberOfChannels)
89 + ", " + String::number(numberOfFrames) 89 + ", " + String::number(numberOfFrames)
90 + ", " + String::number(sampleRate) 90 + ", " + String::number(sampleRate)
91 + ")"); 91 + ")");
92 } 92 }
93 93
94 #if DEBUG_AUDIONODE_REFERENCES 94 #if DEBUG_AUDIONODE_REFERENCES
95 fprintf(stderr, "[%p]: OfflineAudioContext::OfflineAudioContext()\n", audioC ontext); 95 fprintf(stderr, "[%16p]: OfflineAudioContext::OfflineAudioContext()\n", audi oContext);
96 #endif 96 #endif
97 DEFINE_STATIC_LOCAL(SparseHistogram, offlineContextChannelCountHistogram, 97 DEFINE_STATIC_LOCAL(SparseHistogram, offlineContextChannelCountHistogram,
98 ("WebAudio.OfflineAudioContext.ChannelCount")); 98 ("WebAudio.OfflineAudioContext.ChannelCount"));
99 // Arbitrarly limit the maximum length to 1 million frames (about 20 sec 99 // Arbitrarly limit the maximum length to 1 million frames (about 20 sec
100 // at 48kHz). The number of buckets is fairly arbitrary. 100 // at 48kHz). The number of buckets is fairly arbitrary.
101 DEFINE_STATIC_LOCAL(CustomCountHistogram, offlineContextLengthHistogram, 101 DEFINE_STATIC_LOCAL(CustomCountHistogram, offlineContextLengthHistogram,
102 ("WebAudio.OfflineAudioContext.Length", 1, 1000000, 50)); 102 ("WebAudio.OfflineAudioContext.Length", 1, 1000000, 50));
103 // The limits are the min and max AudioBuffer sample rates currently 103 // The limits are the min and max AudioBuffer sample rates currently
104 // supported. We use explicit values here instead of 104 // supported. We use explicit values here instead of
105 // AudioUtilities::minAudioBufferSampleRate() and 105 // AudioUtilities::minAudioBufferSampleRate() and
(...skipping 28 matching lines...) Expand all
134 "failed to create OfflineAudioContext(" + 134 "failed to create OfflineAudioContext(" +
135 String::number(numberOfChannels) + ", " + 135 String::number(numberOfChannels) + ", " +
136 String::number(numberOfFrames) + ", " + 136 String::number(numberOfFrames) + ", " +
137 String::number(sampleRate) + ")")); 137 String::number(sampleRate) + ")"));
138 } 138 }
139 } 139 }
140 140
141 OfflineAudioContext::~OfflineAudioContext() 141 OfflineAudioContext::~OfflineAudioContext()
142 { 142 {
143 #if DEBUG_AUDIONODE_REFERENCES 143 #if DEBUG_AUDIONODE_REFERENCES
144 fprintf(stderr, "[%p]: OfflineAudioContext::~OfflineAudioContext()\n", this) ; 144 fprintf(stderr, "[%16p]: OfflineAudioContext::~OfflineAudioContext()\n", thi s);
145 #endif 145 #endif
146 } 146 }
147 147
148 DEFINE_TRACE(OfflineAudioContext) 148 DEFINE_TRACE(OfflineAudioContext)
149 { 149 {
150 visitor->trace(m_renderTarget); 150 visitor->trace(m_renderTarget);
151 visitor->trace(m_completeResolver); 151 visitor->trace(m_completeResolver);
152 visitor->trace(m_scheduledSuspends); 152 visitor->trace(m_scheduledSuspends);
153 BaseAudioContext::trace(visitor); 153 BaseAudioContext::trace(visitor);
154 } 154 }
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 // Note that the GraphLock is required before this check. Since this needs 441 // Note that the GraphLock is required before this check. Since this needs
442 // to run on the audio thread, OfflineGraphAutoLocker must be used. 442 // to run on the audio thread, OfflineGraphAutoLocker must be used.
443 if (m_scheduledSuspends.contains(currentSampleFrame())) 443 if (m_scheduledSuspends.contains(currentSampleFrame()))
444 return true; 444 return true;
445 445
446 return false; 446 return false;
447 } 447 }
448 448
449 } // namespace blink 449 } // namespace blink
450 450
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/webaudio/AudioNode.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698