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

Unified Diff: chrome/browser/interests/interests_fetcher.cc

Issue 1459593002: Added a UI for the Interests Prototype. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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/interests/interests_fetcher.cc
diff --git a/chrome/browser/interests/interests_fetcher.cc b/chrome/browser/interests/interests_fetcher.cc
index 40fa204fae5ce5d4a0468f8606cb0b61f1d6da7f..c9c7ca5468a6c24432b67113bdf9750ed721fdf0 100644
--- a/chrome/browser/interests/interests_fetcher.cc
+++ b/chrome/browser/interests/interests_fetcher.cc
@@ -88,7 +88,7 @@ void InterestsFetcher::FetchInterests(
void InterestsFetcher::OnURLFetchComplete(const net::URLFetcher* source) {
const net::URLRequestStatus& status = source->GetStatus();
if (!status.is_success()) {
- VLOG(2) << "Network error " << status.error();
+ DLOG(WARNING) << "Network error " << status.error();
callback_.Run(nullptr);
return;
}
@@ -96,6 +96,7 @@ void InterestsFetcher::OnURLFetchComplete(const net::URLFetcher* source) {
int response_code = source->GetResponseCode();
// If we get an authorization error, refresh token and retry once.
if (response_code == net::HTTP_UNAUTHORIZED && !access_token_expired_) {
+ DLOG(WARNING) << "Authorization error.";
access_token_expired_ = true;
token_service_->InvalidateAccessToken(account_id_,
GetApiScopes(),
@@ -105,7 +106,7 @@ void InterestsFetcher::OnURLFetchComplete(const net::URLFetcher* source) {
}
if (response_code != net::HTTP_OK) {
- VLOG(2) << "HTTP error " << response_code;
+ DLOG(WARNING) << "HTTP error " << response_code;
callback_.Run(nullptr);
return;
}
@@ -137,12 +138,17 @@ void InterestsFetcher::OnGetTokenSuccess(
void InterestsFetcher::OnGetTokenFailure(
const OAuth2TokenService::Request* request,
const GoogleServiceAuthError& error) {
- DLOG(WARNING) << error.ToString();
+ DLOG(WARNING) << "Failed to get OAuth2 Token: " << error.ToString();
callback_.Run(nullptr);
}
void InterestsFetcher::StartOAuth2Request() {
+ if (account_id_.empty()) {
+ DLOG(WARNING) << "AccountId is empty, user is not signed in.";
+ return;
+ }
+
oauth_request_ =
token_service_->StartRequest(account_id_, GetApiScopes(), this);
}

Powered by Google App Engine
This is Rietveld 408576698