OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/local_discovery/privet_http_impl.h" | 5 #include "chrome/browser/local_discovery/privet_http_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 } | 90 } |
91 | 91 |
92 PrivetInfoOperationImpl::~PrivetInfoOperationImpl() { | 92 PrivetInfoOperationImpl::~PrivetInfoOperationImpl() { |
93 } | 93 } |
94 | 94 |
95 void PrivetInfoOperationImpl::Start() { | 95 void PrivetInfoOperationImpl::Start() { |
96 url_fetcher_ = privet_client_->CreateURLFetcher( | 96 url_fetcher_ = privet_client_->CreateURLFetcher( |
97 CreatePrivetURL(kPrivetInfoPath), net::URLFetcher::GET, this); | 97 CreatePrivetURL(kPrivetInfoPath), net::URLFetcher::GET, this); |
98 | 98 |
99 url_fetcher_->DoNotRetryOnTransientError(); | 99 url_fetcher_->DoNotRetryOnTransientError(); |
100 url_fetcher_->AllowEmptyPrivetToken(); | 100 url_fetcher_->SendEmptyPrivetToken(); |
101 | 101 |
102 url_fetcher_->Start(); | 102 url_fetcher_->Start(); |
103 } | 103 } |
104 | 104 |
105 PrivetHTTPClient* PrivetInfoOperationImpl::GetHTTPClient() { | 105 PrivetHTTPClient* PrivetInfoOperationImpl::GetHTTPClient() { |
106 return privet_client_; | 106 return privet_client_; |
107 } | 107 } |
108 | 108 |
109 void PrivetInfoOperationImpl::OnError(PrivetURLFetcher* fetcher, | 109 void PrivetInfoOperationImpl::OnError(PrivetURLFetcher* fetcher, |
110 PrivetURLFetcher::ErrorType error) { | 110 PrivetURLFetcher::ErrorType error) { |
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
924 TokenCallbackVector token_callbacks; | 924 TokenCallbackVector token_callbacks; |
925 token_callbacks_.swap(token_callbacks); | 925 token_callbacks_.swap(token_callbacks); |
926 | 926 |
927 for (TokenCallbackVector::iterator i = token_callbacks.begin(); | 927 for (TokenCallbackVector::iterator i = token_callbacks.begin(); |
928 i != token_callbacks.end(); i++) { | 928 i != token_callbacks.end(); i++) { |
929 i->Run(token); | 929 i->Run(token); |
930 } | 930 } |
931 } | 931 } |
932 | 932 |
933 } // namespace local_discovery | 933 } // namespace local_discovery |
OLD | NEW |