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

Unified Diff: content/renderer/media/audio_output_ipc_impl.h

Issue 10836025: Part 1: Plumb render view ID to render host (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address review comments Created 8 years, 5 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/media/audio_output_ipc_impl.h
diff --git a/content/renderer/media/audio_output_ipc_impl.h b/content/renderer/media/audio_output_ipc_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..cafc1c9d7b52c8a1e043516c8075e096e59ad08d
--- /dev/null
+++ b/content/renderer/media/audio_output_ipc_impl.h
@@ -0,0 +1,57 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// MessageFilter that handles audio messages and delegates them to audio
scherkus (not reviewing) 2012/08/03 21:12:52 nit: we (media folks) typically have the class doc
+// renderers. Created on render thread, AudioMessageFilter is operated on
+// IO thread (secondary thread of render process) it intercepts audio messages
+// and process them on IO thread since these messages are time critical.
+
+#ifndef CONTENT_RENDERER_MEDIA_AUDIO_OUTPUT_IPC_IMPL_H_
+#define CONTENT_RENDERER_MEDIA_AUDIO_OUTPUT_IPC_IMPL_H_
+
+#include "base/gtest_prod_util.h"
+#include "base/id_map.h"
+#include "base/shared_memory.h"
+#include "base/sync_socket.h"
+#include "content/common/content_export.h"
+#include "ipc/ipc_channel_proxy.h"
+#include "media/audio/audio_buffers_state.h"
+#include "media/audio/audio_output_ipc.h"
+
+class AudioMessageFilter;
+
+class CONTENT_EXPORT AudioOutputIPCImpl
scherkus (not reviewing) 2012/08/03 21:12:52 new classes in content should be under the content
+ : public NON_EXPORTED_BASE(media::AudioOutputIPC) {
+ public:
+ explicit AudioOutputIPCImpl(int render_view_id);
+ virtual ~AudioOutputIPCImpl();
+
+ // media::AudioOutputIPC implementation.
+ virtual int AddDelegate(media::AudioOutputIPCDelegate* delegate) OVERRIDE;
+ virtual void RemoveDelegate(int id) OVERRIDE;
+ virtual void CreateStream(int stream_id,
+ const media::AudioParameters& params) OVERRIDE;
+ virtual void PlayStream(int stream_id) OVERRIDE;
+ virtual void PauseStream(int stream_id) OVERRIDE;
+ virtual void FlushStream(int stream_id) OVERRIDE;
+ virtual void CloseStream(int stream_id) OVERRIDE;
+ virtual void SetVolume(int stream_id, double volume) OVERRIDE;
+
+ private:
+
+ // Sends an IPC message using |filter_|.
+ bool Send(IPC::Message* message);
+
+ // Cached audio message filter (lives on the main render thread).
+ scoped_refptr<AudioMessageFilter> filter_;
+
+ // A map of stream ids to delegates.
+ IDMap<media::AudioOutputIPCDelegate> delegates_;
+
+ const int render_view_id_;
+
+ DISALLOW_COPY_AND_ASSIGN(AudioOutputIPCImpl);
+};
+
+#endif // CONTENT_RENDERER_MEDIA_AUDIO_OUTPUT_IPC_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698