| OLD | NEW |
| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 exception_state.ThrowDOMException( | 97 exception_state.ThrowDOMException( |
| 98 kNotSupportedError, "OfflineAudioContext(" + | 98 kNotSupportedError, "OfflineAudioContext(" + |
| 99 String::Number(number_of_channels) + ", " + | 99 String::Number(number_of_channels) + ", " + |
| 100 String::Number(number_of_frames) + ", " + | 100 String::Number(number_of_frames) + ", " + |
| 101 String::Number(sample_rate) + ")"); | 101 String::Number(sample_rate) + ")"); |
| 102 return nullptr; | 102 return nullptr; |
| 103 } | 103 } |
| 104 | 104 |
| 105 #if DEBUG_AUDIONODE_REFERENCES | 105 #if DEBUG_AUDIONODE_REFERENCES |
| 106 fprintf(stderr, "[%16p]: OfflineAudioContext::OfflineAudioContext()\n", | 106 fprintf(stderr, "[%16p]: OfflineAudioContext::OfflineAudioContext()\n", |
| 107 audioContext); | 107 audio_context); |
| 108 #endif | 108 #endif |
| 109 DEFINE_STATIC_LOCAL(SparseHistogram, offline_context_channel_count_histogram, | 109 DEFINE_STATIC_LOCAL(SparseHistogram, offline_context_channel_count_histogram, |
| 110 ("WebAudio.OfflineAudioContext.ChannelCount")); | 110 ("WebAudio.OfflineAudioContext.ChannelCount")); |
| 111 // Arbitrarly limit the maximum length to 1 million frames (about 20 sec | 111 // Arbitrarly limit the maximum length to 1 million frames (about 20 sec |
| 112 // at 48kHz). The number of buckets is fairly arbitrary. | 112 // at 48kHz). The number of buckets is fairly arbitrary. |
| 113 DEFINE_STATIC_LOCAL(CustomCountHistogram, offline_context_length_histogram, | 113 DEFINE_STATIC_LOCAL(CustomCountHistogram, offline_context_length_histogram, |
| 114 ("WebAudio.OfflineAudioContext.Length", 1, 1000000, 50)); | 114 ("WebAudio.OfflineAudioContext.Length", 1, 1000000, 50)); |
| 115 // The limits are the min and max AudioBuffer sample rates currently | 115 // The limits are the min and max AudioBuffer sample rates currently |
| 116 // supported. We use explicit values here instead of | 116 // supported. We use explicit values here instead of |
| 117 // AudioUtilities::minAudioBufferSampleRate() and | 117 // AudioUtilities::minAudioBufferSampleRate() and |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 | 452 |
| 453 // Note that the GraphLock is required before this check. Since this needs | 453 // Note that the GraphLock is required before this check. Since this needs |
| 454 // to run on the audio thread, OfflineGraphAutoLocker must be used. | 454 // to run on the audio thread, OfflineGraphAutoLocker must be used. |
| 455 if (scheduled_suspends_.Contains(CurrentSampleFrame())) | 455 if (scheduled_suspends_.Contains(CurrentSampleFrame())) |
| 456 return true; | 456 return true; |
| 457 | 457 |
| 458 return false; | 458 return false; |
| 459 } | 459 } |
| 460 | 460 |
| 461 } // namespace blink | 461 } // namespace blink |
| OLD | NEW |