| 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 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 775 DCHECK(!current_response_.is_null()); | 775 DCHECK(!current_response_.is_null()); |
| 776 current_response_.Run(has_error, &value); | 776 current_response_.Run(has_error, &value); |
| 777 } | 777 } |
| 778 | 778 |
| 779 void PrivetLocalPrintOperationImpl::OnNeedPrivetToken( | 779 void PrivetLocalPrintOperationImpl::OnNeedPrivetToken( |
| 780 PrivetURLFetcher* fetcher, | 780 PrivetURLFetcher* fetcher, |
| 781 const PrivetURLFetcher::TokenCallback& callback) { | 781 const PrivetURLFetcher::TokenCallback& callback) { |
| 782 privet_client_->RefreshPrivetToken(callback); | 782 privet_client_->RefreshPrivetToken(callback); |
| 783 } | 783 } |
| 784 | 784 |
| 785 void PrivetLocalPrintOperationImpl::SetData(base::RefCountedBytes* data) { | 785 void PrivetLocalPrintOperationImpl::SetData( |
| 786 const scoped_refptr<base::RefCountedBytes>& data) { |
| 786 DCHECK(!started_); | 787 DCHECK(!started_); |
| 787 data_ = data; | 788 data_ = data; |
| 788 } | 789 } |
| 789 | 790 |
| 790 void PrivetLocalPrintOperationImpl::SetTicket(const std::string& ticket) { | 791 void PrivetLocalPrintOperationImpl::SetTicket(const std::string& ticket) { |
| 791 DCHECK(!started_); | 792 DCHECK(!started_); |
| 792 ticket_.InitFromString(ticket); | 793 ticket_.InitFromString(ticket); |
| 793 } | 794 } |
| 794 | 795 |
| 795 void PrivetLocalPrintOperationImpl::SetCapabilities( | 796 void PrivetLocalPrintOperationImpl::SetCapabilities( |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 942 PrivetV1HTTPClientImpl::CreateStorageReadOperation( | 943 PrivetV1HTTPClientImpl::CreateStorageReadOperation( |
| 943 const std::string& path, | 944 const std::string& path, |
| 944 const PrivetDataReadOperation::ResultCallback& callback) { | 945 const PrivetDataReadOperation::ResultCallback& callback) { |
| 945 std::string url_param = | 946 std::string url_param = |
| 946 base::StringPrintf(kPrivetStorageParamPathFormat, path.c_str()); | 947 base::StringPrintf(kPrivetStorageParamPathFormat, path.c_str()); |
| 947 return scoped_ptr<PrivetDataReadOperation>(new PrivetDataReadOperationImpl( | 948 return scoped_ptr<PrivetDataReadOperation>(new PrivetDataReadOperationImpl( |
| 948 info_client(), kPrivetStorageContentPath, url_param, callback)); | 949 info_client(), kPrivetStorageContentPath, url_param, callback)); |
| 949 } | 950 } |
| 950 | 951 |
| 951 } // namespace local_discovery | 952 } // namespace local_discovery |
| OLD | NEW |