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

Unified Diff: chrome/renderer/render_view.cc

Issue 2850037: If we're setting a frame's content settings based on its opener,... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 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
« 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: chrome/renderer/render_view.cc
===================================================================
--- chrome/renderer/render_view.cc (revision 51289)
+++ chrome/renderer/render_view.cc (working copy)
@@ -1294,9 +1294,12 @@
// 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.
« 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