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

Unified Diff: Source/WebCore/loader/Prerenderer.cpp

Issue 10824152: Merge 123798 - Guard Prerenderer against inserting prerenders into detached documents. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1180/
Patch Set: Created 8 years, 5 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 | « Source/WebCore/ChangeLog ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/loader/Prerenderer.cpp
===================================================================
--- Source/WebCore/loader/Prerenderer.cpp (revision 124493)
+++ Source/WebCore/loader/Prerenderer.cpp (working copy)
@@ -72,6 +72,10 @@
// Prerenders are unlike requests in most ways (for instance, they pass down fragments, and they don't return data),
// but they do have referrers.
const ReferrerPolicy referrerPolicy = document()->referrerPolicy();
+
+ if (!document()->frame())
+ return 0;
+
const String referrer = SecurityPolicy::generateReferrerHeader(referrerPolicy, url, document()->frame()->loader()->outgoingReferrer());
RefPtr<PrerenderHandle> prerenderHandle = PrerenderHandle::create(url, referrer, referrerPolicy);
« no previous file with comments | « Source/WebCore/ChangeLog ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698