summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjaphet@chromium.org <japhet@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-21 20:40:10 +0000
committerjaphet@chromium.org <japhet@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-21 20:40:10 +0000
commit8128cdd0c2540ccd2c6eded74a397f80b0937913 (patch)
tree59467c28b3f36a9cf29fb5da40d2c295c422c299
parenta4db67d8bcfc6174c887e895b88d19efeea3d31d (diff)
downloadchromium_src-8128cdd0c2540ccd2c6eded74a397f80b0937913.zip
chromium_src-8128cdd0c2540ccd2c6eded74a397f80b0937913.tar.gz
chromium_src-8128cdd0c2540ccd2c6eded74a397f80b0937913.tar.bz2
If we're setting a frame's content settings based on its opener,
null check the opener's WebView before using it. BUG=42974 TEST=Flaky, no known repro steps Review URL: http://codereview.chromium.org/2850037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53240 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/renderer/render_view.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index d9360c6..917afe3 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -1301,9 +1301,12 @@ void RenderView::UpdateURL(WebFrame* frame) {
// browser will send us new, up-to-date content settings.
host_content_settings_.erase(host_content_settings);
} else if (frame->opener()) {
- WebView* opener_view = frame->opener()->view();
- RenderView* opener = FromWebView(opener_view);
- SetContentSettings(opener->current_content_settings_);
+ // The opener's view is not guaranteed to be non-null (it could be
+ // detached from its page but not yet destructed).
+ if (WebView* opener_view = frame->opener()->view()) {
+ RenderView* opener = FromWebView(opener_view);
+ SetContentSettings(opener->current_content_settings_);
+ }
}
// Set zoom level.