Index: chrome/browser/local_discovery/privet_http_impl.cc |
diff --git a/chrome/browser/local_discovery/privet_http_impl.cc b/chrome/browser/local_discovery/privet_http_impl.cc |
index a6dcab7be630b0af734feaaf9b5cc500531b702b..0514441c8aca99c9303adfd69d8b9bb557dfdac0 100644 |
--- a/chrome/browser/local_discovery/privet_http_impl.cc |
+++ b/chrome/browser/local_discovery/privet_http_impl.cc |
@@ -107,8 +107,6 @@ void PrivetInfoOperationImpl::OnError(PrivetURLFetcher* fetcher, |
void PrivetInfoOperationImpl::OnParsedJson(PrivetURLFetcher* fetcher, |
const base::DictionaryValue* value, |
bool has_error) { |
- if (!has_error) |
- privet_client_->CacheInfo(value); |
callback_.Run(value); |
} |
@@ -787,18 +785,11 @@ PrivetHTTPClientImpl::PrivetHTTPClientImpl( |
const std::string& name, |
const net::HostPortPair& host_port, |
net::URLRequestContextGetter* request_context) |
- : name_(name), |
- fetcher_factory_(request_context), |
- host_port_(host_port) { |
-} |
+ : name_(name), request_context_(request_context), host_port_(host_port) {} |
PrivetHTTPClientImpl::~PrivetHTTPClientImpl() { |
} |
-const base::DictionaryValue* PrivetHTTPClientImpl::GetCachedInfo() const { |
- return cached_info_.get(); |
-} |
- |
scoped_ptr<PrivetRegisterOperation> |
PrivetHTTPClientImpl::CreateRegisterOperation( |
const std::string& user, |
@@ -861,22 +852,13 @@ scoped_ptr<PrivetURLFetcher> PrivetHTTPClientImpl::CreateURLFetcher( |
replacements.SetHostStr(host_port_.host()); |
std::string port(base::IntToString(host_port_.port())); // Keep string alive. |
replacements.SetPortStr(port); |
- return fetcher_factory_.CreateURLFetcher(url.ReplaceComponents(replacements), |
- request_type, delegate); |
-} |
- |
-void PrivetHTTPClientImpl::CacheInfo(const base::DictionaryValue* cached_info) { |
- cached_info_.reset(cached_info->DeepCopy()); |
- std::string token; |
- if (cached_info_->GetString(kPrivetInfoKeyToken, &token)) { |
- fetcher_factory_.set_token(token); |
- } |
+ return scoped_ptr<PrivetURLFetcher>( |
+ new PrivetURLFetcher(url.ReplaceComponents(replacements), |
+ request_type, |
+ request_context_.get(), |
+ delegate)); |
} |
-bool PrivetHTTPClientImpl::HasToken() const { |
- return fetcher_factory_.get_token() != ""; |
-}; |
- |
void PrivetHTTPClientImpl::RefreshPrivetToken( |
const PrivetURLFetcher::TokenCallback& callback) { |
token_callbacks_.push_back(callback); |