OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef HEADLESS_PUBLIC_UTIL_HTTP_URL_FETCHER_H_ |
| 6 #define HEADLESS_PUBLIC_UTIL_HTTP_URL_FETCHER_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "headless/public/util/url_fetcher.h" |
| 10 |
| 11 namespace net { |
| 12 class URLRequestContext; |
| 13 class URLRequestJobFactory; |
| 14 } // namespace |
| 15 |
| 16 namespace headless { |
| 17 |
| 18 // A simple URLFetcher that uses a net::URLRequestContext to as a back end for |
| 19 // http(s) fetches. |
| 20 class HttpURLFetcher : public URLFetcher { |
| 21 public: |
| 22 explicit HttpURLFetcher(const net::URLRequestContext* url_request_context); |
| 23 ~HttpURLFetcher() override; |
| 24 |
| 25 // URLFetcher implementation: |
| 26 void StartFetch(const GURL& rewritten_url, |
| 27 const std::string& method, |
| 28 const net::HttpRequestHeaders& request_headers, |
| 29 ResultListener* result_listener) override; |
| 30 |
| 31 private: |
| 32 class Delegate; |
| 33 |
| 34 const net::URLRequestContext* url_request_context_; |
| 35 std::unique_ptr<Delegate> delegate_; |
| 36 |
| 37 DISALLOW_COPY_AND_ASSIGN(HttpURLFetcher); |
| 38 }; |
| 39 |
| 40 } // namespace headless |
| 41 |
| 42 #endif // HEADLESS_PUBLIC_UTIL_HTTP_URL_FETCHER_H_ |
OLD | NEW |