summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host/browser_render_process_host.cc
diff options
context:
space:
mode:
authordglazkov@chromium.org <dglazkov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-05 21:28:51 +0000
committerdglazkov@chromium.org <dglazkov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-05 21:28:51 +0000
commit991cf3c582cf9c8c4ee877349e1cd35ac2b838e9 (patch)
tree688590b7eda16786d4c915baeef7a68b05b22e9a /chrome/browser/renderer_host/browser_render_process_host.cc
parentd59baf73fcb717fab2bbab2d9851bc9da3d5745c (diff)
downloadchromium_src-991cf3c582cf9c8c4ee877349e1cd35ac2b838e9.zip
chromium_src-991cf3c582cf9c8c4ee877349e1cd35ac2b838e9.tar.gz
chromium_src-991cf3c582cf9c8c4ee877349e1cd35ac2b838e9.tar.bz2
Ensure that we never call into WebCore::Page static methods when Page constructor hasn't been called.
This is a top crash for Mac right now. The crash occurs because the static table of all pages in the renderer is initialized in WebCore:: Page constructor, and if we attempt to access this table before the Page was created (i.e. before WebView::Create is called), we get into a crashy situation. I am really not sure how to reproduce this, but I can defend against the situation. BUG=17555 R=darin TEST=unable to repro, speculative fix. Review URL: http://codereview.chromium.org/159887 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22540 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host/browser_render_process_host.cc')
-rw-r--r--chrome/browser/renderer_host/browser_render_process_host.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc
index da11307..1192996 100644
--- a/chrome/browser/renderer_host/browser_render_process_host.cc
+++ b/chrome/browser/renderer_host/browser_render_process_host.cc
@@ -196,6 +196,7 @@ BrowserRenderProcessHost::BrowserRenderProcessHost(Profile* profile)
: RenderProcessHost(profile),
visible_widgets_(0),
backgrounded_(true),
+ view_created_(false),
ALLOW_THIS_IN_INITIALIZER_LIST(cached_dibs_cleaner_(
base::TimeDelta::FromSeconds(5),
this, &BrowserRenderProcessHost::ClearTransportDIBCache)),
@@ -522,11 +523,17 @@ void BrowserRenderProcessHost::ReceivedBadMessage(uint16 msg_type) {
BadMessageTerminateProcess(msg_type, process_.handle());
}
+void BrowserRenderProcessHost::ViewCreated() {
+ view_created_ = true;
+ visited_link_updater_->Update(this);
+}
+
void BrowserRenderProcessHost::WidgetRestored() {
// Verify we were properly backgrounded.
DCHECK_EQ(backgrounded_, (visible_widgets_ == 0));
visible_widgets_++;
- visited_link_updater_->Update(this);
+ if (view_created_)
+ visited_link_updater_->Update(this);
SetBackgrounded(false);
}