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

Side by Side Diff: Source/WebCore/webaudio/AudioContext.cpp

Issue 7947001: Merge 94608 - MediaElementAudioSourceNode destruction triggers ASSERTS (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/874/
Patch Set: Created 9 years, 3 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 | « Source/WebCore/webaudio/AudioContext.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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 250
251 bool AudioContext::isRunnable() const 251 bool AudioContext::isRunnable() const
252 { 252 {
253 if (!isInitialized()) 253 if (!isInitialized())
254 return false; 254 return false;
255 255
256 // Check with the HRTF spatialization system to see if it's finished loading . 256 // Check with the HRTF spatialization system to see if it's finished loading .
257 return m_hrtfDatabaseLoader->isLoaded(); 257 return m_hrtfDatabaseLoader->isLoaded();
258 } 258 }
259 259
260 void AudioContext::uninitializeDispatch(void* userData)
261 {
262 AudioContext* context = reinterpret_cast<AudioContext*>(userData);
263 ASSERT(context);
264 if (!context)
265 return;
266
267 context->uninitialize();
268 }
269
260 void AudioContext::stop() 270 void AudioContext::stop()
261 { 271 {
262 m_document = 0; // document is going away 272 m_document = 0; // document is going away
263 uninitialize(); 273
274 // Don't call uninitialize() immediately here because the ScriptExecutionCon text is in the middle
275 // of dealing with all of its ActiveDOMObjects at this point. uninitialize() can de-reference other
276 // ActiveDOMObjects so let's schedule uninitialize() to be called later.
277 // FIXME: see if there's a more direct way to handle this issue.
278 callOnMainThread(uninitializeDispatch, this);
264 } 279 }
265 280
266 Document* AudioContext::document() const 281 Document* AudioContext::document() const
267 { 282 {
268 ASSERT(m_document); 283 ASSERT(m_document);
269 return m_document; 284 return m_document;
270 } 285 }
271 286
272 bool AudioContext::hasDocument() 287 bool AudioContext::hasDocument()
273 { 288 {
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 // Avoid firing the event if the document has already gone away. 762 // Avoid firing the event if the document has already gone away.
748 if (hasDocument()) { 763 if (hasDocument()) {
749 // Call the offline rendering completion event listener. 764 // Call the offline rendering completion event listener.
750 dispatchEvent(OfflineAudioCompletionEvent::create(renderedBuffer)); 765 dispatchEvent(OfflineAudioCompletionEvent::create(renderedBuffer));
751 } 766 }
752 } 767 }
753 768
754 } // namespace WebCore 769 } // namespace WebCore
755 770
756 #endif // ENABLE(WEB_AUDIO) 771 #endif // ENABLE(WEB_AUDIO)
OLDNEW
« no previous file with comments | « Source/WebCore/webaudio/AudioContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698