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