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

Unified Diff: webkit/plugins/ppapi/ppb_audio_impl.cc

Issue 6282007: First pass at making the proxy handle multiple renderers. This associates the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/plugins/ppapi/plugin_module.cc ('k') | webkit/plugins/ppapi/ppb_flash_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppb_audio_impl.cc
===================================================================
--- webkit/plugins/ppapi/ppb_audio_impl.cc (revision 71973)
+++ webkit/plugins/ppapi/ppb_audio_impl.cc (working copy)
@@ -49,6 +49,8 @@
uint32_t requested_sample_frame_count) {
// TODO(brettw) Currently we don't actually query to get a value from the
// hardware, so we always return the input for in-range values.
+ //
+ // Danger: this code is duplicated in the audio config proxy.
if (requested_sample_frame_count < PP_AUDIOMINSAMPLEFRAMECOUNT)
return PP_AUDIOMINSAMPLEFRAMECOUNT;
if (requested_sample_frame_count > PP_AUDIOMAXSAMPLEFRAMECOUNT)
@@ -219,8 +221,10 @@
PPB_Audio_Impl::~PPB_Audio_Impl() {
// Calling ShutDown() makes sure StreamCreated cannot be called anymore.
- audio_->ShutDown();
- audio_ = NULL;
+ if (audio_) {
+ audio_->ShutDown();
+ audio_ = NULL;
+ }
// If the completion callback hasn't fired yet, do so here
// with an error condition.
@@ -263,6 +267,8 @@
}
bool PPB_Audio_Impl::StartPlayback() {
+ if (!audio_)
+ return false;
if (playing())
return true;
SetStartPlaybackState();
@@ -270,6 +276,8 @@
}
bool PPB_Audio_Impl::StopPlayback() {
+ if (!audio_)
+ return false;
if (!playing())
return true;
if (!audio_->StopPlayback())
« no previous file with comments | « webkit/plugins/ppapi/plugin_module.cc ('k') | webkit/plugins/ppapi/ppb_flash_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698