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

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

Issue 17334005: Re-land r207105 (Mac audio capture threading fix) with unit test memory leak issue resolved. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Using ref-counting (Patch Set 2 from Issue 17122006). Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/renderer_host/media/web_contents_audio_input_stream.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 #include "content/browser/renderer_host/media/audio_input_renderer_host.h" 5 #include "content/browser/renderer_host/media/audio_input_renderer_host.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/process.h" 9 #include "base/process.h"
10 #include "base/shared_memory.h" 10 #include "base/shared_memory.h"
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 if (!writer->Init()) { 263 if (!writer->Init()) {
264 SendErrorMessage(stream_id); 264 SendErrorMessage(stream_id);
265 return; 265 return;
266 } 266 }
267 267
268 // If we have successfully created the SyncWriter then assign it to the 268 // If we have successfully created the SyncWriter then assign it to the
269 // entry and construct an AudioInputController. 269 // entry and construct an AudioInputController.
270 entry->writer.reset(writer.release()); 270 entry->writer.reset(writer.release());
271 if (WebContentsCaptureUtil::IsWebContentsDeviceId(device_id)) { 271 if (WebContentsCaptureUtil::IsWebContentsDeviceId(device_id)) {
272 entry->controller = media::AudioInputController::CreateForStream( 272 entry->controller = media::AudioInputController::CreateForStream(
273 audio_manager_->GetWorkerLoop(), 273 audio_manager_->GetMessageLoop(),
274 this, 274 this,
275 WebContentsAudioInputStream::Create( 275 WebContentsAudioInputStream::Create(
276 device_id, audio_params, audio_manager_->GetWorkerLoop(), 276 device_id, audio_params, audio_manager_->GetWorkerLoop(),
277 audio_mirroring_manager_), 277 audio_mirroring_manager_),
278 entry->writer.get()); 278 entry->writer.get());
279 } else { 279 } else {
280 // TODO(henrika): replace CreateLowLatency() with Create() as soon 280 // TODO(henrika): replace CreateLowLatency() with Create() as soon
281 // as satish has ensured that Speech Input also uses the default low- 281 // as satish has ensured that Speech Input also uses the default low-
282 // latency path. See crbug.com/112472 for details. 282 // latency path. See crbug.com/112472 for details.
283 entry->controller = media::AudioInputController::CreateLowLatency( 283 entry->controller = media::AudioInputController::CreateLowLatency(
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 // TODO(hclam): Implement a faster look up method. 398 // TODO(hclam): Implement a faster look up method.
399 for (AudioEntryMap::iterator i = audio_entries_.begin(); 399 for (AudioEntryMap::iterator i = audio_entries_.begin();
400 i != audio_entries_.end(); ++i) { 400 i != audio_entries_.end(); ++i) {
401 if (controller == i->second->controller.get()) 401 if (controller == i->second->controller.get())
402 return i->second; 402 return i->second;
403 } 403 }
404 return NULL; 404 return NULL;
405 } 405 }
406 406
407 } // namespace content 407 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/media/web_contents_audio_input_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698