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

Unified Diff: chrome/browser/safe_browsing/malware_details_cache.cc

Issue 8375039: Create a content::UrlFetcher interface that lives in content/public/common and convert users to i... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: review comments Created 9 years, 2 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/safe_browsing/malware_details_cache.cc
===================================================================
--- chrome/browser/safe_browsing/malware_details_cache.cc (revision 107061)
+++ chrome/browser/safe_browsing/malware_details_cache.cc (working copy)
@@ -85,11 +85,11 @@
GURL(resources_it_->first),
URLFetcher::GET,
this));
- current_fetch_->set_request_context(request_context_getter_);
+ current_fetch_->SetRequestContext(request_context_getter_);
// Only from cache, and don't save cookies.
- current_fetch_->set_load_flags(net::LOAD_ONLY_FROM_CACHE |
- net::LOAD_DO_NOT_SAVE_COOKIES);
- current_fetch_->set_automatically_retry_on_5xx(false); // No retries.
+ current_fetch_->SetLoadFlags(net::LOAD_ONLY_FROM_CACHE |
+ net::LOAD_DO_NOT_SAVE_COOKIES);
+ current_fetch_->SetAutomaticallyRetryOn5xx(false); // No retries.
current_fetch_->Start(); // OnURLFetchComplete will be called when done.
}
@@ -103,21 +103,21 @@
}
void MalwareDetailsCacheCollector::OnURLFetchComplete(
- const URLFetcher* source) {
+ const content::URLFetcher* source) {
DVLOG(1) << "OnUrlFetchComplete";
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
DCHECK(current_fetch_.get());
- if (source->status().status() != net::URLRequestStatus::SUCCESS &&
- source->status().error() == net::ERR_CACHE_MISS) {
+ if (source->GetStatus().status() != net::URLRequestStatus::SUCCESS &&
+ source->GetStatus().error() == net::ERR_CACHE_MISS) {
// Cache miss, skip this resource.
- DVLOG(1) << "Cache miss for url: " << source->url();
+ DVLOG(1) << "Cache miss for url: " << source->GetUrl();
AdvanceEntry();
return;
}
- if (source->status().status() != net::URLRequestStatus::SUCCESS) {
+ if (source->GetStatus().status() != net::URLRequestStatus::SUCCESS) {
// Some other error occurred, e.g. the request could have been cancelled.
- DVLOG(1) << "Unsuccessful fetch: " << source->url();
+ DVLOG(1) << "Unsuccessful fetch: " << source->GetUrl();
AdvanceEntry();
return;
}
@@ -125,9 +125,10 @@
// Set the response headers and body to the right resource, which
// might not be the same as the one we asked for.
// For redirects, resources_it_->first != url.spec().
- ClientMalwareReportRequest::Resource* resource = GetResource(source->url());
+ ClientMalwareReportRequest::Resource* resource =
+ GetResource(source->GetUrl());
if (!resource) {
- DVLOG(1) << "Cannot find resource for url:" << source->url();
+ DVLOG(1) << "Cannot find resource for url:" << source->GetUrl();
AdvanceEntry();
return;
}
@@ -141,10 +142,10 @@
void MalwareDetailsCacheCollector::ReadResponse(
ClientMalwareReportRequest::Resource* pb_resource,
- const URLFetcher* source) {
+ const content::URLFetcher* source) {
DVLOG(1) << "ReadResponse";
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- net::HttpResponseHeaders* headers = source->response_headers();
+ net::HttpResponseHeaders* headers = source->GetResponseHeaders();
if (!headers) {
DVLOG(1) << "Missing response headers.";
return;
@@ -167,8 +168,8 @@
}
}
- if (!source->was_fetched_via_proxy()) {
- pb_response->set_remote_ip(source->socket_address().ToString());
+ if (!source->WasFetchedViaProxy()) {
+ pb_response->set_remote_ip(source->GetSocketAddress().ToString());
}
}
« no previous file with comments | « chrome/browser/safe_browsing/malware_details_cache.h ('k') | chrome/browser/safe_browsing/protocol_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698