Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(808)

Unified Diff: headless/public/util/http_url_fetcher.h

Issue 2352663003: Adds a --deterministic-fetch flag to headless_shell (Closed)
Patch Set: Changes for Sami Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « headless/public/util/generic_url_request_job_test.cc ('k') | headless/public/util/http_url_fetcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..2b17287d8fd19f5c4d740c367e3c6ebf370d49e8
--- /dev/null
+++ b/headless/public/util/http_url_fetcher.h
@@ -0,0 +1,42 @@
+// 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 uses a net::URLRequestContext to as a back end for
+// http(s) fetches.
+class HttpURLFetcher : public URLFetcher {
+ 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> delegate_;
+
+ DISALLOW_COPY_AND_ASSIGN(HttpURLFetcher);
+};
+
+} // namespace headless
+
+#endif // HEADLESS_PUBLIC_UTIL_HTTP_URL_FETCHER_H_
« no previous file with comments | « headless/public/util/generic_url_request_job_test.cc ('k') | headless/public/util/http_url_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698