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

Unified Diff: content/renderer/pepper_plugin_delegate_impl.cc

Issue 7157001: Implements AudioMessageFilter as member in RenderThread (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: minor lint fix Created 9 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/pepper_plugin_delegate_impl.cc
===================================================================
--- content/renderer/pepper_plugin_delegate_impl.cc (revision 89207)
+++ content/renderer/pepper_plugin_delegate_impl.cc (working copy)
@@ -159,7 +159,7 @@
public AudioMessageFilter::Delegate,
public base::RefCountedThreadSafe<PlatformAudioImpl> {
public:
- explicit PlatformAudioImpl(scoped_refptr<AudioMessageFilter> filter)
+ explicit PlatformAudioImpl(AudioMessageFilter* filter)
: client_(NULL), filter_(filter), stream_id_(0),
main_message_loop_(MessageLoop::current()) {
DCHECK(filter_);
@@ -211,7 +211,8 @@
// MessageFilter used to send/receive IPC. THIS MUST ONLY BE ACCESSED ON THE
// I/O thread except to send messages and get the message loop.
- scoped_refptr<AudioMessageFilter> filter_;
+ // Cached result of Singleton<AudioMessageFilter>::get() to reduce overhead.
+ AudioMessageFilter* filter_;
// Our ID on the MessageFilter. THIS MUST ONLY BE ACCESSED ON THE I/O THREAD
// or else you could race with the initialize function which sets it.
@@ -850,7 +851,7 @@
uint32_t sample_rate, uint32_t sample_count,
webkit::ppapi::PluginDelegate::PlatformAudio::Client* client) {
scoped_refptr<PlatformAudioImpl> audio(
- new PlatformAudioImpl(render_view_->audio_message_filter()));
+ new PlatformAudioImpl(AudioMessageFilter::GetInstance()));
if (audio->Initialize(sample_rate, sample_count, client)) {
// Balanced by Release invoked in PlatformAudioImpl::ShutDownOnIOThread().
return audio.release();
@@ -989,9 +990,9 @@
return file_system_dispatcher->ReadDirectory(directory_path, dispatcher);
}
-class AsyncOpenFileSystemURLCallbackTranslator :
- public fileapi::FileSystemCallbackDispatcher {
-public:
+class AsyncOpenFileSystemURLCallbackTranslator
+ : public fileapi::FileSystemCallbackDispatcher {
scherkus (not reviewing) 2011/06/17 17:50:10 indentation
henrika_dont_use 2011/06/21 16:43:38 Done.
+ public:
AsyncOpenFileSystemURLCallbackTranslator(
webkit::ppapi::PluginDelegate::AsyncOpenFileCallback* callback)
: callback_(callback) {

Powered by Google App Engine
This is Rietveld 408576698