diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-16 19:58:08 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-16 19:58:08 +0000 |
commit | 5b35a6be09ab4a22ed9c5e0a073463a2ef630ec5 (patch) | |
tree | 00bdf30d37b70e4f3b027c7a5dc49784e08be98b /webkit/glue/resource_handle_impl.cc | |
parent | 65e9cdbe8cf977e04bc264fe6d70cc5b2b0242a1 (diff) | |
download | chromium_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/resource_handle_impl.cc')
-rw-r--r-- | webkit/glue/resource_handle_impl.cc | 45 |
1 files changed, 8 insertions, 37 deletions
diff --git a/webkit/glue/resource_handle_impl.cc b/webkit/glue/resource_handle_impl.cc index 961e788..be5704c 100644 --- a/webkit/glue/resource_handle_impl.cc +++ b/webkit/glue/resource_handle_impl.cc @@ -28,9 +28,7 @@ MSVC_PUSH_WARNING_LEVEL(0); #include "CString.h" -#include "Console.h" #include "DocLoader.h" -#include "DOMWindow.h" #include "FormData.h" #include "FrameLoader.h" #include "Page.h" @@ -52,7 +50,6 @@ MSVC_POP_WARNING(); #include "webkit/glue/glue_util.h" #include "webkit/glue/multipart_response_delegate.h" #include "webkit/glue/resource_loader_bridge.h" -#include "webkit/glue/webframe_impl.h" #include "net/base/data_url.h" #include "net/base/net_errors.h" #include "net/base/net_util.h" @@ -312,10 +309,6 @@ bool ResourceHandleInternal::Start( ResourceLoaderBridge::SyncLoadResponse* sync_load_response) { DCHECK(!bridge_.get()); - // The WebFrame is the Frame's FrameWinClient - WebFrameImpl* webframe = - request_.frame() ? WebFrameImpl::FromFrame(request_.frame()) : NULL; - CString method = request_.httpMethod().latin1(); GURL referrer(webkit_glue::StringToStdString(request_.httpReferrer())); @@ -333,17 +326,6 @@ bool ResourceHandleInternal::Start( client_ = feed_client_proxy_.get(); } - // 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. - GURL policy_url; - if (request_.targetType() != ResourceRequest::TargetIsMainFrame && - request_.frame() && request_.frame()->document()) { - policy_url = GURL(webkit_glue::StringToStdString( - request_.frame()->document()->policyBaseURL())); - } - switch (request_.cachePolicy()) { case ReloadIgnoringCacheData: // Required by LayoutTests/http/tests/misc/refresh-headers.php @@ -394,27 +376,16 @@ bool ResourceHandleInternal::Start( (*it).second == "max-age=0") continue; - // WinInet dies if blank headers are set. TODO(darin): Is this still an - // issue now that we are using WinHTTP? - if ((*it).first.isEmpty()) { - webframe->frame()->domWindow()->console()->addMessage( - JSMessageSource, - ErrorMessageLevel, - "Refused to set blank header", - 1, - String()); - continue; - } if (!headerBuf.isEmpty()) headerBuf.append(crlf); headerBuf.append((*it).first + sep + (*it).second); } // TODO(jcampan): in the non out-of-process plugin case the request does not - // have a origin_pid. Find a better place to set this. - int origin_pid = request_.originPid(); - if (origin_pid == 0) - origin_pid = base::GetCurrentProcId(); + // have a requestor_pid. Find a better place to set this. + int requestor_pid = request_.requestorProcessID(); + if (requestor_pid == 0) + requestor_pid = base::GetCurrentProcId(); bool mixed_content = webkit_glue::KURLToGURL(request_.mainDocumentURL()).SchemeIsSecure() && @@ -444,16 +415,16 @@ bool ResourceHandleInternal::Start( // TODO(brettw) this should take parameter encoding into account when // creating the GURLs. bridge_.reset(ResourceLoaderBridge::Create( - webframe, webkit_glue::CStringToStdString(method), url, - policy_url, + webkit_glue::KURLToGURL(request_.policyURL()), referrer, webkit_glue::CStringToStdString(headerBuf.latin1()), load_flags_, - origin_pid, + requestor_pid, FromTargetType(request_.targetType()), - mixed_content)); + mixed_content, + request_.requestorID())); if (!bridge_.get()) return false; |