 Chromium Code Reviews
 Chromium Code Reviews Issue 10836025:
  Part 1: Plumb render view ID to render host  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src
    
  
    Issue 10836025:
  Part 1: Plumb render view ID to render host  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src| OLD | NEW | 
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 // | |
| 5 // 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
 | |
| 6 // renderers. Created on render thread, AudioMessageFilter is operated on | |
| 7 // IO thread (secondary thread of render process) it intercepts audio messages | |
| 8 // and process them on IO thread since these messages are time critical. | |
| 9 | |
| 10 #ifndef CONTENT_RENDERER_MEDIA_AUDIO_OUTPUT_IPC_IMPL_H_ | |
| 11 #define CONTENT_RENDERER_MEDIA_AUDIO_OUTPUT_IPC_IMPL_H_ | |
| 12 | |
| 13 #include "base/gtest_prod_util.h" | |
| 14 #include "base/id_map.h" | |
| 15 #include "base/shared_memory.h" | |
| 16 #include "base/sync_socket.h" | |
| 17 #include "content/common/content_export.h" | |
| 18 #include "ipc/ipc_channel_proxy.h" | |
| 19 #include "media/audio/audio_buffers_state.h" | |
| 20 #include "media/audio/audio_output_ipc.h" | |
| 21 | |
| 22 class AudioMessageFilter; | |
| 23 | |
| 24 class CONTENT_EXPORT AudioOutputIPCImpl | |
| 
scherkus (not reviewing)
2012/08/03 21:12:52
new classes in content should be under the content
 | |
| 25 : public NON_EXPORTED_BASE(media::AudioOutputIPC) { | |
| 26 public: | |
| 27 explicit AudioOutputIPCImpl(int render_view_id); | |
| 28 virtual ~AudioOutputIPCImpl(); | |
| 29 | |
| 30 // media::AudioOutputIPC implementation. | |
| 31 virtual int AddDelegate(media::AudioOutputIPCDelegate* delegate) OVERRIDE; | |
| 32 virtual void RemoveDelegate(int id) OVERRIDE; | |
| 33 virtual void CreateStream(int stream_id, | |
| 34 const media::AudioParameters& params) OVERRIDE; | |
| 35 virtual void PlayStream(int stream_id) OVERRIDE; | |
| 36 virtual void PauseStream(int stream_id) OVERRIDE; | |
| 37 virtual void FlushStream(int stream_id) OVERRIDE; | |
| 38 virtual void CloseStream(int stream_id) OVERRIDE; | |
| 39 virtual void SetVolume(int stream_id, double volume) OVERRIDE; | |
| 40 | |
| 41 private: | |
| 42 | |
| 43 // Sends an IPC message using |filter_|. | |
| 44 bool Send(IPC::Message* message); | |
| 45 | |
| 46 // Cached audio message filter (lives on the main render thread). | |
| 47 scoped_refptr<AudioMessageFilter> filter_; | |
| 48 | |
| 49 // A map of stream ids to delegates. | |
| 50 IDMap<media::AudioOutputIPCDelegate> delegates_; | |
| 51 | |
| 52 const int render_view_id_; | |
| 53 | |
| 54 DISALLOW_COPY_AND_ASSIGN(AudioOutputIPCImpl); | |
| 55 }; | |
| 56 | |
| 57 #endif // CONTENT_RENDERER_MEDIA_AUDIO_OUTPUT_IPC_IMPL_H_ | |
| OLD | NEW |