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

Unified Diff: content/renderer/media/media_stream_dependency_factory.cc

Issue 101063003: Add browser test for AEC dump. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/media/media_stream_dependency_factory.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/media_stream_dependency_factory.cc
diff --git a/content/renderer/media/media_stream_dependency_factory.cc b/content/renderer/media/media_stream_dependency_factory.cc
index 33b8011041771482216496b0484d72a482baebaa..e87c7548a9d52df940b924803775186a4870ec79 100644
--- a/content/renderer/media/media_stream_dependency_factory.cc
+++ b/content/renderer/media/media_stream_dependency_factory.cc
@@ -672,14 +672,7 @@ bool MediaStreamDependencyFactory::CreatePeerConnectionFactory() {
// |aec_dump_file| will be invalid when dump is not enabled.
if (aec_dump_file_ != base::kInvalidPlatformFileValue) {
- FILE* aec_dump_file_stream = base::FdopenPlatformFile(aec_dump_file_, "w");
- if (!aec_dump_file_stream) {
- VLOG(1) << "Could not open AEC dump file.";
- base::ClosePlatformFile(aec_dump_file_);
- } else {
- // |pc_factory_| takes ownership of |aec_dump_file_stream|.
- pc_factory_->StartAecDump(aec_dump_file_stream);
- }
+ StartAecDump(aec_dump_file_);
aec_dump_file_ = base::kInvalidPlatformFileValue;
}
@@ -1027,8 +1020,15 @@ bool MediaStreamDependencyFactory::OnControlMessageReceived(
void MediaStreamDependencyFactory::OnAecDumpFile(
IPC::PlatformFileForTransit file_handle) {
DCHECK_EQ(aec_dump_file_, base::kInvalidPlatformFileValue);
- aec_dump_file_ = IPC::PlatformFileForTransitToPlatformFile(file_handle);
- DCHECK_NE(aec_dump_file_, base::kInvalidPlatformFileValue);
+ if (PeerConnectionFactoryCreated()) {
+ base::PlatformFile file =
+ IPC::PlatformFileForTransitToPlatformFile(file_handle);
+ DCHECK_NE(file, base::kInvalidPlatformFileValue);
+ StartAecDump(file);
+ } else {
+ aec_dump_file_ = IPC::PlatformFileForTransitToPlatformFile(file_handle);
+ DCHECK_NE(aec_dump_file_, base::kInvalidPlatformFileValue);
+ }
}
void MediaStreamDependencyFactory::OnDisableAecDump() {
@@ -1037,4 +1037,16 @@ void MediaStreamDependencyFactory::OnDisableAecDump() {
aec_dump_file_ = base::kInvalidPlatformFileValue;
}
+void MediaStreamDependencyFactory::StartAecDump(
+ const base::PlatformFile& aec_dump_file) {
+ FILE* aec_dump_file_stream = base::FdopenPlatformFile(aec_dump_file, "w");
+ if (!aec_dump_file_stream) {
+ VLOG(1) << "Could not open AEC dump file.";
+ base::ClosePlatformFile(aec_dump_file);
+ } else {
+ // |pc_factory_| takes ownership of |aec_dump_file_stream|.
+ pc_factory_->StartAecDump(aec_dump_file_stream);
+ }
+}
+
} // namespace content
« no previous file with comments | « content/renderer/media/media_stream_dependency_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698