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" |
11 #include "content/public/browser/storage_partition.h" | |
12 #include "net/url_request/url_request_context_getter.h" | 11 #include "net/url_request/url_request_context_getter.h" |
13 | 12 |
14 namespace content { | 13 namespace content { |
15 | 14 |
16 // static | 15 // static |
17 void ProvisionFetcherImpl::Create( | 16 void ProvisionFetcherImpl::Create( |
18 RenderFrameHost* render_frame_host, | 17 RenderFrameHost* render_frame_host, |
19 mojo::InterfaceRequest<media::interfaces::ProvisionFetcher> request) { | 18 mojo::InterfaceRequest<media::interfaces::ProvisionFetcher> request) { |
20 net::URLRequestContextGetter* context_getter = | 19 net::URLRequestContextGetter* context_getter = |
21 BrowserContext::GetDefaultStoragePartition( | 20 render_frame_host->GetProcess()->GetBrowserContext()->GetRequestContext(); |
22 render_frame_host->GetProcess()->GetBrowserContext())-> | |
23 GetURLRequestContext(); | |
24 DCHECK(context_getter); | 21 DCHECK(context_getter); |
25 | 22 |
26 // The created object is strongly bound to (and owned by) the pipe. | 23 // The created object is strongly bound to (and owned by) the pipe. |
27 new ProvisionFetcherImpl(CreateProvisionFetcher(context_getter), | 24 new ProvisionFetcherImpl(CreateProvisionFetcher(context_getter), |
28 std::move(request)); | 25 std::move(request)); |
29 } | 26 } |
30 | 27 |
31 ProvisionFetcherImpl::ProvisionFetcherImpl( | 28 ProvisionFetcherImpl::ProvisionFetcherImpl( |
32 std::unique_ptr<media::ProvisionFetcher> provision_fetcher, | 29 std::unique_ptr<media::ProvisionFetcher> provision_fetcher, |
33 mojo::InterfaceRequest<ProvisionFetcher> request) | 30 mojo::InterfaceRequest<ProvisionFetcher> request) |
(...skipping 16 matching lines...) Expand all Loading... |
50 } | 47 } |
51 | 48 |
52 void ProvisionFetcherImpl::OnResponse(const RetrieveCallback& callback, | 49 void ProvisionFetcherImpl::OnResponse(const RetrieveCallback& callback, |
53 bool success, | 50 bool success, |
54 const std::string& response) { | 51 const std::string& response) { |
55 DVLOG(1) << __FUNCTION__ << ": " << success; | 52 DVLOG(1) << __FUNCTION__ << ": " << success; |
56 callback.Run(success, response); | 53 callback.Run(success, response); |
57 } | 54 } |
58 | 55 |
59 } // namespace content | 56 } // namespace content |
OLD | NEW |