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

Unified Diff: webkit/glue/webframeloaderclient_impl.cc

Issue 46026: Get rid of stashing a frame pointer with ResourceRequest and just store the r... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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 | « webkit/glue/unittest_test_server.h ('k') | webkit/glue/webplugin_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webframeloaderclient_impl.cc
===================================================================
--- webkit/glue/webframeloaderclient_impl.cc (revision 11712)
+++ webkit/glue/webframeloaderclient_impl.cc (working copy)
@@ -189,14 +189,22 @@
void WebFrameLoaderClient::dispatchWillSendRequest(
DocumentLoader* loader, unsigned long identifier, ResourceRequest& request,
const ResourceResponse& redirectResponse) {
- // We set the Frame on the ResourceRequest to provide load context to the
- // ResourceHandle implementation.
- request.setFrame(webframe_->frame());
- // We want to distinguish between a request for a document to be loaded into
- // the main frame, a sub-frame, or the sub-objects in that document.
- request.setTargetType(DetermineTargetTypeFromLoader(loader));
+ if (loader) {
+ // We want to distinguish between a request for a document to be loaded into
+ // the main frame, a sub-frame, or the sub-objects in that document.
+ request.setTargetType(DetermineTargetTypeFromLoader(loader));
+ }
+ // Inherit the policy URL from the request's frame. However, if the request
+ // is for a main frame, the current document's policyBaseURL is the old
+ // document, so we leave policyURL empty to indicate that the request is a
+ // first-party request.
+ if (request.targetType() != ResourceRequest::TargetIsMainFrame &&
+ webframe_->frame()->document()) {
+ request.setPolicyURL(webframe_->frame()->document()->policyBaseURL());
+ }
+
// FrameLoader::loadEmptyDocumentSynchronously() creates an empty document
// with no URL. We don't like that, so we'll rename it to about:blank.
if (request.url().isEmpty())
« no previous file with comments | « webkit/glue/unittest_test_server.h ('k') | webkit/glue/webplugin_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698