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.cpp

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 | « third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.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) 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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 { 182 {
183 uninitialize(); 183 uninitialize();
184 } 184 }
185 185
186 bool AbstractAudioContext::hasPendingActivity() const 186 bool AbstractAudioContext::hasPendingActivity() const
187 { 187 {
188 // There's no pending activity if the audio context has been cleared. 188 // There's no pending activity if the audio context has been cleared.
189 return !m_isCleared; 189 return !m_isCleared;
190 } 190 }
191 191
192 AudioDestinationNode* AbstractAudioContext::destination() const
193 {
194 // Cannot be called from the audio thread because this method touches object s managed by Oilpan,
195 // and the audio thread is not managed by Oilpan.
196 ASSERT(!isAudioThread());
197 return m_destinationNode.get();
198 }
199
192 void AbstractAudioContext::throwExceptionForClosedState(ExceptionState& exceptio nState) 200 void AbstractAudioContext::throwExceptionForClosedState(ExceptionState& exceptio nState)
193 { 201 {
194 exceptionState.throwDOMException(InvalidStateError, "AudioContext has been c losed."); 202 exceptionState.throwDOMException(InvalidStateError, "AudioContext has been c losed.");
195 } 203 }
196 204
197 AudioBuffer* AbstractAudioContext::createBuffer(unsigned numberOfChannels, size_ t numberOfFrames, float sampleRate, ExceptionState& exceptionState) 205 AudioBuffer* AbstractAudioContext::createBuffer(unsigned numberOfChannels, size_ t numberOfFrames, float sampleRate, ExceptionState& exceptionState)
198 { 206 {
199 // It's ok to call createBuffer, even if the context is closed because the A udioBuffer doesn't 207 // It's ok to call createBuffer, even if the context is closed because the A udioBuffer doesn't
200 // really "belong" to any particular context. 208 // really "belong" to any particular context.
201 209
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after
949 SecurityOrigin* AbstractAudioContext::getSecurityOrigin() const 957 SecurityOrigin* AbstractAudioContext::getSecurityOrigin() const
950 { 958 {
951 if (getExecutionContext()) 959 if (getExecutionContext())
952 return getExecutionContext()->getSecurityOrigin(); 960 return getExecutionContext()->getSecurityOrigin();
953 961
954 return nullptr; 962 return nullptr;
955 } 963 }
956 964
957 } // namespace blink 965 } // namespace blink
958 966
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/webaudio/AbstractAudioContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698