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

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.h

Issue 1899903002: Assert that AudioContext::destination() is not called from the audio thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.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 * 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 bool isDestinationInitialized() const 106 bool isDestinationInitialized() const
107 { 107 {
108 AudioDestinationNode* dest = destination(); 108 AudioDestinationNode* dest = destination();
109 return dest ? dest->audioDestinationHandler().isInitialized() : false; 109 return dest ? dest->audioDestinationHandler().isInitialized() : false;
110 } 110 }
111 111
112 // Document notification 112 // Document notification
113 void stop() final; 113 void stop() final;
114 bool hasPendingActivity() const final; 114 bool hasPendingActivity() const final;
115 115
116 AudioDestinationNode* destination() const { return m_destinationNode.get(); } 116 // Cannnot be called from the audio thread.
117 AudioDestinationNode* destination() const;
117 118
118 size_t currentSampleFrame() const 119 size_t currentSampleFrame() const
119 { 120 {
120 return m_destinationNode ? m_destinationNode->audioDestinationHandler(). currentSampleFrame() : 0; 121 return m_destinationNode ? m_destinationNode->audioDestinationHandler(). currentSampleFrame() : 0;
121 } 122 }
122 123
123 double currentTime() const 124 double currentTime() const
124 { 125 {
125 return m_destinationNode ? m_destinationNode->audioDestinationHandler(). currentTime() : 0; 126 return m_destinationNode ? m_destinationNode->audioDestinationHandler(). currentTime() : 0;
126 } 127 }
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 Member<PeriodicWave> m_periodicWaveTriangle; 348 Member<PeriodicWave> m_periodicWaveTriangle;
348 349
349 // This is considering 32 is large enough for multiple channels audio. 350 // This is considering 32 is large enough for multiple channels audio.
350 // It is somewhat arbitrary and could be increased if necessary. 351 // It is somewhat arbitrary and could be increased if necessary.
351 enum { MaxNumberOfChannels = 32 }; 352 enum { MaxNumberOfChannels = 32 };
352 }; 353 };
353 354
354 } // namespace blink 355 } // namespace blink
355 356
356 #endif // AbstractAudioContext_h 357 #endif // AbstractAudioContext_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698