summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorachuith@chromium.org <achuith@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-12 21:12:07 +0000
committerachuith@chromium.org <achuith@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-12 21:12:07 +0000
commit8909be9febb02000f0b600b3bf0b85db92377a4a (patch)
treec8e91d86429802e7ff6889ed49f8bbd1bdff368f /content
parentd4a60f6f6015645e4ca04728916ee4177bda1bd6 (diff)
downloadchromium_src-8909be9febb02000f0b600b3bf0b85db92377a4a.zip
chromium_src-8909be9febb02000f0b600b3bf0b85db92377a4a.tar.gz
chromium_src-8909be9febb02000f0b600b3bf0b85db92377a4a.tar.bz2
Fix a race where Init gets called right after FastShutdownIfPossible before channel_ has been reset by OnChannelError after a round-trip.
BUG=chromium-os:18390 TEST=Open a new tab on cros. Close all other tabs. Navigate to google.com. Close the tab. Should no longer see the sad tab. Review URL: http://codereview.chromium.org/7864019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100765 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/browser/renderer_host/browser_render_process_host.cc5
-rw-r--r--content/browser/renderer_host/browser_render_process_host.h3
2 files changed, 8 insertions, 0 deletions
diff --git a/content/browser/renderer_host/browser_render_process_host.cc b/content/browser/renderer_host/browser_render_process_host.cc
index 3784d322..67e180d 100644
--- a/content/browser/renderer_host/browser_render_process_host.cc
+++ b/content/browser/renderer_host/browser_render_process_host.cc
@@ -657,6 +657,7 @@ bool BrowserRenderProcessHost::FastShutdownIfPossible() {
return false;
child_process_launcher_.reset();
+ ProcessDied();
fast_shutdown_started_ = true;
return true;
}
@@ -806,6 +807,10 @@ void BrowserRenderProcessHost::OnChannelConnected(int32 peer_pid) {
}
void BrowserRenderProcessHost::OnChannelError() {
+ ProcessDied();
+}
+
+void BrowserRenderProcessHost::ProcessDied() {
// Our child process has died. If we didn't expect it, it's a crash.
// In any case, we need to let everyone know it's gone.
// The OnChannelError notification can fire multiple times due to nested sync
diff --git a/content/browser/renderer_host/browser_render_process_host.h b/content/browser/renderer_host/browser_render_process_host.h
index 2f657ab..8e95b02 100644
--- a/content/browser/renderer_host/browser_render_process_host.h
+++ b/content/browser/renderer_host/browser_render_process_host.h
@@ -102,6 +102,9 @@ class BrowserRenderProcessHost : public RenderProcessHost,
// Callers can reduce the RenderProcess' priority.
void SetBackgrounded(bool backgrounded);
+ // Handle termination of our process.
+ void ProcessDied();
+
// The count of currently visible widgets. Since the host can be a container
// for multiple widgets, it uses this count to determine when it should be
// backgrounded.