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

Unified Diff: chrome/browser/safe_browsing/download_protection_service.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/download_protection_service.cc
===================================================================
--- chrome/browser/safe_browsing/download_protection_service.cc (revision 107061)
+++ chrome/browser/safe_browsing/download_protection_service.cc (working copy)
@@ -56,8 +56,7 @@
}
enabled_ = enabled;
if (!enabled_) {
- for (std::map<const URLFetcher*, CheckDownloadCallback>::iterator it =
- download_requests_.begin();
+ for (DownloadRequests::iterator it = download_requests_.begin();
it != download_requests_.end(); ++it) {
it->second.Run(SAFE);
}
@@ -67,9 +66,10 @@
}
}
-void DownloadProtectionService::OnURLFetchComplete(const URLFetcher* source) {
+void DownloadProtectionService::OnURLFetchComplete(
+ const content::URLFetcher* source) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- scoped_ptr<const URLFetcher> s(source); // will delete the URLFetcher object.
+ scoped_ptr<const content::URLFetcher> s(source);
if (download_requests_.find(source) != download_requests_.end()) {
CheckDownloadCallback callback = download_requests_[source];
download_requests_.erase(source);
@@ -81,8 +81,8 @@
}
DownloadCheckResultReason reason = REASON_MAX;
reason = REASON_SERVER_PING_FAILED;
- if (source->status().is_success() &&
- RC_REQUEST_OK == source->response_code()) {
+ if (source->GetStatus().is_success() &&
+ RC_REQUEST_OK == source->GetResponseCode()) {
std::string data;
source->GetResponseAsString(&data);
if (data.size() > 0) {
@@ -187,9 +187,9 @@
URLFetcher::POST,
this);
download_requests_[fetcher] = callback;
- fetcher->set_load_flags(net::LOAD_DISABLE_CACHE);
- fetcher->set_request_context(request_context_getter_.get());
- fetcher->set_upload_data("application/octet-stream", request_data);
+ fetcher->SetLoadFlags(net::LOAD_DISABLE_CACHE);
+ fetcher->SetRequestContext(request_context_getter_.get());
+ fetcher->SetUploadData("application/octet-stream", request_data);
fetcher->Start();
}
« no previous file with comments | « chrome/browser/safe_browsing/download_protection_service.h ('k') | chrome/browser/safe_browsing/malware_details_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698