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

Unified Diff: chrome/browser/web_resource/web_resource_service.cc

Issue 8373021: Convert URLFetcher::Delegates to use an interface in content/public/common. Also remove the old U... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync and remove unncessary forward declares 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/web_resource/web_resource_service.cc
===================================================================
--- chrome/browser/web_resource/web_resource_service.cc (revision 106929)
+++ chrome/browser/web_resource/web_resource_service.cc (working copy)
@@ -23,12 +23,13 @@
#include "content/browser/browser_thread.h"
#include "content/common/net/url_fetcher.h"
#include "content/public/browser/notification_service.h"
+#include "content/public/common/url_fetcher_delegate.h"
#include "googleurl/src/gurl.h"
#include "net/base/load_flags.h"
#include "net/url_request/url_request_status.h"
class WebResourceService::WebResourceFetcher
- : public URLFetcher::Delegate {
+ : public content::URLFetcherDelegate {
public:
explicit WebResourceFetcher(WebResourceService* web_resource_service) :
ALLOW_THIS_IN_INITIALIZER_LIST(fetcher_factory_(this)),
@@ -78,21 +79,18 @@
url_fetcher_->Start();
}
- // From URLFetcher::Delegate.
- void OnURLFetchComplete(const URLFetcher* source,
- const GURL& url,
- const net::URLRequestStatus& status,
- int response_code,
- const net::ResponseCookies& cookies,
- const std::string& data) {
+ // From content::URLFetcherDelegate.
+ void OnURLFetchComplete(const URLFetcher* source) {
// Delete the URLFetcher when this function exits.
scoped_ptr<URLFetcher> clean_up_fetcher(url_fetcher_.release());
// Don't parse data if attempt to download was unsuccessful.
// Stop loading new web resource data, and silently exit.
- if (!status.is_success() || (response_code != 200))
+ if (!source->status().is_success() || (source->response_code() != 200))
return;
+ std::string data;
+ source->GetResponseAsString(&data);
web_resource_service_->UpdateResourceCache(data);
web_resource_service_->Release();
}

Powered by Google App Engine
This is Rietveld 408576698