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

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

Issue 9369009: Make content::ResourceContext be a real interface like the rest of the Content API (i.e. don't ha... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 8 years, 10 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 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 // AudioInputRendererHost serves audio related requests from audio capturer 5 // AudioInputRendererHost serves audio related requests from audio capturer
6 // which lives inside the render process and provide access to audio hardware. 6 // which lives inside the render process and provide access to audio hardware.
7 // 7 //
8 // Create stream sequence (AudioInputController = AIC): 8 // Create stream sequence (AudioInputController = AIC):
9 // 9 //
10 // AudioInputHostMsg_CreateStream -> OnCreateStream -> AIC::CreateLowLatency -> 10 // AudioInputHostMsg_CreateStream -> OnCreateStream -> AIC::CreateLowLatency ->
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // The synchronous writer to be used by the controller. We have the 92 // The synchronous writer to be used by the controller. We have the
93 // ownership of the writer. 93 // ownership of the writer.
94 scoped_ptr<media::AudioInputController::SyncWriter> writer; 94 scoped_ptr<media::AudioInputController::SyncWriter> writer;
95 95
96 // Set to true after we called Close() for the controller. 96 // Set to true after we called Close() for the controller.
97 bool pending_close; 97 bool pending_close;
98 }; 98 };
99 99
100 // Called from UI thread from the owner of this object. 100 // Called from UI thread from the owner of this object.
101 explicit AudioInputRendererHost( 101 explicit AudioInputRendererHost(
102 const content::ResourceContext* resource_context); 102 content::ResourceContext* resource_context);
103 103
104 // content::BrowserMessageFilter implementation. 104 // content::BrowserMessageFilter implementation.
105 virtual void OnChannelClosing() OVERRIDE; 105 virtual void OnChannelClosing() OVERRIDE;
106 virtual void OnDestruct() const OVERRIDE; 106 virtual void OnDestruct() const OVERRIDE;
107 virtual bool OnMessageReceived(const IPC::Message& message, 107 virtual bool OnMessageReceived(const IPC::Message& message,
108 bool* message_was_ok) OVERRIDE; 108 bool* message_was_ok) OVERRIDE;
109 109
110 // AudioInputController::EventHandler implementation. 110 // AudioInputController::EventHandler implementation.
111 virtual void OnCreated(media::AudioInputController* controller) OVERRIDE; 111 virtual void OnCreated(media::AudioInputController* controller) OVERRIDE;
112 virtual void OnRecording(media::AudioInputController* controller) OVERRIDE; 112 virtual void OnRecording(media::AudioInputController* controller) OVERRIDE;
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 // Search for a AudioEntry having the reference to |controller|. 194 // Search for a AudioEntry having the reference to |controller|.
195 // This method is used to look up an AudioEntry after a controller 195 // This method is used to look up an AudioEntry after a controller
196 // event is received. 196 // event is received.
197 AudioEntry* LookupByController(media::AudioInputController* controller); 197 AudioEntry* LookupByController(media::AudioInputController* controller);
198 198
199 // A helper method to look up a session identified by |stream_id|. 199 // A helper method to look up a session identified by |stream_id|.
200 // Returns 0 if not found. 200 // Returns 0 if not found.
201 int LookupSessionById(int stream_id); 201 int LookupSessionById(int stream_id);
202 202
203 // Used to get an instance of AudioInputDeviceManager. 203 // Used to get an instance of AudioInputDeviceManager.
204 const content::ResourceContext* resource_context_; 204 content::ResourceContext* resource_context_;
205 205
206 // A map of stream IDs to audio sources. 206 // A map of stream IDs to audio sources.
207 typedef std::map<int, AudioEntry*> AudioEntryMap; 207 typedef std::map<int, AudioEntry*> AudioEntryMap;
208 AudioEntryMap audio_entries_; 208 AudioEntryMap audio_entries_;
209 209
210 // A map of session IDs to audio session sources. 210 // A map of session IDs to audio session sources.
211 typedef std::map<int, int> SessionEntryMap; 211 typedef std::map<int, int> SessionEntryMap;
212 SessionEntryMap session_entries_; 212 SessionEntryMap session_entries_;
213 213
214 DISALLOW_COPY_AND_ASSIGN(AudioInputRendererHost); 214 DISALLOW_COPY_AND_ASSIGN(AudioInputRendererHost);
215 }; 215 };
216 216
217 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_RENDERER_HOST_H_ 217 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_RENDERER_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698