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

Unified Diff: chrome/browser/profiles/profile_downloader.cc

Issue 10695058: Ignore partial profile image downloads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_downloader.cc
diff --git a/chrome/browser/profiles/profile_downloader.cc b/chrome/browser/profiles/profile_downloader.cc
index 12e05676c3cbfc2311c0b541c6be6c26b347a9ad..b6bb04ef228768d37ac5e91e4bc6f43bf15c518d 100644
--- a/chrome/browser/profiles/profile_downloader.cc
+++ b/chrome/browser/profiles/profile_downloader.cc
@@ -31,6 +31,7 @@
#include "googleurl/src/gurl.h"
#include "net/base/load_flags.h"
#include "net/url_request/url_fetcher.h"
+#include "net/url_request/url_request_status.h"
#include "skia/ext/image_operations.h"
using content::BrowserThread;
@@ -279,10 +280,13 @@ void ProfileDownloader::OnURLFetchComplete(const net::URLFetcher* source) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
std::string data;
source->GetResponseAsString(&data);
- if (source->GetResponseCode() != 200) {
- DVLOG(1) << "Response code is " << source->GetResponseCode();
- DVLOG(1) << "Url is " << source->GetURL().spec();
- DVLOG(1) << "Data is " << data;
+ if (source->GetStatus().status() != net::URLRequestStatus::SUCCESS ||
+ source->GetResponseCode() != 200) {
+ LOG(WARNING) << "Fetching profile data failed";
+ DVLOG(1) << " Status: " << source->GetStatus().status();
+ DVLOG(1) << " Error: " << source->GetStatus().error();
+ DVLOG(1) << " Response code: " << source->GetResponseCode();
+ DVLOG(1) << " Url: " << source->GetURL().spec();
delegate_->OnProfileDownloadFailure(this);
return;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698