| 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 #ifndef CONTENT_BROWSER_MEDIA_ANDROID_PROVISION_FETCHER_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_MEDIA_ANDROID_PROVISION_FETCHER_IMPL_H_ |
| 6 #define CONTENT_BROWSER_MEDIA_ANDROID_PROVISION_FETCHER_IMPL_H_ | 6 #define CONTENT_BROWSER_MEDIA_ANDROID_PROVISION_FETCHER_IMPL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 class ProvisionFetcherImpl : public media::mojom::ProvisionFetcher { | 22 class ProvisionFetcherImpl : public media::mojom::ProvisionFetcher { |
| 23 public: | 23 public: |
| 24 static void Create(RenderFrameHost* render_frame_host, | 24 static void Create(RenderFrameHost* render_frame_host, |
| 25 media::mojom::ProvisionFetcherRequest request); | 25 media::mojom::ProvisionFetcherRequest request); |
| 26 | 26 |
| 27 explicit ProvisionFetcherImpl( | 27 explicit ProvisionFetcherImpl( |
| 28 std::unique_ptr<media::ProvisionFetcher> provision_fetcher); | 28 std::unique_ptr<media::ProvisionFetcher> provision_fetcher); |
| 29 ~ProvisionFetcherImpl() override; | 29 ~ProvisionFetcherImpl() override; |
| 30 | 30 |
| 31 // media::mojom::ProvisionFetcher implementation. | 31 // media::mojom::ProvisionFetcher implementation. |
| 32 void Retrieve(const mojo::String& default_url, | 32 void Retrieve(const std::string& default_url, |
| 33 const mojo::String& request_data, | 33 const std::string& request_data, |
| 34 const RetrieveCallback& callback) final; | 34 const RetrieveCallback& callback) final; |
| 35 | 35 |
| 36 private: | 36 private: |
| 37 // Callback for media::ProvisionFetcher::Retrieve(). | 37 // Callback for media::ProvisionFetcher::Retrieve(). |
| 38 void OnResponse(const RetrieveCallback& callback, | 38 void OnResponse(const RetrieveCallback& callback, |
| 39 bool success, | 39 bool success, |
| 40 const std::string& response); | 40 const std::string& response); |
| 41 | 41 |
| 42 std::unique_ptr<media::ProvisionFetcher> provision_fetcher_; | 42 std::unique_ptr<media::ProvisionFetcher> provision_fetcher_; |
| 43 | 43 |
| 44 base::WeakPtrFactory<ProvisionFetcherImpl> weak_factory_; | 44 base::WeakPtrFactory<ProvisionFetcherImpl> weak_factory_; |
| 45 | 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(ProvisionFetcherImpl); | 46 DISALLOW_COPY_AND_ASSIGN(ProvisionFetcherImpl); |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 } // namespace content | 49 } // namespace content |
| 50 | 50 |
| 51 #endif // CONTENT_BROWSER_MEDIA_ANDROID_PROVISION_FETCHER_IMPL_H_ | 51 #endif // CONTENT_BROWSER_MEDIA_ANDROID_PROVISION_FETCHER_IMPL_H_ |
| OLD | NEW |