diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-02 17:46:24 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-02 17:46:24 +0000 |
commit | 37f4a67b9b5f017b24ccec263c384d7ff1e1a387 (patch) | |
tree | 568ce3e2bab3544375e9c79020b52fb217c09132 /webkit/glue/plugins | |
parent | 5d84d01d904a2e5fa3e17b8d9165e63a20351160 (diff) | |
download | chromium_src-37f4a67b9b5f017b24ccec263c384d7ff1e1a387.zip chromium_src-37f4a67b9b5f017b24ccec263c384d7ff1e1a387.tar.gz chromium_src-37f4a67b9b5f017b24ccec263c384d7ff1e1a387.tar.bz2 |
Fix a race condition in proxied audio.
TEST=proxied audio works (manual test)
BUG=none
Review URL: http://codereview.chromium.org/5522003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68027 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/plugins')
-rw-r--r-- | webkit/glue/plugins/pepper_audio.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/webkit/glue/plugins/pepper_audio.cc b/webkit/glue/plugins/pepper_audio.cc index d18dbae..dc98415 100644 --- a/webkit/glue/plugins/pepper_audio.cc +++ b/webkit/glue/plugins/pepper_audio.cc @@ -336,10 +336,13 @@ void Audio::StreamCreated(base::SharedMemoryHandle shared_memory_handle, PP_RunCompletionCallback(&create_callback_, 0); create_callback_pending_ = false; - // Close the handles now that this process is done with them. - shared_memory_for_create_callback_.reset(); - shared_memory_size_for_create_callback_ = 0; - socket_for_create_callback_.reset(); + // It might be nice to close the handles here to free up some system + // resources, but we can't since there's a race condition. The handles must + // be valid until they're sent over IPC, which is done from the I/O thread + // which will often get done after this code executes. We could do + // something more elaborate like an ACK from the plugin or post a task to + // the I/O thread and back, but this extra complexity doesn't seem worth it + // just to clean up these handles faster. } else { SetStreamInfo(shared_memory_handle, shared_memory_size, socket_handle); } |