diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-16 18:18:23 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-16 18:18:23 +0000 |
commit | 9981685f4a7eb47fb91aa220515e6c3b246a2139 (patch) | |
tree | 45b306f9a7c98e21d9b3f3ec822f39ed98ed75dd | |
parent | ea433b5a2751dc79c564c6c446828fb83c3144be (diff) | |
download | chromium_src-9981685f4a7eb47fb91aa220515e6c3b246a2139.zip chromium_src-9981685f4a7eb47fb91aa220515e6c3b246a2139.tar.gz chromium_src-9981685f4a7eb47fb91aa220515e6c3b246a2139.tar.bz2 |
Get rid of resource_messages.h include from chrome, since that's an internal detail of content.
BUG=98716
Review URL: http://codereview.chromium.org/8511080
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110324 0039d316-1c4b-4281-b951-d872f2087c98
5 files changed, 27 insertions, 22 deletions
diff --git a/chrome/browser/prerender/prerender_tracker.cc b/chrome/browser/prerender/prerender_tracker.cc index 62122a1..a1c908a 100644 --- a/chrome/browser/prerender/prerender_tracker.cc +++ b/chrome/browser/prerender/prerender_tracker.cc @@ -11,7 +11,6 @@ #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/renderer_host/resource_dispatcher_host.h" #include "content/browser/resource_context.h" -#include "content/common/resource_messages.h" #include "content/public/browser/browser_thread.h" #include "net/base/load_flags.h" diff --git a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc index 3d86c7c..0f3a7a8 100644 --- a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc +++ b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc @@ -30,7 +30,6 @@ #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" #include "content/browser/renderer_host/resource_message_filter.h" #include "content/browser/resource_context.h" -#include "content/common/resource_messages.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_service.h" #include "net/base/load_flags.h" @@ -103,17 +102,20 @@ ChromeResourceDispatcherHostDelegate::~ChromeResourceDispatcherHostDelegate() { } bool ChromeResourceDispatcherHostDelegate::ShouldBeginRequest( - int child_id, int route_id, - const ResourceHostMsg_Request& request_data, + int child_id, + int route_id, + const std::string& method, + const GURL& url, + ResourceType::Type resource_type, const content::ResourceContext& resource_context, const GURL& referrer) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); // Handle a PREFETCH resource type. If prefetch is disabled, squelch the // request. Otherwise, do a normal request to warm the cache. - if (request_data.resource_type == ResourceType::PREFETCH) { + if (resource_type == ResourceType::PREFETCH) { // All PREFETCH requests should be GETs, but be defensive about it. - if (request_data.method != "GET") + if (method != "GET") return false; // If prefetch is disabled, kill the request. @@ -123,14 +125,10 @@ bool ChromeResourceDispatcherHostDelegate::ShouldBeginRequest( // Handle a PRERENDER motivated request. Very similar to rel=prefetch, these // rel=prerender requests instead launch an early render of the entire page. - if (request_data.resource_type == ResourceType::PRERENDER) { + if (resource_type == ResourceType::PRERENDER) { if (prerender::PrerenderManager::IsPrerenderingPossible()) { BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, - base::Bind(&AddPrerenderOnUI, - child_id, - route_id, - request_data.url, - referrer)); + base::Bind(&AddPrerenderOnUI, child_id, route_id, url, referrer)); } // Prerendering or not, this request should be aborted. return false; @@ -138,10 +136,9 @@ bool ChromeResourceDispatcherHostDelegate::ShouldBeginRequest( // Abort any prerenders that spawn requests that use invalid HTTP methods. if (prerender_tracker_->IsPrerenderingOnIOThread(child_id, route_id) && - !prerender::PrerenderManager::IsValidHttpMethod(request_data.method)) { + !prerender::PrerenderManager::IsValidHttpMethod(method)) { prerender_tracker_->TryCancelOnIOThread( - child_id, route_id, - prerender::FINAL_STATUS_INVALID_HTTP_METHOD); + child_id, route_id, prerender::FINAL_STATUS_INVALID_HTTP_METHOD); return false; } diff --git a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.h b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.h index 7a796a2..6aab52d 100644 --- a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.h +++ b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.h @@ -34,8 +34,11 @@ class ChromeResourceDispatcherHostDelegate // ResourceDispatcherHostDelegate implementation. virtual bool ShouldBeginRequest( - int child_id, int route_id, - const ResourceHostMsg_Request& request_data, + int child_id, + int route_id, + const std::string& method, + const GURL& url, + ResourceType::Type resource_type, const content::ResourceContext& resource_context, const GURL& referrer) OVERRIDE; virtual ResourceHandler* RequestBeginning( diff --git a/content/browser/renderer_host/resource_dispatcher_host.cc b/content/browser/renderer_host/resource_dispatcher_host.cc index afe7d46..46d2cc2 100644 --- a/content/browser/renderer_host/resource_dispatcher_host.cc +++ b/content/browser/renderer_host/resource_dispatcher_host.cc @@ -484,8 +484,11 @@ void ResourceDispatcherHost::BeginRequest( const GURL referrer = MaybeStripReferrer(request_data.referrer); // Allow the observer to block/handle the request. - if (delegate_ && !delegate_->ShouldBeginRequest(child_id, route_id, - request_data, + if (delegate_ && !delegate_->ShouldBeginRequest(child_id, + route_id, + request_data.method, + request_data.url, + request_data.resource_type, resource_context, referrer)) { AbortRequestBeforeItStarts(filter_, sync_result, route_id, request_id); diff --git a/content/public/browser/resource_dispatcher_host_delegate.h b/content/public/browser/resource_dispatcher_host_delegate.h index 971e5d4..ca0050d 100644 --- a/content/public/browser/resource_dispatcher_host_delegate.h +++ b/content/public/browser/resource_dispatcher_host_delegate.h @@ -9,12 +9,12 @@ #include <string> #include "base/basictypes.h" +#include "webkit/glue/resource_type.h" class GURL; class ResourceDispatcherHostLoginDelegate; class ResourceHandler; class ResourceMessageFilter; -struct ResourceHostMsg_Request; struct ResourceResponse; namespace content { @@ -35,8 +35,11 @@ class ResourceDispatcherHostDelegate { public: // Called when a request begins. Return false to abort the request. virtual bool ShouldBeginRequest( - int child_id, int route_id, - const ResourceHostMsg_Request& request_data, + int child_id, + int route_id, + const std::string& method, + const GURL& url, + ResourceType::Type resource_type, const content::ResourceContext& resource_context, const GURL& referrer) = 0; |