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

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

Issue 495983002: Improve logging related to start/stop and failure of audio input streams in Chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Feedback from xians@ Created 6 years, 3 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) 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/memory/shared_memory.h" 8 #include "base/memory/shared_memory.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/numerics/safe_math.h" 10 #include "base/numerics/safe_math.h"
11 #include "base/process/process.h" 11 #include "base/process/process.h"
12 #include "base/strings/stringprintf.h" 12 #include "base/strings/stringprintf.h"
13 #include "content/browser/media/capture/web_contents_audio_input_stream.h" 13 #include "content/browser/media/capture/web_contents_audio_input_stream.h"
14 #include "content/browser/media/capture/web_contents_capture_util.h" 14 #include "content/browser/media/capture/web_contents_capture_util.h"
15 #include "content/browser/media/media_internals.h" 15 #include "content/browser/media/media_internals.h"
16 #include "content/browser/renderer_host/media/audio_input_device_manager.h" 16 #include "content/browser/renderer_host/media/audio_input_device_manager.h"
17 #include "content/browser/renderer_host/media/audio_input_sync_writer.h" 17 #include "content/browser/renderer_host/media/audio_input_sync_writer.h"
18 #include "content/browser/renderer_host/media/media_stream_manager.h" 18 #include "content/browser/renderer_host/media/media_stream_manager.h"
19 #include "media/audio/audio_manager_base.h" 19 #include "media/audio/audio_manager_base.h"
20 #include "media/base/audio_bus.h" 20 #include "media/base/audio_bus.h"
21 21
22 namespace {
23 void LogMessage(int stream_id, std::string msg, bool add_prefix) {
tommi (sloooow) - chröme 2014/08/26 11:42:30 const &
henrika (OOO until Aug 14) 2014/08/27 13:44:04 Done.
24 std::string log_string =
tommi (sloooow) - chröme 2014/08/26 11:42:30 instead of constructing strings and using StringPr
25 add_prefix ? base::StringPrintf("[stream_id=%d] AIRH::", stream_id)
26 : base::StringPrintf("[stream_id=%d] ", stream_id);
27 log_string += msg;
28 content::MediaStreamManager::SendMessageToNativeLog(log_string);
29 DVLOG(1) << log_string;
tommi (sloooow) - chröme 2014/08/26 11:42:30 Since this is a DVLOG, this whole function should
henrika (OOO until Aug 14) 2014/08/26 13:56:51 Not sure if I understand. I want the add native We
henrika (OOO until Aug 14) 2014/08/27 13:44:04 Discussed off-line. Seems like we are in phase on
30 }
31 }
32
22 namespace content { 33 namespace content {
23 34
24 struct AudioInputRendererHost::AudioEntry { 35 struct AudioInputRendererHost::AudioEntry {
25 AudioEntry(); 36 AudioEntry();
26 ~AudioEntry(); 37 ~AudioEntry();
27 38
28 // The AudioInputController that manages the audio input stream. 39 // The AudioInputController that manages the audio input stream.
29 scoped_refptr<media::AudioInputController> controller; 40 scoped_refptr<media::AudioInputController> controller;
30 41
31 // The audio input stream ID in the render view. 42 // The audio input stream ID in the render view.
32 int stream_id; 43 int stream_id;
33 44
34 // Shared memory for transmission of the audio data. It has 45 // Shared memory for transmission of the audio data. It has
35 // |shared_memory_segment_count| equal lengthed segments. 46 // |shared_memory_segment_count| equal lengthed segments.
36 base::SharedMemory shared_memory; 47 base::SharedMemory shared_memory;
37 int shared_memory_segment_count; 48 int shared_memory_segment_count;
38 49
39 // The synchronous writer to be used by the controller. We have the 50 // The synchronous writer to be used by the controller. We have the
40 // ownership of the writer. 51 // ownership of the writer.
41 scoped_ptr<media::AudioInputController::SyncWriter> writer; 52 scoped_ptr<media::AudioInputController::SyncWriter> writer;
42 53
43 // Set to true after we called Close() for the controller. 54 // Set to true after we called Close() for the controller.
44 bool pending_close; 55 bool pending_close;
56
57 // Counts number of NO_DATA_ERROR calls for this stream.
58 int num_no_data_errors;
45 }; 59 };
46 60
47 AudioInputRendererHost::AudioEntry::AudioEntry() 61 AudioInputRendererHost::AudioEntry::AudioEntry()
48 : stream_id(0), 62 : stream_id(0),
49 shared_memory_segment_count(0), 63 shared_memory_segment_count(0),
50 pending_close(false) { 64 pending_close(false),
65 num_no_data_errors(0) {
51 } 66 }
52 67
53 AudioInputRendererHost::AudioEntry::~AudioEntry() {} 68 AudioInputRendererHost::AudioEntry::~AudioEntry() {}
54 69
55 AudioInputRendererHost::AudioInputRendererHost( 70 AudioInputRendererHost::AudioInputRendererHost(
56 media::AudioManager* audio_manager, 71 media::AudioManager* audio_manager,
57 MediaStreamManager* media_stream_manager, 72 MediaStreamManager* media_stream_manager,
58 AudioMirroringManager* audio_mirroring_manager, 73 AudioMirroringManager* audio_mirroring_manager,
59 media::UserInputMonitor* user_input_monitor) 74 media::UserInputMonitor* user_input_monitor)
60 : BrowserMessageFilter(AudioMsgStart), 75 : BrowserMessageFilter(AudioMsgStart),
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 media::AudioInputController* controller) { 201 media::AudioInputController* controller) {
187 DCHECK_CURRENTLY_ON(BrowserThread::IO); 202 DCHECK_CURRENTLY_ON(BrowserThread::IO);
188 // TODO(henrika): See crbug.com/115262 for details on why this method 203 // TODO(henrika): See crbug.com/115262 for details on why this method
189 // should be implemented. 204 // should be implemented.
190 } 205 }
191 206
192 void AudioInputRendererHost::DoHandleError( 207 void AudioInputRendererHost::DoHandleError(
193 media::AudioInputController* controller, 208 media::AudioInputController* controller,
194 media::AudioInputController::ErrorCode error_code) { 209 media::AudioInputController::ErrorCode error_code) {
195 DCHECK_CURRENTLY_ON(BrowserThread::IO); 210 DCHECK_CURRENTLY_ON(BrowserThread::IO);
196 // Log all errors even it is ignored later. 211 AudioEntry* entry = LookupByController(controller);
197 MediaStreamManager::SendMessageToNativeLog( 212 if (!entry)
198 base::StringPrintf("AudioInputController error: %d", error_code)); 213 return;
tommi (sloooow) - chröme 2014/08/26 11:42:30 should this be considered an error case or is it e
henrika (OOO until Aug 14) 2014/08/27 13:44:05 Good comment. Old style that I've reused here. "Sh
199 214
200 // This is a fix for crbug.com/357501. The error can be triggered when closing 215 // This is a fix for crbug.com/357501. The error can be triggered when closing
201 // the lid on Macs, which causes more problems than it fixes. 216 // the lid on Macs, which causes more problems than it fixes.
202 // Also, in crbug.com/357569, the goal is to remove usage of the error since 217 // Also, in crbug.com/357569, the goal is to remove usage of the error since
203 // it was added to solve a crash on Windows that no longer can be reproduced. 218 // it was added to solve a crash on Windows that no longer can be reproduced.
204 if (error_code == media::AudioInputController::NO_DATA_ERROR) { 219 if (error_code == media::AudioInputController::NO_DATA_ERROR) {
205 DVLOG(1) << "AudioInputRendererHost@" << this << "::DoHandleError: " 220 // TODO(henrika): it might be possible to do something other than just
206 << "NO_DATA_ERROR ignored."; 221 // logging when we detect many NO_DATA_ERROR calls for a stream.
222 entry->num_no_data_errors++;
tommi (sloooow) - chröme 2014/08/26 11:42:30 is num_no_data_errors only used in debug builds?
henrika (OOO until Aug 14) 2014/08/27 13:44:04 Thx, given where we are I decided to remove it. It
223 if (entry->num_no_data_errors > 5)
224 LogMessage(entry->stream_id, "AIC => stream looks dead", false);
tommi (sloooow) - chröme 2014/08/26 11:42:30 what about logging num_no_data_errors?
henrika (OOO until Aug 14) 2014/08/27 13:44:04 see above
225 else
226 LogMessage(entry->stream_id, "AIC => NO_DATA_ERROR", false);
207 return; 227 return;
208 } 228 }
209 229
210 AudioEntry* entry = LookupByController(controller); 230 const std::string err_msg =
211 if (!entry) 231 base::StringPrintf("AIC reports error_code=%d", error_code);
tommi (sloooow) - chröme 2014/08/26 11:42:30 this should be debug only
henrika (OOO until Aug 14) 2014/08/27 13:44:04 A similar log is used today in Release. Would like
212 return; 232 LogMessage(entry->stream_id, err_msg, false);
213 233
214 audio_log_->OnError(entry->stream_id); 234 audio_log_->OnError(entry->stream_id);
215 DeleteEntryOnError(entry, AUDIO_INPUT_CONTROLLER_ERROR); 235 DeleteEntryOnError(entry, AUDIO_INPUT_CONTROLLER_ERROR);
216 } 236 }
217 237
218 void AudioInputRendererHost::DoLog(media::AudioInputController* controller, 238 void AudioInputRendererHost::DoLog(media::AudioInputController* controller,
219 const std::string& message) { 239 const std::string& message) {
220 DCHECK_CURRENTLY_ON(BrowserThread::IO); 240 DCHECK_CURRENTLY_ON(BrowserThread::IO);
221 AudioEntry* entry = LookupByController(controller); 241 AudioEntry* entry = LookupByController(controller);
222 if (!entry) 242 if (!entry)
223 return; 243 return;
224 244
225 // Add stream ID and current audio level reported by AIC to native log. 245 // Add stream ID and current audio level reported by AIC to native log.
226 std::string log_string = 246 LogMessage(entry->stream_id, message, false);
227 base::StringPrintf("[stream_id=%d] ", entry->stream_id);
228 log_string += message;
229 MediaStreamManager::SendMessageToNativeLog(log_string);
230 DVLOG(1) << log_string;
231 } 247 }
232 248
233 bool AudioInputRendererHost::OnMessageReceived(const IPC::Message& message) { 249 bool AudioInputRendererHost::OnMessageReceived(const IPC::Message& message) {
234 bool handled = true; 250 bool handled = true;
235 IPC_BEGIN_MESSAGE_MAP(AudioInputRendererHost, message) 251 IPC_BEGIN_MESSAGE_MAP(AudioInputRendererHost, message)
236 IPC_MESSAGE_HANDLER(AudioInputHostMsg_CreateStream, OnCreateStream) 252 IPC_MESSAGE_HANDLER(AudioInputHostMsg_CreateStream, OnCreateStream)
237 IPC_MESSAGE_HANDLER(AudioInputHostMsg_RecordStream, OnRecordStream) 253 IPC_MESSAGE_HANDLER(AudioInputHostMsg_RecordStream, OnRecordStream)
238 IPC_MESSAGE_HANDLER(AudioInputHostMsg_CloseStream, OnCloseStream) 254 IPC_MESSAGE_HANDLER(AudioInputHostMsg_CloseStream, OnCloseStream)
239 IPC_MESSAGE_HANDLER(AudioInputHostMsg_SetVolume, OnSetVolume) 255 IPC_MESSAGE_HANDLER(AudioInputHostMsg_SetVolume, OnSetVolume)
240 IPC_MESSAGE_UNHANDLED(handled = false) 256 IPC_MESSAGE_UNHANDLED(handled = false)
241 IPC_END_MESSAGE_MAP() 257 IPC_END_MESSAGE_MAP()
242 258
243 return handled; 259 return handled;
244 } 260 }
245 261
246 void AudioInputRendererHost::OnCreateStream( 262 void AudioInputRendererHost::OnCreateStream(
247 int stream_id, 263 int stream_id,
248 int render_view_id, 264 int render_view_id,
249 int session_id, 265 int session_id,
250 const AudioInputHostMsg_CreateStream_Config& config) { 266 const AudioInputHostMsg_CreateStream_Config& config) {
251 DCHECK_CURRENTLY_ON(BrowserThread::IO); 267 DCHECK_CURRENTLY_ON(BrowserThread::IO);
252 268
253 DVLOG(1) << "AudioInputRendererHost@" << this 269 std::ostringstream oss;
254 << "::OnCreateStream(stream_id=" << stream_id 270 oss << "[stream_id=" << stream_id << "] "
255 << ", render_view_id=" << render_view_id 271 << "AIRH::OnCreateStream(render_view_id=" << render_view_id
256 << ", session_id=" << session_id << ")"; 272 << ", session_id=" << session_id << ")";
257 DCHECK_GT(render_view_id, 0); 273 DCHECK_GT(render_view_id, 0);
258 274
259 // media::AudioParameters is validated in the deserializer. 275 // media::AudioParameters is validated in the deserializer.
260 if (LookupById(stream_id) != NULL) { 276 if (LookupById(stream_id) != NULL) {
261 SendErrorMessage(stream_id, STREAM_ALREADY_EXISTS); 277 SendErrorMessage(stream_id, STREAM_ALREADY_EXISTS);
tommi (sloooow) - chröme 2014/08/26 11:42:30 would we want to call SendMessageToNativeLog() in
henrika (OOO until Aug 14) 2014/08/27 13:44:04 Yes, and we do since it is included in SendErrorMe
262 return; 278 return;
263 } 279 }
264 280
265 media::AudioParameters audio_params(config.params); 281 media::AudioParameters audio_params(config.params);
266 if (media_stream_manager_->audio_input_device_manager()-> 282 if (media_stream_manager_->audio_input_device_manager()->
267 ShouldUseFakeDevice()) { 283 ShouldUseFakeDevice()) {
268 audio_params.Reset( 284 audio_params.Reset(
269 media::AudioParameters::AUDIO_FAKE, 285 media::AudioParameters::AUDIO_FAKE,
270 config.params.channel_layout(), config.params.channels(), 0, 286 config.params.channel_layout(), config.params.channels(), 0,
271 config.params.sample_rate(), config.params.bits_per_sample(), 287 config.params.sample_rate(), config.params.bits_per_sample(),
272 config.params.frames_per_buffer()); 288 config.params.frames_per_buffer());
273 } 289 }
274 290
275 // Check if we have the permission to open the device and which device to use. 291 // Check if we have the permission to open the device and which device to use.
276 std::string device_name; 292 std::string device_name;
277 std::string device_id = media::AudioManagerBase::kDefaultDeviceId; 293 std::string device_id = media::AudioManagerBase::kDefaultDeviceId;
278 if (audio_params.format() != media::AudioParameters::AUDIO_FAKE) { 294 if (audio_params.format() != media::AudioParameters::AUDIO_FAKE) {
279 const StreamDeviceInfo* info = media_stream_manager_-> 295 const StreamDeviceInfo* info = media_stream_manager_->
280 audio_input_device_manager()->GetOpenedDeviceInfoById(session_id); 296 audio_input_device_manager()->GetOpenedDeviceInfoById(session_id);
281 if (!info) { 297 if (!info) {
282 SendErrorMessage(stream_id, PERMISSION_DENIED); 298 SendErrorMessage(stream_id, PERMISSION_DENIED);
283 DLOG(WARNING) << "No permission has been granted to input stream with " 299 DLOG(WARNING) << "No permission has been granted to input stream with "
284 << "session_id=" << session_id; 300 << "session_id=" << session_id;
285 return; 301 return;
286 } 302 }
287 303
288 device_id = info->device.id; 304 device_id = info->device.id;
289 device_name = info->device.name; 305 device_name = info->device.name;
306 oss << ": device_name=" << device_name;
290 } 307 }
308 MediaStreamManager::SendMessageToNativeLog(oss.str());
309 DVLOG(1) << oss.str();
tommi (sloooow) - chröme 2014/08/26 11:42:30 nit: don't think you need the |.str()| part
henrika (OOO until Aug 14) 2014/08/27 13:44:04 Done.
henrika (OOO until Aug 14) 2014/08/27 14:26:00 Actually we do. No log is printed otherwise.
291 310
292 // Create a new AudioEntry structure. 311 // Create a new AudioEntry structure.
293 scoped_ptr<AudioEntry> entry(new AudioEntry()); 312 scoped_ptr<AudioEntry> entry(new AudioEntry());
294 313
295 const uint32 segment_size = 314 const uint32 segment_size =
296 (sizeof(media::AudioInputBufferParameters) + 315 (sizeof(media::AudioInputBufferParameters) +
297 media::AudioBus::CalculateMemorySize(audio_params)); 316 media::AudioBus::CalculateMemorySize(audio_params));
298 entry->shared_memory_segment_count = config.shared_memory_count; 317 entry->shared_memory_segment_count = config.shared_memory_count;
299 318
300 // Create the shared memory and share it with the renderer process 319 // Create the shared memory and share it with the renderer process
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 369
351 // Set the initial AGC state for the audio input stream. Note that, the AGC 370 // Set the initial AGC state for the audio input stream. Note that, the AGC
352 // is only supported in AUDIO_PCM_LOW_LATENCY mode. 371 // is only supported in AUDIO_PCM_LOW_LATENCY mode.
353 if (config.params.format() == media::AudioParameters::AUDIO_PCM_LOW_LATENCY) 372 if (config.params.format() == media::AudioParameters::AUDIO_PCM_LOW_LATENCY)
354 entry->controller->SetAutomaticGainControl(config.automatic_gain_control); 373 entry->controller->SetAutomaticGainControl(config.automatic_gain_control);
355 374
356 // Since the controller was created successfully, create an entry and add it 375 // Since the controller was created successfully, create an entry and add it
357 // to the map. 376 // to the map.
358 entry->stream_id = stream_id; 377 entry->stream_id = stream_id;
359 audio_entries_.insert(std::make_pair(stream_id, entry.release())); 378 audio_entries_.insert(std::make_pair(stream_id, entry.release()));
360
361 MediaStreamManager::SendMessageToNativeLog(
362 "Audio input stream created successfully. Device name: " + device_name);
363 audio_log_->OnCreated(stream_id, audio_params, device_id); 379 audio_log_->OnCreated(stream_id, audio_params, device_id);
364 } 380 }
365 381
366 void AudioInputRendererHost::OnRecordStream(int stream_id) { 382 void AudioInputRendererHost::OnRecordStream(int stream_id) {
367 DCHECK_CURRENTLY_ON(BrowserThread::IO); 383 DCHECK_CURRENTLY_ON(BrowserThread::IO);
384 LogMessage(stream_id, "OnRecordStream", true);
368 385
369 AudioEntry* entry = LookupById(stream_id); 386 AudioEntry* entry = LookupById(stream_id);
370 if (!entry) { 387 if (!entry) {
371 SendErrorMessage(stream_id, INVALID_AUDIO_ENTRY); 388 SendErrorMessage(stream_id, INVALID_AUDIO_ENTRY);
372 return; 389 return;
373 } 390 }
374 391
375 entry->controller->Record(); 392 entry->controller->Record();
376 audio_log_->OnStarted(stream_id); 393 audio_log_->OnStarted(stream_id);
377 } 394 }
378 395
379 void AudioInputRendererHost::OnCloseStream(int stream_id) { 396 void AudioInputRendererHost::OnCloseStream(int stream_id) {
380 DCHECK_CURRENTLY_ON(BrowserThread::IO); 397 DCHECK_CURRENTLY_ON(BrowserThread::IO);
398 LogMessage(stream_id, "OnCloseStream", true);
381 399
382 AudioEntry* entry = LookupById(stream_id); 400 AudioEntry* entry = LookupById(stream_id);
383 401
384 if (entry) 402 if (entry)
385 CloseAndDeleteStream(entry); 403 CloseAndDeleteStream(entry);
386 } 404 }
387 405
388 void AudioInputRendererHost::OnSetVolume(int stream_id, double volume) { 406 void AudioInputRendererHost::OnSetVolume(int stream_id, double volume) {
389 DCHECK_CURRENTLY_ON(BrowserThread::IO); 407 DCHECK_CURRENTLY_ON(BrowserThread::IO);
390 408
391 AudioEntry* entry = LookupById(stream_id); 409 AudioEntry* entry = LookupById(stream_id);
392 if (!entry) { 410 if (!entry) {
393 SendErrorMessage(stream_id, INVALID_AUDIO_ENTRY); 411 SendErrorMessage(stream_id, INVALID_AUDIO_ENTRY);
394 return; 412 return;
395 } 413 }
396 414
397 entry->controller->SetVolume(volume); 415 entry->controller->SetVolume(volume);
398 audio_log_->OnSetVolume(stream_id, volume); 416 audio_log_->OnSetVolume(stream_id, volume);
399 } 417 }
400 418
401 void AudioInputRendererHost::SendErrorMessage( 419 void AudioInputRendererHost::SendErrorMessage(
402 int stream_id, ErrorCode error_code) { 420 int stream_id, ErrorCode error_code) {
403 MediaStreamManager::SendMessageToNativeLog( 421 std::string err_msg =
tommi (sloooow) - chröme 2014/08/26 11:42:30 debug only
henrika (OOO until Aug 14) 2014/08/27 13:44:04 As discussed off-line. Plan was to keep as is sinc
404 base::StringPrintf("AudioInputRendererHost error: %d", error_code)); 422 base::StringPrintf("SendErrorMessage(error_code=%d)", error_code);
423 LogMessage(stream_id, err_msg, true);
424
405 Send(new AudioInputMsg_NotifyStreamStateChanged( 425 Send(new AudioInputMsg_NotifyStreamStateChanged(
406 stream_id, media::AudioInputIPCDelegate::kError)); 426 stream_id, media::AudioInputIPCDelegate::kError));
407 } 427 }
408 428
409 void AudioInputRendererHost::DeleteEntries() { 429 void AudioInputRendererHost::DeleteEntries() {
410 DCHECK_CURRENTLY_ON(BrowserThread::IO); 430 DCHECK_CURRENTLY_ON(BrowserThread::IO);
411 431
412 for (AudioEntryMap::iterator i = audio_entries_.begin(); 432 for (AudioEntryMap::iterator i = audio_entries_.begin();
413 i != audio_entries_.end(); ++i) { 433 i != audio_entries_.end(); ++i) {
414 CloseAndDeleteStream(i->second); 434 CloseAndDeleteStream(i->second);
415 } 435 }
416 } 436 }
417 437
418 void AudioInputRendererHost::CloseAndDeleteStream(AudioEntry* entry) { 438 void AudioInputRendererHost::CloseAndDeleteStream(AudioEntry* entry) {
419 DCHECK_CURRENTLY_ON(BrowserThread::IO); 439 DCHECK_CURRENTLY_ON(BrowserThread::IO);
420 440
421 if (!entry->pending_close) { 441 if (!entry->pending_close) {
442 LogMessage(entry->stream_id, "CloseAndDeleteStream", true);
422 entry->controller->Close(base::Bind(&AudioInputRendererHost::DeleteEntry, 443 entry->controller->Close(base::Bind(&AudioInputRendererHost::DeleteEntry,
423 this, entry)); 444 this, entry));
424 entry->pending_close = true; 445 entry->pending_close = true;
425 audio_log_->OnClosed(entry->stream_id); 446 audio_log_->OnClosed(entry->stream_id);
426 } 447 }
427 } 448 }
428 449
429 void AudioInputRendererHost::DeleteEntry(AudioEntry* entry) { 450 void AudioInputRendererHost::DeleteEntry(AudioEntry* entry) {
430 DCHECK_CURRENTLY_ON(BrowserThread::IO); 451 DCHECK_CURRENTLY_ON(BrowserThread::IO);
452 LogMessage(entry->stream_id, "DeleteEntry", true);
431 453
432 // Delete the entry when this method goes out of scope. 454 // Delete the entry when this method goes out of scope.
433 scoped_ptr<AudioEntry> entry_deleter(entry); 455 scoped_ptr<AudioEntry> entry_deleter(entry);
434 456
435 // Erase the entry from the map. 457 // Erase the entry from the map.
436 audio_entries_.erase(entry->stream_id); 458 audio_entries_.erase(entry->stream_id);
437 } 459 }
438 460
439 void AudioInputRendererHost::DeleteEntryOnError(AudioEntry* entry, 461 void AudioInputRendererHost::DeleteEntryOnError(AudioEntry* entry,
440 ErrorCode error_code) { 462 ErrorCode error_code) {
(...skipping 23 matching lines...) Expand all
464 // TODO(hclam): Implement a faster look up method. 486 // TODO(hclam): Implement a faster look up method.
465 for (AudioEntryMap::iterator i = audio_entries_.begin(); 487 for (AudioEntryMap::iterator i = audio_entries_.begin();
466 i != audio_entries_.end(); ++i) { 488 i != audio_entries_.end(); ++i) {
467 if (controller == i->second->controller.get()) 489 if (controller == i->second->controller.get())
468 return i->second; 490 return i->second;
469 } 491 }
470 return NULL; 492 return NULL;
471 } 493 }
472 494
473 } // namespace content 495 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698