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 96e5de52f772ac24f468439860f80c9073f3f8e1..0b06ef8a497b1da2a37550606cd5993771176490 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), |
jochen (gone - plz use gerrit)
2013/12/19 12:41:06
would it be enough to create an empty base::Closur
Henrik Grunell
2013/12/19 13:46:10
Well, it just crashes for me. Is that supposed to
|
+ 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 |