| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "content/browser/media/android/provision_fetcher_impl.h" | 5 #include "content/browser/media/android/provision_fetcher_impl.h" |
| 6 | 6 |
| 7 #include "content/public/browser/android/provision_fetcher_factory.h" | 7 #include "content/public/browser/android/provision_fetcher_factory.h" |
| 8 #include "content/public/browser/browser_context.h" | 8 #include "content/public/browser/browser_context.h" |
| 9 #include "content/public/browser/render_frame_host.h" | 9 #include "content/public/browser/render_frame_host.h" |
| 10 #include "content/public/browser/render_process_host.h" | 10 #include "content/public/browser/render_process_host.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 } | 29 } |
| 30 | 30 |
| 31 ProvisionFetcherImpl::ProvisionFetcherImpl( | 31 ProvisionFetcherImpl::ProvisionFetcherImpl( |
| 32 std::unique_ptr<media::ProvisionFetcher> provision_fetcher) | 32 std::unique_ptr<media::ProvisionFetcher> provision_fetcher) |
| 33 : provision_fetcher_(std::move(provision_fetcher)), weak_factory_(this) { | 33 : provision_fetcher_(std::move(provision_fetcher)), weak_factory_(this) { |
| 34 DVLOG(1) << __FUNCTION__; | 34 DVLOG(1) << __FUNCTION__; |
| 35 } | 35 } |
| 36 | 36 |
| 37 ProvisionFetcherImpl::~ProvisionFetcherImpl() {} | 37 ProvisionFetcherImpl::~ProvisionFetcherImpl() {} |
| 38 | 38 |
| 39 void ProvisionFetcherImpl::Retrieve(const mojo::String& default_url, | 39 void ProvisionFetcherImpl::Retrieve(const std::string& default_url, |
| 40 const mojo::String& request_data, | 40 const std::string& request_data, |
| 41 const RetrieveCallback& callback) { | 41 const RetrieveCallback& callback) { |
| 42 DVLOG(1) << __FUNCTION__ << ": " << default_url; | 42 DVLOG(1) << __FUNCTION__ << ": " << default_url; |
| 43 provision_fetcher_->Retrieve( | 43 provision_fetcher_->Retrieve( |
| 44 default_url, request_data, | 44 default_url, request_data, |
| 45 base::Bind(&ProvisionFetcherImpl::OnResponse, weak_factory_.GetWeakPtr(), | 45 base::Bind(&ProvisionFetcherImpl::OnResponse, weak_factory_.GetWeakPtr(), |
| 46 callback)); | 46 callback)); |
| 47 } | 47 } |
| 48 | 48 |
| 49 void ProvisionFetcherImpl::OnResponse(const RetrieveCallback& callback, | 49 void ProvisionFetcherImpl::OnResponse(const RetrieveCallback& callback, |
| 50 bool success, | 50 bool success, |
| 51 const std::string& response) { | 51 const std::string& response) { |
| 52 DVLOG(1) << __FUNCTION__ << ": " << success; | 52 DVLOG(1) << __FUNCTION__ << ": " << success; |
| 53 callback.Run(success, response); | 53 callback.Run(success, response); |
| 54 } | 54 } |
| 55 | 55 |
| 56 } // namespace content | 56 } // namespace content |
| OLD | NEW |