Chromium Code Reviews| Index: headless/public/util/http_url_fetcher.h |
| diff --git a/headless/public/util/http_url_fetcher.h b/headless/public/util/http_url_fetcher.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..b74b3e1399e314ec0e92362b5497fc1a1e0fc446 |
| --- /dev/null |
| +++ b/headless/public/util/http_url_fetcher.h |
| @@ -0,0 +1,41 @@ |
| +// Copyright 2016 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 HEADLESS_PUBLIC_UTIL_HTTP_URL_FETCHER_H_ |
| +#define HEADLESS_PUBLIC_UTIL_HTTP_URL_FETCHER_H_ |
| + |
| +#include "base/macros.h" |
| +#include "headless/public/util/url_fetcher.h" |
| + |
| +namespace net { |
| +class URLRequestContext; |
| +class URLRequestJobFactory; |
| +} // namespace |
| + |
| +namespace headless { |
| + |
| +// A simple URLFetcher that wraps a net::URLRequest. |
|
Sami
2016/09/23 14:27:29
net::URLRequestContext?
alex clarke (OOO till 29th)
2016/09/23 16:40:27
Done.
|
| +class HttpUrlFetcher : public URLFetcher { |
|
Sami
2016/09/23 14:27:29
nit: "URL" to match the interface. Maybe we should
alex clarke (OOO till 29th)
2016/09/23 16:40:26
Done.
|
| + public: |
| + explicit HttpUrlFetcher(const net::URLRequestContext* url_request_context); |
| + ~HttpUrlFetcher() override; |
| + |
| + // URLFetcher implementation: |
| + void StartFetch(const GURL& rewritten_url, |
| + const std::string& method, |
| + const net::HttpRequestHeaders& request_headers, |
| + ResultListener* result_listener) override; |
| + |
| + private: |
| + class Delegate; |
| + |
| + const net::URLRequestContext* url_request_context_; |
| + std::unique_ptr<Delegate> delagate_; |
|
Sami
2016/09/23 14:27:29
typo: delegate_
alex clarke (OOO till 29th)
2016/09/23 16:40:26
Done.
|
| + |
| + DISALLOW_COPY_AND_ASSIGN(HttpUrlFetcher); |
| +}; |
| + |
| +} // namespace headless |
| + |
| +#endif // HEADLESS_PUBLIC_UTIL_HTTP_URL_FETCHER_H_ |