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

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

Issue 2352663003: Adds a --deterministic-fetch flag to headless_shell (Closed)
Patch Set: Changed a few comments 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
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_

Powered by Google App Engine
This is Rietveld 408576698