OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 HEADLESS_PUBLIC_UTIL_HTTP_URL_FETCHER_H_ | 5 #ifndef HEADLESS_PUBLIC_UTIL_HTTP_URL_FETCHER_H_ |
6 #define HEADLESS_PUBLIC_UTIL_HTTP_URL_FETCHER_H_ | 6 #define HEADLESS_PUBLIC_UTIL_HTTP_URL_FETCHER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "headless/public/util/url_fetcher.h" | 9 #include "headless/public/util/url_fetcher.h" |
10 | 10 |
11 namespace net { | 11 namespace net { |
12 class URLRequestContext; | 12 class URLRequestContext; |
13 } // namespace | 13 } // namespace |
14 | 14 |
15 namespace headless { | 15 namespace headless { |
16 | 16 |
17 // A simple URLFetcher that uses a net::URLRequestContext to as a back end for | 17 // A simple URLFetcher that uses a net::URLRequestContext to as a back end for |
18 // http(s) fetches. | 18 // http(s) fetches. |
19 class HttpURLFetcher : public URLFetcher { | 19 class HttpURLFetcher : public URLFetcher { |
20 public: | 20 public: |
21 explicit HttpURLFetcher(const net::URLRequestContext* url_request_context); | 21 explicit HttpURLFetcher(const net::URLRequestContext* url_request_context); |
22 ~HttpURLFetcher() override; | 22 ~HttpURLFetcher() override; |
23 | 23 |
24 // URLFetcher implementation: | 24 // URLFetcher implementation: |
25 void StartFetch(const GURL& rewritten_url, | 25 void StartFetch(const GURL& rewritten_url, |
26 const std::string& method, | 26 const std::string& method, |
27 const net::HttpRequestHeaders& request_headers, | 27 const net::HttpRequestHeaders& request_headers, |
28 const std::string& devtools_request_id_, | |
Sami
2017/03/13 12:08:24
nit: no trailing underscore
alex clarke (OOO till 29th)
2017/03/13 13:38:22
Done.
| |
28 ResultListener* result_listener) override; | 29 ResultListener* result_listener) override; |
29 | 30 |
30 private: | 31 private: |
31 class Delegate; | 32 class Delegate; |
32 | 33 |
33 const net::URLRequestContext* url_request_context_; | 34 const net::URLRequestContext* url_request_context_; |
34 std::unique_ptr<Delegate> delegate_; | 35 std::unique_ptr<Delegate> delegate_; |
35 | 36 |
36 DISALLOW_COPY_AND_ASSIGN(HttpURLFetcher); | 37 DISALLOW_COPY_AND_ASSIGN(HttpURLFetcher); |
37 }; | 38 }; |
38 | 39 |
39 } // namespace headless | 40 } // namespace headless |
40 | 41 |
41 #endif // HEADLESS_PUBLIC_UTIL_HTTP_URL_FETCHER_H_ | 42 #endif // HEADLESS_PUBLIC_UTIL_HTTP_URL_FETCHER_H_ |
OLD | NEW |