Chromium Code Reviews| Index: content/browser/media/android/url_provision_fetcher.h |
| diff --git a/content/browser/media/android/url_provision_fetcher.h b/content/browser/media/android/url_provision_fetcher.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..0aa1ac3f4e57df4f1544320cc78beb7cb7637548 |
| --- /dev/null |
| +++ b/content/browser/media/android/url_provision_fetcher.h |
| @@ -0,0 +1,52 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_BROWSER_MEDIA_ANDROID_URL_PROVISION_FETCHER_H_ |
| +#define CONTENT_BROWSER_MEDIA_ANDROID_URL_PROVISION_FETCHER_H_ |
| + |
| +#include "base/macros.h" |
| +#include "media/base/android/provision_fetcher.h" |
| +#include "net/url_request/url_fetcher.h" |
| +#include "net/url_request/url_fetcher_delegate.h" |
| + |
| +namespace content { |
| + |
| +// The ProvisionFetcher that retrieves the data by HTTP POST request. |
| + |
| +class URLProvisionFetcher : public media::ProvisionFetcher, |
| + public net::URLFetcherDelegate { |
| + public: |
| + explicit URLProvisionFetcher(net::URLRequestContextGetter* context); |
| + ~URLProvisionFetcher() override; |
| + |
| + // media::ProvisionFetcher implementation. |
| + void Retrieve(const std::string& default_url, |
| + const std::string& request_data, |
| + const ProvisionFetcher::ResponseCB& response_cb) override; |
| + |
| + private: |
| + // net::URLFetcherDelegate implementation. |
| + void OnURLFetchComplete(const net::URLFetcher* source) override; |
| + |
| + net::URLRequestContextGetter* context_; |
|
xhwang
2015/11/12 22:27:03
I saw both are used [1]:
- net::URLRequestContextG
Tima Vaisburd
2015/11/13 03:13:10
Done.
|
| + scoped_ptr<net::URLFetcher> request_; |
| + media::ProvisionFetcher::ResponseCB response_cb_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(URLProvisionFetcher); |
| +}; |
| + |
| +class URLProvisionFetcherFactory : public media::ProvisionFetcherFactory { |
| + public: |
| + explicit URLProvisionFetcherFactory(net::URLRequestContextGetter* context); |
| + ~URLProvisionFetcherFactory() override; |
| + |
| + scoped_ptr<media::ProvisionFetcher> CreateFetcher() const override; |
| + |
| + private: |
| + net::URLRequestContextGetter* context_; |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CHROME_BROWSER_MEDIA_ANDROID_URL_PROVISION_FETCHER_H_ |