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

Unified Diff: content/shell/shell_content_browser_client.cc

Issue 16023012: [content shell] protect against the case when a RPH dies before the process launched (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/shell_content_browser_client.cc
diff --git a/content/shell/shell_content_browser_client.cc b/content/shell/shell_content_browser_client.cc
index 54c424a040689d093c28edeab8029b9ed65f9d7f..6993f3162ea41d297d91720e8dbe6ebe335db955 100644
--- a/content/shell/shell_content_browser_client.cc
+++ b/content/shell/shell_content_browser_client.cc
@@ -91,6 +91,9 @@ void ShellContentBrowserClient::RenderProcessHostCreated(
registrar_.Add(this,
NOTIFICATION_RENDERER_PROCESS_CREATED,
Source<RenderProcessHost>(host));
+ registrar_.Add(this,
+ NOTIFICATION_RENDERER_PROCESS_TERMINATED,
+ Source<RenderProcessHost>(host));
}
net::URLRequestContextGetter* ShellContentBrowserClient::CreateRequestContext(
@@ -212,6 +215,9 @@ void ShellContentBrowserClient::Observe(int type,
registrar_.Remove(this,
NOTIFICATION_RENDERER_PROCESS_CREATED,
source);
+ registrar_.Remove(this,
+ NOTIFICATION_RENDERER_PROCESS_TERMINATED,
+ source);
if (hyphen_dictionary_file_ != base::kInvalidPlatformFileValue) {
RenderProcessHost* host = Source<RenderProcessHost>(source).ptr();
IPC::PlatformFileForTransit file = IPC::GetFileHandleForProcess(
@@ -221,6 +227,16 @@ void ShellContentBrowserClient::Observe(int type,
break;
}
+ case NOTIFICATION_RENDERER_PROCESS_TERMINATED: {
+ registrar_.Remove(this,
+ NOTIFICATION_RENDERER_PROCESS_CREATED,
+ source);
+ registrar_.Remove(this,
+ NOTIFICATION_RENDERER_PROCESS_TERMINATED,
+ source);
+ break;
+ }
+
default:
NOTREACHED();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698