Code:  void GaiaOAuthClient::Core::OnUserInfoFetchComplete(
     const net::URLRequestStatus& status,
     int response_code,
     const std::string& response) {
   std::string email;
   if (response_code == net::HTTP_OK) {
     scoped_ptr<Value> message_value(base::JSONReader::Read(response));
    if (message_value.get() &&
        message_value->IsType(Value::TYPE_DICTIONARY)) {
      scoped_ptr<DictionaryValue> response_dict(
          static_cast<DictionaryValue*>(message_value.release()));
      response_dict->GetString(kEmailValue, &email);
    }
  }

  if (email.empty()) {
    delegate_->OnNetworkError(response_code);
  } else {
    delegate_->OnRefreshTokenResponse(
        email, access_token_, expires_in_seconds_);
  }
}

Commit Message: Remove UrlFetcher from remoting and use the one in net instead.

BUG=133790
TEST=Stop and restart the Me2Me host. It should still work.


Review URL: https://chromiumcodereview.appspot.com/10637008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143798 0039d316-1c4b-4281-b951-d872f2087c98
CWE ID: CWE-399
 void GaiaOAuthClient::Core::OnUserInfoFetchComplete(
     const net::URLRequestStatus& status,
     int response_code,
     const std::string& response) {
  request_.reset();
  url_fetcher_type_ = URL_FETCHER_NONE;
   std::string email;
   if (response_code == net::HTTP_OK) {
     scoped_ptr<Value> message_value(base::JSONReader::Read(response));
    if (message_value.get() &&
        message_value->IsType(Value::TYPE_DICTIONARY)) {
      scoped_ptr<DictionaryValue> response_dict(
          static_cast<DictionaryValue*>(message_value.release()));
      response_dict->GetString(kEmailValue, &email);
    }
  }

  if (email.empty()) {
    delegate_->OnNetworkError(response_code);
  } else {
    delegate_->OnRefreshTokenResponse(
        email, access_token_, expires_in_seconds_);
  }
}
