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

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

Issue 9369009: Make content::ResourceContext be a real interface like the rest of the Content API (i.e. don't ha... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 8 years, 10 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
Index: chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
===================================================================
--- chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc (revision 121250)
+++ chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc (working copy)
@@ -92,7 +92,7 @@
const std::string& method,
const GURL& url,
ResourceType::Type resource_type,
- const content::ResourceContext& resource_context,
+ content::ResourceContext* resource_context,
const content::Referrer& referrer) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
@@ -132,7 +132,7 @@
void ChromeResourceDispatcherHostDelegate::RequestBeginning(
net::URLRequest* request,
- const content::ResourceContext& resource_context,
+ content::ResourceContext* resource_context,
ResourceType::Type resource_type,
int child_id,
int route_id,
@@ -155,15 +155,14 @@
// We check offline first, then check safe browsing so that we still can
// block unsafe site after we remove offline page.
throttles->push_back(new OfflineResourceThrottle(
- child_id, route_id, request, resource_context.appcache_service()));
+ child_id, route_id, request, resource_context->GetAppCacheService()));
#endif
}
#if defined(ENABLE_SAFE_BROWSING)
// Insert safe browsing at the front of the chain, so it gets to decide
// on policies first.
- ProfileIOData* io_data = reinterpret_cast<ProfileIOData*>(
- resource_context.GetUserData(NULL));
+ ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context);
if (io_data->safe_browsing_enabled()->GetValue()) {
throttles->push_back(CreateSafeBrowsingResourceThrottle(
request, child_id, route_id,
@@ -174,7 +173,7 @@
void ChromeResourceDispatcherHostDelegate::DownloadStarting(
net::URLRequest* request,
- const content::ResourceContext& resource_context,
+ content::ResourceContext* resource_context,
int child_id,
int route_id,
int request_id,
@@ -190,8 +189,8 @@
// web, so no need to add the download throttle.
if (is_new_request) {
#if defined(ENABLE_SAFE_BROWSING)
- ProfileIOData* io_data = reinterpret_cast<ProfileIOData*>(
- resource_context.GetUserData(NULL));
+ ProfileIOData* io_data =
+ ProfileIOData::FromResourceContext(resource_context);
if (io_data->safe_browsing_enabled()->GetValue()) {
throttles->push_back(CreateSafeBrowsingResourceThrottle(
request, child_id, route_id, false));
@@ -205,7 +204,7 @@
bool ChromeResourceDispatcherHostDelegate::ShouldDeferStart(
net::URLRequest* request,
- const content::ResourceContext& resource_context) {
+ content::ResourceContext* resource_context) {
ResourceDispatcherHostRequestInfo* info =
resource_dispatcher_host_->InfoForRequest(request);
return prerender_tracker_->PotentiallyDelayRequestOnIOThread(

Powered by Google App Engine
This is Rietveld 408576698