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

Side by Side Diff: content/browser/renderer_host/media/audio_renderer_host.h

Issue 8912009: Move BrowserMessageFilter to public, and into content namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to LKGR. Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // AudioRendererHost serves audio related requests from AudioRenderer which 5 // AudioRendererHost serves audio related requests from AudioRenderer which
6 // lives inside the render process and provide access to audio hardware. 6 // lives inside the render process and provide access to audio hardware.
7 // 7 //
8 // This class is owned by BrowserRenderProcessHost, and instantiated on UI 8 // This class is owned by BrowserRenderProcessHost, and instantiated on UI
9 // thread, but all other operations and method calls happen on IO thread, so we 9 // thread, but all other operations and method calls happen on IO thread, so we
10 // need to be extra careful about the lifetime of this object. AudioManager is a 10 // need to be extra careful about the lifetime of this object. AudioManager is a
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_RENDERER_HOST_H_ 53 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_RENDERER_HOST_H_
54 #pragma once 54 #pragma once
55 55
56 #include <map> 56 #include <map>
57 57
58 #include "base/gtest_prod_util.h" 58 #include "base/gtest_prod_util.h"
59 #include "base/memory/ref_counted.h" 59 #include "base/memory/ref_counted.h"
60 #include "base/memory/scoped_ptr.h" 60 #include "base/memory/scoped_ptr.h"
61 #include "base/process.h" 61 #include "base/process.h"
62 #include "base/shared_memory.h" 62 #include "base/shared_memory.h"
63 #include "content/browser/browser_message_filter.h"
64 #include "content/common/content_export.h" 63 #include "content/common/content_export.h"
64 #include "content/public/browser/browser_message_filter.h"
65 #include "content/public/browser/browser_thread.h" 65 #include "content/public/browser/browser_thread.h"
66 #include "media/audio/audio_io.h" 66 #include "media/audio/audio_io.h"
67 #include "media/audio/audio_output_controller.h" 67 #include "media/audio/audio_output_controller.h"
68 #include "media/audio/simple_sources.h" 68 #include "media/audio/simple_sources.h"
69 69
70 class AudioManager; 70 class AudioManager;
71 struct AudioParameters; 71 struct AudioParameters;
72 class MediaObserver; 72 class MediaObserver;
73 73
74 namespace content { 74 namespace content {
75 class ResourceContext; 75 class ResourceContext;
76 } // namespace content 76 } // namespace content
77 77
78 class CONTENT_EXPORT AudioRendererHost 78 class CONTENT_EXPORT AudioRendererHost
79 : public BrowserMessageFilter, 79 : public content::BrowserMessageFilter,
80 public media::AudioOutputController::EventHandler { 80 public media::AudioOutputController::EventHandler {
81 public: 81 public:
82 struct AudioEntry { 82 struct AudioEntry {
83 AudioEntry(); 83 AudioEntry();
84 ~AudioEntry(); 84 ~AudioEntry();
85 85
86 // The AudioOutputController that manages the audio stream. 86 // The AudioOutputController that manages the audio stream.
87 scoped_refptr<media::AudioOutputController> controller; 87 scoped_refptr<media::AudioOutputController> controller;
88 88
89 // The audio stream ID. 89 // The audio stream ID.
(...skipping 10 matching lines...) Expand all
100 100
101 // Set to true after we called Close() for the controller. 101 // Set to true after we called Close() for the controller.
102 bool pending_close; 102 bool pending_close;
103 }; 103 };
104 104
105 typedef std::map<int, AudioEntry*> AudioEntryMap; 105 typedef std::map<int, AudioEntry*> AudioEntryMap;
106 106
107 // Called from UI thread from the owner of this object. 107 // Called from UI thread from the owner of this object.
108 AudioRendererHost(const content::ResourceContext* resource_context); 108 AudioRendererHost(const content::ResourceContext* resource_context);
109 109
110 // BrowserMessageFilter implementation. 110 // content::BrowserMessageFilter implementation.
111 virtual void OnChannelClosing() OVERRIDE; 111 virtual void OnChannelClosing() OVERRIDE;
112 virtual void OnDestruct() const OVERRIDE; 112 virtual void OnDestruct() const OVERRIDE;
113 virtual bool OnMessageReceived(const IPC::Message& message, 113 virtual bool OnMessageReceived(const IPC::Message& message,
114 bool* message_was_ok) OVERRIDE; 114 bool* message_was_ok) OVERRIDE;
115 115
116 // AudioOutputController::EventHandler implementations. 116 // AudioOutputController::EventHandler implementations.
117 virtual void OnCreated(media::AudioOutputController* controller) OVERRIDE; 117 virtual void OnCreated(media::AudioOutputController* controller) OVERRIDE;
118 virtual void OnPlaying(media::AudioOutputController* controller) OVERRIDE; 118 virtual void OnPlaying(media::AudioOutputController* controller) OVERRIDE;
119 virtual void OnPaused(media::AudioOutputController* controller) OVERRIDE; 119 virtual void OnPaused(media::AudioOutputController* controller) OVERRIDE;
120 virtual void OnError(media::AudioOutputController* controller, 120 virtual void OnError(media::AudioOutputController* controller,
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 // A map of stream IDs to audio sources. 217 // A map of stream IDs to audio sources.
218 AudioEntryMap audio_entries_; 218 AudioEntryMap audio_entries_;
219 219
220 const content::ResourceContext* resource_context_; 220 const content::ResourceContext* resource_context_;
221 MediaObserver* media_observer_; 221 MediaObserver* media_observer_;
222 222
223 DISALLOW_COPY_AND_ASSIGN(AudioRendererHost); 223 DISALLOW_COPY_AND_ASSIGN(AudioRendererHost);
224 }; 224 };
225 225
226 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_RENDERER_HOST_H_ 226 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_RENDERER_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698