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

Unified Diff: content/browser/renderer_host/render_process_host_impl.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/browser/renderer_host/render_process_host_impl.h ('k') | content/content_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_process_host_impl.cc
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 279ca21b3bb5303ef0b6233f0375f20efcafa935..13715c3959d3ade61aa51f00802e803441f47f49 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -214,6 +214,12 @@ IPC::PlatformFileForTransit CreateAecDumpFileForProcess(
}
return IPC::GetFileHandleForProcess(aec_dump_file, process, true);
}
+
+// Does nothing. Just to avoid races between enable and disable.
+void DisableAecDumpOnFileThread() {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+}
+
#endif
// the global list of all renderer processes
@@ -1516,7 +1522,14 @@ void RenderProcessHostImpl::EnableAecDump(const base::FilePath& file) {
}
void RenderProcessHostImpl::DisableAecDump() {
- Send(new MediaStreamMsg_DisableAecDump());
+ // Posting on the FILE thread and then replying back on the UI thread is only
+ // for avoiding races between enable and disable. Nothing is done on the FILE
+ // thread.
+ BrowserThread::PostTaskAndReply(
+ BrowserThread::FILE, FROM_HERE,
+ base::Bind(&DisableAecDumpOnFileThread),
+ base::Bind(&RenderProcessHostImpl::SendDisableAecDumpToRenderer,
+ weak_factory_.GetWeakPtr()));
}
#endif
@@ -1964,6 +1977,10 @@ void RenderProcessHostImpl::SendAecDumpFileToRenderer(
return;
Send(new MediaStreamMsg_EnableAecDump(file_for_transit));
}
+
+void RenderProcessHostImpl::SendDisableAecDumpToRenderer() {
+ Send(new MediaStreamMsg_DisableAecDump());
+}
#endif
} // namespace content
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.h ('k') | content/content_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698