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

Unified Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 16267002: Re-fix http://crbug.com/87176, and add a test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Much shorter test Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
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 21c20c9fa3cb30f9d94e39ee60cda8f577ca6f4b..34708a4098caa4692241db0e37cb3f410e982dc9 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -387,6 +387,7 @@ RenderProcessHostImpl::RenderProcessHostImpl(
FROM_HERE, base::TimeDelta::FromSeconds(5),
this, &RenderProcessHostImpl::ClearTransportDIBCache),
is_initialized_(false),
+ child_process_launcher_factory_(base::Bind(&NewChildProcessLauncher)),
id_(ChildProcessHostImpl::GenerateChildProcessUniqueId()),
browser_context_(browser_context),
storage_partition_impl_(storage_partition_impl),
@@ -539,7 +540,7 @@ bool RenderProcessHostImpl::Init() {
// Spawn the child process asynchronously to avoid blocking the UI thread.
// As long as there's no renderer prefix, we can use the zygote process
// at this stage.
- child_process_launcher_.reset(new ChildProcessLauncher(
+ child_process_launcher_ = child_process_launcher_factory_.Run(
#if defined(OS_WIN)
new RendererSandboxedProcessLauncherDelegate,
#elif defined(OS_POSIX)
@@ -549,7 +550,7 @@ bool RenderProcessHostImpl::Init() {
#endif
cmd_line,
GetID(),
- this));
+ this);
fast_shutdown_started_ = false;
}
@@ -605,9 +606,11 @@ void RenderProcessHostImpl::CreateMessageFilters() {
BrowserMainLoop::GetMediaStreamManager();
channel_->AddFilter(new AudioInputRendererHost(audio_manager,
Charlie Reis 2013/06/05 19:07:10 Does this also need to be behind the if?
Jeffrey Yasskin 2013/06/05 21:23:27 The test passes with it outside the if, likely bec
media_stream_manager));
- channel_->AddFilter(new AudioRendererHost(
- GetID(), audio_manager, BrowserMainLoop::GetAudioMirroringManager(),
- media_internals, media_stream_manager));
+ if (audio_manager) {
+ channel_->AddFilter(new AudioRendererHost(
+ GetID(), audio_manager, BrowserMainLoop::GetAudioMirroringManager(),
+ media_internals, media_stream_manager));
+ }
channel_->AddFilter(new VideoCaptureHost());
channel_->AddFilter(new AppCacheDispatcherHost(
storage_partition_impl_->GetAppCacheService(),
@@ -1687,7 +1690,7 @@ void RenderProcessHostImpl::OnShutdownRequest() {
// to close, or if there are pending RenderViews being swapped back in.
// In single process mode, we never shutdown the renderer.
int num_active_views = GetActiveViewCount();
- if (pending_views_ || num_active_views > 1 || run_renderer_in_process())
+ if (pending_views_ || num_active_views > 0 || run_renderer_in_process())
return;
// Notify any contents that might have swapped out renderers from this

Powered by Google App Engine
This is Rietveld 408576698