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

Side by Side Diff: Source/modules/webaudio/MediaElementAudioSourceNode.cpp

Issue 1181773005: Verify executionContext() exists before trying to print message. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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) 2011, Google Inc. All rights reserved. 2 * Copyright (C) 2011, 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 m_multiChannelResampler->process(provider, outputBus, numberOfFr ames); 168 m_multiChannelResampler->process(provider, outputBus, numberOfFr ames);
169 } else { 169 } else {
170 // Bypass the resampler completely if the source is at the conte xt's sample-rate. 170 // Bypass the resampler completely if the source is at the conte xt's sample-rate.
171 ASSERT(m_sourceSampleRate == sampleRate()); 171 ASSERT(m_sourceSampleRate == sampleRate());
172 provider->provideInput(outputBus, numberOfFrames); 172 provider->provideInput(outputBus, numberOfFrames);
173 } 173 }
174 // Output silence if we don't have access to the element. 174 // Output silence if we don't have access to the element.
175 if (!passesCORSAccessCheck()) { 175 if (!passesCORSAccessCheck()) {
176 if (m_maybePrintCORSMessage) { 176 if (m_maybePrintCORSMessage) {
177 // Print a CORS message, but just once for each change in th e current media 177 // Print a CORS message, but just once for each change in th e current media
178 // element source. 178 // element source, and only if we have a document to print t o.
179 m_maybePrintCORSMessage = false; 179 m_maybePrintCORSMessage = false;
180 context()->executionContext()->postTask(FROM_HERE, 180 if (context()->executionContext()) {
181 createCrossThreadTask(&MediaElementAudioSourceHandler::p rintCORSMessage, 181 context()->executionContext()->postTask(FROM_HERE,
182 this, 182 createCrossThreadTask(&MediaElementAudioSourceHandle r::printCORSMessage,
183 m_currentSrcString)); 183 this,
184 m_currentSrcString));
185 }
184 } 186 }
185 outputBus->zero(); 187 outputBus->zero();
186 } 188 }
187 } else { 189 } else {
188 // Either this port doesn't yet support HTMLMediaElement audio strea m access, 190 // Either this port doesn't yet support HTMLMediaElement audio strea m access,
189 // or the stream is not yet available. 191 // or the stream is not yet available.
190 outputBus->zero(); 192 outputBus->zero();
191 } 193 }
192 } else { 194 } else {
193 // We failed to acquire the lock. 195 // We failed to acquire the lock.
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 } 252 }
251 253
252 void MediaElementAudioSourceNode::unlock() 254 void MediaElementAudioSourceNode::unlock()
253 { 255 {
254 mediaElementAudioSourceHandler().unlock(); 256 mediaElementAudioSourceHandler().unlock();
255 } 257 }
256 258
257 } // namespace blink 259 } // namespace blink
258 260
259 #endif // ENABLE(WEB_AUDIO) 261 #endif // ENABLE(WEB_AUDIO)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698