summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webframeloaderclient_impl.cc
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-16 19:58:08 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-16 19:58:08 +0000
commit5b35a6be09ab4a22ed9c5e0a073463a2ef630ec5 (patch)
tree00bdf30d37b70e4f3b027c7a5dc49784e08be98b /webkit/glue/webframeloaderclient_impl.cc
parent65e9cdbe8cf977e04bc264fe6d70cc5b2b0242a1 (diff)
downloadchromium_src-5b35a6be09ab4a22ed9c5e0a073463a2ef630ec5.zip
chromium_src-5b35a6be09ab4a22ed9c5e0a073463a2ef630ec5.tar.gz
chromium_src-5b35a6be09ab4a22ed9c5e0a073463a2ef630ec5.tar.bz2
Get rid of stashing a frame pointer with ResourceRequest and just store the routing id directly. This simplifies the renderer code and also allow this code to be used in worker processes, where we don't have a frame.
Review URL: http://codereview.chromium.org/46026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11763 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webframeloaderclient_impl.cc')
-rw-r--r--webkit/glue/webframeloaderclient_impl.cc20
1 files changed, 14 insertions, 6 deletions
diff --git a/webkit/glue/webframeloaderclient_impl.cc b/webkit/glue/webframeloaderclient_impl.cc
index 7855cb6..1eda695 100644
--- a/webkit/glue/webframeloaderclient_impl.cc
+++ b/webkit/glue/webframeloaderclient_impl.cc
@@ -195,13 +195,21 @@ static ResourceRequest::TargetType DetermineTargetTypeFromLoader(
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.