| 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/public/browser/provision_fetcher_impl.h" |
| 6 | 6 |
| 7 #include "content/public/browser/android/provision_fetcher_factory.h" | 7 #include "content/public/browser/provision_fetcher_factory.h" |
| 8 #include "content/public/browser/browser_context.h" | |
| 9 #include "content/public/browser/render_frame_host.h" | |
| 10 #include "content/public/browser/render_process_host.h" | |
| 11 #include "content/public/browser/storage_partition.h" | |
| 12 #include "mojo/public/cpp/bindings/strong_binding.h" | 8 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 13 #include "net/url_request/url_request_context_getter.h" | 9 #include "net/url_request/url_request_context_getter.h" |
| 14 | 10 |
| 15 namespace content { | 11 namespace content { |
| 16 | 12 |
| 17 // static | 13 // static |
| 18 void ProvisionFetcherImpl::Create( | 14 void ProvisionFetcherImpl::Create( |
| 19 RenderFrameHost* render_frame_host, | 15 net::URLRequestContextGetter* context_getter, |
| 20 media::mojom::ProvisionFetcherRequest request) { | 16 media::mojom::ProvisionFetcherRequest request) { |
| 21 net::URLRequestContextGetter* context_getter = | |
| 22 BrowserContext::GetDefaultStoragePartition( | |
| 23 render_frame_host->GetProcess()->GetBrowserContext())-> | |
| 24 GetURLRequestContext(); | |
| 25 DCHECK(context_getter); | 17 DCHECK(context_getter); |
| 26 mojo::MakeStrongBinding(base::MakeUnique<ProvisionFetcherImpl>( | 18 mojo::MakeStrongBinding(base::MakeUnique<ProvisionFetcherImpl>( |
| 27 CreateProvisionFetcher(context_getter)), | 19 CreateProvisionFetcher(context_getter)), |
| 28 std::move(request)); | 20 std::move(request)); |
| 29 } | 21 } |
| 30 | 22 |
| 31 ProvisionFetcherImpl::ProvisionFetcherImpl( | 23 ProvisionFetcherImpl::ProvisionFetcherImpl( |
| 32 std::unique_ptr<media::ProvisionFetcher> provision_fetcher) | 24 std::unique_ptr<media::ProvisionFetcher> provision_fetcher) |
| 33 : provision_fetcher_(std::move(provision_fetcher)), weak_factory_(this) { | 25 : provision_fetcher_(std::move(provision_fetcher)), weak_factory_(this) { |
| 34 DVLOG(1) << __FUNCTION__; | 26 DVLOG(1) << __FUNCTION__; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 47 } | 39 } |
| 48 | 40 |
| 49 void ProvisionFetcherImpl::OnResponse(const RetrieveCallback& callback, | 41 void ProvisionFetcherImpl::OnResponse(const RetrieveCallback& callback, |
| 50 bool success, | 42 bool success, |
| 51 const std::string& response) { | 43 const std::string& response) { |
| 52 DVLOG(1) << __FUNCTION__ << ": " << success; | 44 DVLOG(1) << __FUNCTION__ << ": " << success; |
| 53 callback.Run(success, response); | 45 callback.Run(success, response); |
| 54 } | 46 } |
| 55 | 47 |
| 56 } // namespace content | 48 } // namespace content |
| OLD | NEW |