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

Unified Diff: chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc

Issue 8511080: Get rid of resource_messages.h include from chrome, since that's an internal detail of content. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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
Index: chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
===================================================================
--- chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc (revision 109749)
+++ chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc (working copy)
@@ -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 @@
}
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 @@
// 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 @@
// 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;
}

Powered by Google App Engine
This is Rietveld 408576698