| Index: chrome/browser/safe_browsing/malware_details_cache.cc
|
| ===================================================================
|
| --- chrome/browser/safe_browsing/malware_details_cache.cc (revision 106929)
|
| +++ chrome/browser/safe_browsing/malware_details_cache.cc (working copy)
|
| @@ -15,6 +15,7 @@
|
| #include "chrome/browser/safe_browsing/report.pb.h"
|
| #include "chrome/browser/safe_browsing/safe_browsing_service.h"
|
| #include "content/browser/browser_thread.h"
|
| +#include "content/common/net/url_fetcher.h"
|
| #include "net/base/host_port_pair.h"
|
| #include "net/base/load_flags.h"
|
| #include "net/http/http_response_headers.h"
|
| @@ -102,26 +103,21 @@
|
| }
|
|
|
| void MalwareDetailsCacheCollector::OnURLFetchComplete(
|
| - const URLFetcher* source,
|
| - const GURL& url,
|
| - const net::URLRequestStatus& status,
|
| - int response_code,
|
| - const net::ResponseCookies& cookies,
|
| - const std::string& data) {
|
| + const URLFetcher* source) {
|
| DVLOG(1) << "OnUrlFetchComplete";
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
| DCHECK(current_fetch_.get());
|
| - if (status.status() != net::URLRequestStatus::SUCCESS &&
|
| - status.error() == net::ERR_CACHE_MISS) {
|
| + if (source->status().status() != net::URLRequestStatus::SUCCESS &&
|
| + source->status().error() == net::ERR_CACHE_MISS) {
|
| // Cache miss, skip this resource.
|
| - DVLOG(1) << "Cache miss for url: " << url;
|
| + DVLOG(1) << "Cache miss for url: " << source->url();
|
| AdvanceEntry();
|
| return;
|
| }
|
|
|
| - if (status.status() != net::URLRequestStatus::SUCCESS) {
|
| + if (source->status().status() != net::URLRequestStatus::SUCCESS) {
|
| // Some other error occurred, e.g. the request could have been cancelled.
|
| - DVLOG(1) << "Unsuccessful fetch: " << url;
|
| + DVLOG(1) << "Unsuccessful fetch: " << source->url();
|
| AdvanceEntry();
|
| return;
|
| }
|
| @@ -129,14 +125,16 @@
|
| // 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(url);
|
| + ClientMalwareReportRequest::Resource* resource = GetResource(source->url());
|
| if (!resource) {
|
| - DVLOG(1) << "Cannot find resource for url:" << url;
|
| + DVLOG(1) << "Cannot find resource for url:" << source->url();
|
| AdvanceEntry();
|
| return;
|
| }
|
|
|
| ReadResponse(resource, source);
|
| + std::string data;
|
| + source->GetResponseAsString(&data);
|
| ReadData(resource, data);
|
| AdvanceEntry();
|
| }
|
|
|