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

Unified Diff: chrome/browser/policy/device_management_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/policy/device_management_service.cc
===================================================================
--- chrome/browser/policy/device_management_service.cc (revision 106929)
+++ chrome/browser/policy/device_management_service.cc (working copy)
@@ -13,6 +13,7 @@
#include "chrome/browser/policy/device_management_backend_impl.h"
#include "content/browser/browser_thread.h"
#include "content/public/common/content_client.h"
+#include "content/common/net/url_fetcher.h"
#include "net/base/cookie_monster.h"
#include "net/base/host_resolver.h"
#include "net/base/load_flags.h"
@@ -221,13 +222,7 @@
fetcher->Start();
}
-void DeviceManagementService::OnURLFetchComplete(
- const URLFetcher* source,
- const GURL& url,
- const net::URLRequestStatus& status,
- int response_code,
- const net::ResponseCookies& cookies,
- const std::string& data) {
+void DeviceManagementService::OnURLFetchComplete(const URLFetcher* source) {
JobFetcherMap::iterator entry(pending_jobs_.find(source));
if (entry != pending_jobs_.end()) {
DeviceManagementJob* job = entry->second;
@@ -238,10 +233,10 @@
// the proxy.
bool retry = false;
if ((source->load_flags() & net::LOAD_BYPASS_PROXY) == 0) {
- if (!status.is_success() && IsProxyError(status)) {
+ if (!source->status().is_success() && IsProxyError(source->status())) {
LOG(WARNING) << "Proxy failed while contacting dmserver.";
retry = true;
- } else if (status.is_success() &&
+ } else if (source->status().is_success() &&
source->was_fetched_via_proxy() &&
!IsProtobufMimeType(source)) {
// The proxy server can be misconfigured but pointing to an existing
@@ -257,7 +252,10 @@
LOG(WARNING) << "Retrying dmserver request without using a proxy.";
StartJob(job, true);
} else {
- job->HandleResponse(status, response_code, cookies, data);
+ std::string data;
+ source->GetResponseAsString(&data);
+ job->HandleResponse(source->status(), source->response_code(),
+ source->cookies(), data);
}
} else {
NOTREACHED() << "Callback from foreign URL fetcher";

Powered by Google App Engine
This is Rietveld 408576698