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

Unified Diff: headless/public/util/generic_url_request_job.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
Index: headless/public/util/generic_url_request_job.h
diff --git a/headless/public/util/generic_url_request_job.h b/headless/public/util/generic_url_request_job.h
index 63e5d8ee192db6ff908a89a2f694a7749db1ca7d..514a5e176f9a72d0b243f8c360915a391d25b03d 100644
--- a/headless/public/util/generic_url_request_job.h
+++ b/headless/public/util/generic_url_request_job.h
@@ -38,8 +38,8 @@ class GenericURLRequestJob : public ManagedDispatchURLRequestJob,
public URLFetcher::ResultListener {
public:
enum class RewriteResult { kAllow, kDeny, kFailure };
- using RewriteCallback =
- std::function<void(RewriteResult result, const GURL& url)>;
+ using RewriteCallback = std::function<
+ void(RewriteResult result, const GURL& url, const std::string& method)>;
struct HttpResponse {
GURL final_url;
@@ -58,6 +58,7 @@ class GenericURLRequestJob : public ManagedDispatchURLRequestJob,
// with the result, or false to indicate that no rewriting is necessary.
// Called on an arbitrary thread.
virtual bool BlockOrRewriteRequest(const GURL& url,
+ const std::string& method,
const std::string& referrer,
RewriteCallback callback) = 0;
@@ -65,6 +66,7 @@ class GenericURLRequestJob : public ManagedDispatchURLRequestJob,
// Called on an arbitrary thread.
virtual const HttpResponse* MaybeMatchResource(
const GURL& url,
+ const std::string& method,
const net::HttpRequestHeaders& request_headers) = 0;
// Signals that a resource load has finished. Called on an arbitrary thread.
@@ -104,9 +106,11 @@ class GenericURLRequestJob : public ManagedDispatchURLRequestJob,
private:
void PrepareCookies(const GURL& rewritten_url,
+ const std::string& method,
const url::Origin& site_for_cookies);
void OnCookiesAvailable(const GURL& rewritten_url,
+ const std::string& method,
const net::CookieList& cookie_list);
std::unique_ptr<URLFetcher> url_fetcher_;
« no previous file with comments | « headless/public/util/deterministic_http_protocol_handler.cc ('k') | headless/public/util/generic_url_request_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698