Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/files/file.h" | |
| 9 #include "base/memory/ref_counted.h" | |
| 8 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
| 9 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
| 10 #include "base/numerics/safe_math.h" | 12 #include "base/numerics/safe_math.h" |
| 11 #include "base/process/process.h" | 13 #include "base/process/process.h" |
| 14 #include "base/strings/string_number_conversions.h" | |
| 12 #include "base/strings/stringprintf.h" | 15 #include "base/strings/stringprintf.h" |
| 13 #include "content/browser/media/capture/web_contents_audio_input_stream.h" | 16 #include "content/browser/media/capture/web_contents_audio_input_stream.h" |
| 14 #include "content/browser/media/capture/web_contents_capture_util.h" | 17 #include "content/browser/media/capture/web_contents_capture_util.h" |
| 15 #include "content/browser/media/media_internals.h" | 18 #include "content/browser/media/media_internals.h" |
| 19 #include "content/browser/media/webrtc_internals.h" | |
| 20 #include "content/browser/renderer_host/media/audio_input_debug_writer.h" | |
| 16 #include "content/browser/renderer_host/media/audio_input_device_manager.h" | 21 #include "content/browser/renderer_host/media/audio_input_device_manager.h" |
| 17 #include "content/browser/renderer_host/media/audio_input_sync_writer.h" | 22 #include "content/browser/renderer_host/media/audio_input_sync_writer.h" |
| 18 #include "content/browser/renderer_host/media/media_stream_manager.h" | 23 #include "content/browser/renderer_host/media/media_stream_manager.h" |
| 19 #include "media/audio/audio_manager_base.h" | 24 #include "media/audio/audio_manager_base.h" |
| 20 #include "media/base/audio_bus.h" | 25 #include "media/base/audio_bus.h" |
| 21 | 26 |
| 27 namespace content { | |
| 28 | |
| 22 namespace { | 29 namespace { |
| 23 | 30 |
| 31 const base::FilePath::CharType kDebugRecordingFileNameAddition[] = | |
| 32 FILE_PATH_LITERAL("source_input"); | |
| 33 const base::FilePath::CharType kDebugRecordingFileNameExtension[] = | |
| 34 FILE_PATH_LITERAL("pcm"); | |
| 35 | |
| 24 void LogMessage(int stream_id, const std::string& msg, bool add_prefix) { | 36 void LogMessage(int stream_id, const std::string& msg, bool add_prefix) { |
| 25 std::ostringstream oss; | 37 std::ostringstream oss; |
| 26 oss << "[stream_id=" << stream_id << "] "; | 38 oss << "[stream_id=" << stream_id << "] "; |
| 27 if (add_prefix) | 39 if (add_prefix) |
| 28 oss << "AIRH::"; | 40 oss << "AIRH::"; |
| 29 oss << msg; | 41 oss << msg; |
| 30 content::MediaStreamManager::SendMessageToNativeLog(oss.str()); | 42 content::MediaStreamManager::SendMessageToNativeLog(oss.str()); |
| 31 DVLOG(1) << oss.str(); | 43 DVLOG(1) << oss.str(); |
| 32 } | 44 } |
| 33 | 45 |
| 46 base::File CreateDebugRecordingFile(base::FilePath file_path) { | |
| 47 DCHECK_CURRENTLY_ON(BrowserThread::FILE); | |
| 48 base::File recording_file( | |
| 49 file_path, base::File::FLAG_OPEN_ALWAYS | base::File::FLAG_APPEND); | |
| 50 PLOG_IF(ERROR, !recording_file.IsValid()) | |
| 51 << "Could not open debug recording file, error=" | |
| 52 << recording_file.error_details(); | |
| 53 return recording_file.Pass(); | |
| 54 } | |
| 55 | |
| 56 void CloseFile(base::File file) { | |
| 57 DCHECK_CURRENTLY_ON(BrowserThread::FILE); | |
| 58 // |file| must be closed and destroyed on FILE thread. | |
| 59 } | |
| 60 | |
| 61 void DeleteInputDebugWriterOnFileThread( | |
| 62 scoped_ptr<AudioInputDebugWriter> writer) { | |
| 63 DCHECK_CURRENTLY_ON(BrowserThread::FILE); | |
| 64 // |writer| must be closed and destroyed on FILE thread. | |
| 65 } | |
| 66 | |
| 34 } // namespace | 67 } // namespace |
| 35 | 68 |
| 36 namespace content { | |
| 37 | |
| 38 struct AudioInputRendererHost::AudioEntry { | 69 struct AudioInputRendererHost::AudioEntry { |
| 39 AudioEntry(); | 70 AudioEntry(); |
| 40 ~AudioEntry(); | 71 ~AudioEntry(); |
| 41 | 72 |
| 42 // The AudioInputController that manages the audio input stream. | 73 // The AudioInputController that manages the audio input stream. |
| 43 scoped_refptr<media::AudioInputController> controller; | 74 scoped_refptr<media::AudioInputController> controller; |
| 44 | 75 |
| 45 // The audio input stream ID in the render view. | 76 // The audio input stream ID in the render view. |
| 46 int stream_id; | 77 int stream_id; |
| 47 | 78 |
| 48 // Shared memory for transmission of the audio data. It has | 79 // Shared memory for transmission of the audio data. It has |
| 49 // |shared_memory_segment_count| equal lengthed segments. | 80 // |shared_memory_segment_count| equal lengthed segments. |
| 50 base::SharedMemory shared_memory; | 81 base::SharedMemory shared_memory; |
| 51 int shared_memory_segment_count; | 82 int shared_memory_segment_count; |
| 52 | 83 |
| 53 // The synchronous writer to be used by the controller. We have the | 84 // The synchronous writer to be used by the controller. We have the |
| 54 // ownership of the writer. | 85 // ownership of the writer. |
| 55 scoped_ptr<media::AudioInputController::SyncWriter> writer; | 86 scoped_ptr<media::AudioInputController::SyncWriter> writer; |
| 56 | 87 |
| 88 // Must be deleted on the file thread. Must be posted for deletion and nulled | |
| 89 // before the AudioEntry is deleted. | |
| 90 scoped_ptr<AudioInputDebugWriter> input_debug_writer; | |
| 91 | |
| 57 // Set to true after we called Close() for the controller. | 92 // Set to true after we called Close() for the controller. |
| 58 bool pending_close; | 93 bool pending_close; |
| 59 | 94 |
| 60 // If this entry's layout has a keyboard mic channel. | 95 // If this entry's layout has a keyboard mic channel. |
| 61 bool has_keyboard_mic_; | 96 bool has_keyboard_mic; |
| 62 }; | 97 }; |
| 63 | 98 |
| 64 AudioInputRendererHost::AudioEntry::AudioEntry() | 99 AudioInputRendererHost::AudioEntry::AudioEntry() |
| 65 : stream_id(0), | 100 : stream_id(0), |
| 66 shared_memory_segment_count(0), | 101 shared_memory_segment_count(0), |
| 67 pending_close(false), | 102 pending_close(false), |
| 68 has_keyboard_mic_(false) { | 103 has_keyboard_mic(false) { |
| 69 } | 104 } |
| 70 | 105 |
| 71 AudioInputRendererHost::AudioEntry::~AudioEntry() {} | 106 AudioInputRendererHost::AudioEntry::~AudioEntry() { |
| 107 DCHECK(!input_debug_writer.get()); | |
| 108 } | |
| 72 | 109 |
| 73 AudioInputRendererHost::AudioInputRendererHost( | 110 AudioInputRendererHost::AudioInputRendererHost( |
| 74 int render_process_id, | 111 int render_process_id, |
| 112 int32 renderer_pid, | |
| 75 media::AudioManager* audio_manager, | 113 media::AudioManager* audio_manager, |
| 76 MediaStreamManager* media_stream_manager, | 114 MediaStreamManager* media_stream_manager, |
| 77 AudioMirroringManager* audio_mirroring_manager, | 115 AudioMirroringManager* audio_mirroring_manager, |
| 78 media::UserInputMonitor* user_input_monitor) | 116 media::UserInputMonitor* user_input_monitor) |
| 79 : BrowserMessageFilter(AudioMsgStart), | 117 : BrowserMessageFilter(AudioMsgStart), |
| 80 render_process_id_(render_process_id), | 118 render_process_id_(render_process_id), |
| 119 renderer_pid_(renderer_pid), | |
| 81 audio_manager_(audio_manager), | 120 audio_manager_(audio_manager), |
| 82 media_stream_manager_(media_stream_manager), | 121 media_stream_manager_(media_stream_manager), |
| 83 audio_mirroring_manager_(audio_mirroring_manager), | 122 audio_mirroring_manager_(audio_mirroring_manager), |
| 84 user_input_monitor_(user_input_monitor), | 123 user_input_monitor_(user_input_monitor), |
| 85 audio_log_(MediaInternals::GetInstance()->CreateAudioLog( | 124 audio_log_(MediaInternals::GetInstance()->CreateAudioLog( |
| 86 media::AudioLogFactory::AUDIO_INPUT_CONTROLLER)) {} | 125 media::AudioLogFactory::AUDIO_INPUT_CONTROLLER)), |
| 126 weak_factory_(this) {} | |
| 87 | 127 |
| 88 AudioInputRendererHost::~AudioInputRendererHost() { | 128 AudioInputRendererHost::~AudioInputRendererHost() { |
| 89 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 129 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 90 DCHECK(audio_entries_.empty()); | 130 DCHECK(audio_entries_.empty()); |
| 91 } | 131 } |
| 92 | 132 |
| 133 void AudioInputRendererHost::EnableDebugRecording(const base::FilePath& file) { | |
| 134 DCHECK_CURRENTLY_ON(BrowserThread::IO); | |
| 135 base::FilePath file_with_extensions = | |
| 136 GetDebugRecordingFilePathWithExtensions(file); | |
| 137 for (const auto& entry : audio_entries_) | |
| 138 EnabledDebugRecordingForId(file_with_extensions, entry.first); | |
| 139 } | |
| 140 | |
| 141 void AudioInputRendererHost::DisableDebugRecording() { | |
| 142 for (const auto& entry : audio_entries_) { | |
| 143 entry.second->controller->DisableDebugRecording( | |
| 144 base::Bind(&AudioInputRendererHost::DeleteDebugWriter, | |
| 145 this, | |
| 146 entry.first)); | |
| 147 } | |
| 148 } | |
| 149 | |
| 93 void AudioInputRendererHost::OnChannelClosing() { | 150 void AudioInputRendererHost::OnChannelClosing() { |
| 94 // Since the IPC sender is gone, close all requested audio streams. | 151 // Since the IPC sender is gone, close all requested audio streams. |
| 95 DeleteEntries(); | 152 DeleteEntries(); |
| 96 } | 153 } |
| 97 | 154 |
| 98 void AudioInputRendererHost::OnDestruct() const { | 155 void AudioInputRendererHost::OnDestruct() const { |
| 99 BrowserThread::DeleteOnIOThread::Destruct(this); | 156 BrowserThread::DeleteOnIOThread::Destruct(this); |
| 100 } | 157 } |
| 101 | 158 |
| 102 void AudioInputRendererHost::OnCreated( | 159 void AudioInputRendererHost::OnCreated( |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 141 void AudioInputRendererHost::OnLog(media::AudioInputController* controller, | 198 void AudioInputRendererHost::OnLog(media::AudioInputController* controller, |
| 142 const std::string& message) { | 199 const std::string& message) { |
| 143 BrowserThread::PostTask(BrowserThread::IO, | 200 BrowserThread::PostTask(BrowserThread::IO, |
| 144 FROM_HERE, | 201 FROM_HERE, |
| 145 base::Bind(&AudioInputRendererHost::DoLog, | 202 base::Bind(&AudioInputRendererHost::DoLog, |
| 146 this, | 203 this, |
| 147 make_scoped_refptr(controller), | 204 make_scoped_refptr(controller), |
| 148 message)); | 205 message)); |
| 149 } | 206 } |
| 150 | 207 |
| 208 void AudioInputRendererHost::set_renderer_pid(int32 renderer_pid) { | |
| 209 DCHECK_CURRENTLY_ON(BrowserThread::IO); | |
| 210 renderer_pid_ = renderer_pid; | |
|
tommi (sloooow) - chröme
2015/08/31 17:19:07
Do we need to DCHECK() some state before assigning
Henrik Grunell
2015/09/04 12:37:37
No. Anything particular in mind?
| |
| 211 } | |
| 212 | |
| 151 void AudioInputRendererHost::DoCompleteCreation( | 213 void AudioInputRendererHost::DoCompleteCreation( |
| 152 media::AudioInputController* controller) { | 214 media::AudioInputController* controller) { |
| 153 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 215 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 154 | 216 |
| 155 AudioEntry* entry = LookupByController(controller); | 217 AudioEntry* entry = LookupByController(controller); |
| 156 if (!entry) { | 218 if (!entry) { |
| 157 NOTREACHED() << "AudioInputController is invalid."; | 219 NOTREACHED() << "AudioInputController is invalid."; |
| 158 return; | 220 return; |
| 159 } | 221 } |
| 160 | 222 |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 402 | 464 |
| 403 if (!entry->controller.get()) { | 465 if (!entry->controller.get()) { |
| 404 SendErrorMessage(stream_id, STREAM_CREATE_ERROR); | 466 SendErrorMessage(stream_id, STREAM_CREATE_ERROR); |
| 405 MaybeUnregisterKeyboardMicStream(config); | 467 MaybeUnregisterKeyboardMicStream(config); |
| 406 return; | 468 return; |
| 407 } | 469 } |
| 408 | 470 |
| 409 #if defined(OS_CHROMEOS) | 471 #if defined(OS_CHROMEOS) |
| 410 if (config.params.channel_layout() == | 472 if (config.params.channel_layout() == |
| 411 media::CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC) { | 473 media::CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC) { |
| 412 entry->has_keyboard_mic_ = true; | 474 entry->has_keyboard_mic = true; |
| 413 } | 475 } |
| 414 #endif | 476 #endif |
| 415 | 477 |
| 416 MediaStreamManager::SendMessageToNativeLog(oss.str()); | 478 MediaStreamManager::SendMessageToNativeLog(oss.str()); |
| 417 DVLOG(1) << oss.str(); | 479 DVLOG(1) << oss.str(); |
| 418 | 480 |
| 419 // Since the controller was created successfully, create an entry and add it | 481 // Since the controller was created successfully, create an entry and add it |
| 420 // to the map. | 482 // to the map. |
| 421 entry->stream_id = stream_id; | 483 entry->stream_id = stream_id; |
| 422 audio_entries_.insert(std::make_pair(stream_id, entry.release())); | 484 audio_entries_.insert(std::make_pair(stream_id, entry.release())); |
| 423 audio_log_->OnCreated(stream_id, audio_params, device_id); | 485 audio_log_->OnCreated(stream_id, audio_params, device_id); |
| 424 MediaInternals::GetInstance()->SetWebContentsTitleForAudioLogEntry( | 486 MediaInternals::GetInstance()->SetWebContentsTitleForAudioLogEntry( |
| 425 stream_id, render_process_id_, render_frame_id, audio_log_.get()); | 487 stream_id, render_process_id_, render_frame_id, audio_log_.get()); |
| 488 | |
| 489 BrowserThread::PostTask( | |
| 490 BrowserThread::UI, | |
| 491 FROM_HERE, | |
| 492 base::Bind( | |
| 493 &AudioInputRendererHost::MaybeEnableDebugRecordingForId, | |
| 494 this, | |
| 495 stream_id)); | |
| 426 } | 496 } |
| 427 | 497 |
| 428 void AudioInputRendererHost::OnRecordStream(int stream_id) { | 498 void AudioInputRendererHost::OnRecordStream(int stream_id) { |
| 429 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 499 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 430 LogMessage(stream_id, "OnRecordStream", true); | 500 LogMessage(stream_id, "OnRecordStream", true); |
| 431 | 501 |
| 432 AudioEntry* entry = LookupById(stream_id); | 502 AudioEntry* entry = LookupById(stream_id); |
| 433 if (!entry) { | 503 if (!entry) { |
| 434 SendErrorMessage(stream_id, INVALID_AUDIO_ENTRY); | 504 SendErrorMessage(stream_id, INVALID_AUDIO_ENTRY); |
| 435 return; | 505 return; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 491 entry->pending_close = true; | 561 entry->pending_close = true; |
| 492 audio_log_->OnClosed(entry->stream_id); | 562 audio_log_->OnClosed(entry->stream_id); |
| 493 } | 563 } |
| 494 } | 564 } |
| 495 | 565 |
| 496 void AudioInputRendererHost::DeleteEntry(AudioEntry* entry) { | 566 void AudioInputRendererHost::DeleteEntry(AudioEntry* entry) { |
| 497 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 567 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 498 LogMessage(entry->stream_id, "DeleteEntry: stream is now closed", true); | 568 LogMessage(entry->stream_id, "DeleteEntry: stream is now closed", true); |
| 499 | 569 |
| 500 #if defined(OS_CHROMEOS) | 570 #if defined(OS_CHROMEOS) |
| 501 if (entry->has_keyboard_mic_) { | 571 if (entry->has_keyboard_mic) { |
| 502 media_stream_manager_->audio_input_device_manager() | 572 media_stream_manager_->audio_input_device_manager() |
| 503 ->UnregisterKeyboardMicStream(); | 573 ->UnregisterKeyboardMicStream(); |
| 504 } | 574 } |
| 505 #endif | 575 #endif |
| 506 | 576 |
| 577 if (entry->input_debug_writer.get()) { | |
| 578 BrowserThread::PostTask( | |
| 579 BrowserThread::FILE, | |
| 580 FROM_HERE, | |
| 581 base::Bind(&DeleteInputDebugWriterOnFileThread, | |
| 582 base::Passed(entry->input_debug_writer.Pass()))); | |
| 583 } | |
| 584 | |
| 507 // Delete the entry when this method goes out of scope. | 585 // Delete the entry when this method goes out of scope. |
| 508 scoped_ptr<AudioEntry> entry_deleter(entry); | 586 scoped_ptr<AudioEntry> entry_deleter(entry); |
| 509 | 587 |
| 510 // Erase the entry from the map. | 588 // Erase the entry from the map. |
| 511 audio_entries_.erase(entry->stream_id); | 589 audio_entries_.erase(entry->stream_id); |
| 512 } | 590 } |
| 513 | 591 |
| 514 void AudioInputRendererHost::DeleteEntryOnError(AudioEntry* entry, | 592 void AudioInputRendererHost::DeleteEntryOnError(AudioEntry* entry, |
| 515 ErrorCode error_code) { | 593 ErrorCode error_code) { |
| 516 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 594 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 549 const AudioInputHostMsg_CreateStream_Config& config) { | 627 const AudioInputHostMsg_CreateStream_Config& config) { |
| 550 #if defined(OS_CHROMEOS) | 628 #if defined(OS_CHROMEOS) |
| 551 if (config.params.channel_layout() == | 629 if (config.params.channel_layout() == |
| 552 media::CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC) { | 630 media::CHANNEL_LAYOUT_STEREO_AND_KEYBOARD_MIC) { |
| 553 media_stream_manager_->audio_input_device_manager() | 631 media_stream_manager_->audio_input_device_manager() |
| 554 ->UnregisterKeyboardMicStream(); | 632 ->UnregisterKeyboardMicStream(); |
| 555 } | 633 } |
| 556 #endif | 634 #endif |
| 557 } | 635 } |
| 558 | 636 |
| 637 void AudioInputRendererHost::MaybeEnableDebugRecordingForId(int stream_id) { | |
| 638 DCHECK_CURRENTLY_ON(BrowserThread::UI); | |
| 639 if (WebRTCInternals::GetInstance()->IsAudioDebugRecordingsEnabled()) { | |
| 640 BrowserThread::PostTask( | |
| 641 BrowserThread::IO, | |
| 642 FROM_HERE, | |
| 643 base::Bind( | |
| 644 &AudioInputRendererHost::EnabledDebugRecordingForId, | |
| 645 this, | |
| 646 GetDebugRecordingFilePathWithExtensions( | |
| 647 WebRTCInternals::GetInstance()-> | |
| 648 GetAudioDebugRecordingsFilePath()), | |
| 649 stream_id)); | |
| 650 } | |
| 651 } | |
| 652 | |
| 653 #if defined(OS_WIN) | |
| 654 #define IntToStringType base::IntToString16 | |
| 655 #else | |
| 656 #define IntToStringType base::IntToString | |
| 657 #endif | |
| 658 | |
| 659 base::FilePath AudioInputRendererHost::GetDebugRecordingFilePathWithExtensions( | |
| 660 const base::FilePath& file) { | |
| 661 return file.AddExtension(IntToStringType(renderer_pid_)) | |
| 662 .AddExtension(kDebugRecordingFileNameAddition); | |
| 663 } | |
| 664 | |
| 665 void AudioInputRendererHost::EnabledDebugRecordingForId( | |
| 666 const base::FilePath& file, | |
| 667 int stream_id) { | |
| 668 DCHECK_CURRENTLY_ON(BrowserThread::IO); | |
| 669 BrowserThread::PostTaskAndReplyWithResult( | |
| 670 BrowserThread::FILE, | |
| 671 FROM_HERE, | |
| 672 base::Bind( | |
| 673 &CreateDebugRecordingFile, | |
| 674 file.AddExtension(IntToStringType(stream_id)) | |
| 675 .AddExtension(kDebugRecordingFileNameExtension)), | |
| 676 base::Bind( | |
| 677 &AudioInputRendererHost::DoEnableDebugRecording, | |
| 678 weak_factory_.GetWeakPtr(), | |
| 679 stream_id)); | |
| 680 } | |
| 681 | |
| 682 #undef IntToStringType | |
| 683 | |
| 684 void AudioInputRendererHost::DoEnableDebugRecording( | |
| 685 int stream_id, | |
| 686 base::File file) { | |
| 687 DCHECK_CURRENTLY_ON(BrowserThread::IO); | |
| 688 if (!file.IsValid()) | |
| 689 return; | |
| 690 AudioEntry* entry = LookupById(stream_id); | |
| 691 if (!entry) { | |
| 692 BrowserThread::PostTask( | |
| 693 BrowserThread::FILE, | |
| 694 FROM_HERE, | |
| 695 base::Bind( | |
| 696 &CloseFile, | |
| 697 Passed(file.Pass()))); | |
| 698 return; | |
| 699 } | |
| 700 entry->input_debug_writer.reset(new AudioInputDebugWriter(file.Pass())); | |
| 701 entry->controller->EnableDebugRecording(entry->input_debug_writer.get()); | |
| 702 } | |
| 703 | |
| 704 void AudioInputRendererHost::DeleteDebugWriter(int stream_id) { | |
| 705 DCHECK_CURRENTLY_ON(BrowserThread::IO); | |
| 706 AudioEntry* entry = LookupById(stream_id); | |
| 707 if (!entry) { | |
| 708 // This happens if DisableDebugRecording is called right after | |
| 709 // DeleteEntries. | |
| 710 return; | |
| 711 } | |
| 712 | |
| 713 if (entry->input_debug_writer.get()) { | |
| 714 BrowserThread::PostTask( | |
| 715 BrowserThread::FILE, | |
| 716 FROM_HERE, | |
| 717 base::Bind(&DeleteInputDebugWriterOnFileThread, | |
| 718 base::Passed(entry->input_debug_writer.Pass()))); | |
| 719 } | |
| 720 } | |
| 721 | |
| 559 } // namespace content | 722 } // namespace content |
| OLD | NEW |