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

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

Issue 2695923010: Add Network.setSendRequestIdHeader and use it in headless (Closed)
Patch Set: Fix the layout test Created 3 years, 10 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 850f0ce6c99044c02473bda63e53583a27a9ae1c..1bb0890553121e09d2b7797c0f958ae34384876d 100644
--- a/headless/public/util/generic_url_request_job.h
+++ b/headless/public/util/generic_url_request_job.h
@@ -58,21 +58,38 @@ 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& devtools_id,
const std::string& method,
const std::string& referrer,
- RewriteCallback callback) = 0;
+ RewriteCallback callback);
+ // TODO(alexclarke): Make the above pure virtual and remove this.
+ virtual bool BlockOrRewriteRequest(const GURL& url,
+ const std::string& method,
+ const std::string& referrer,
+ RewriteCallback callback);
// Allows the delegate to synchronously fulfill a request with a reply.
// Called on an arbitrary thread.
virtual const HttpResponse* MaybeMatchResource(
const GURL& url,
+ const std::string& devtools_id,
+ const std::string& method,
+ const net::HttpRequestHeaders& request_headers);
+ // TODO(alexclarke): Make the above pure virtual and remove this.
+ virtual const HttpResponse* MaybeMatchResource(
+ const GURL& url,
const std::string& method,
- const net::HttpRequestHeaders& request_headers) = 0;
+ const net::HttpRequestHeaders& request_headers);
// Signals that a resource load has finished. Called on an arbitrary thread.
virtual void OnResourceLoadComplete(const GURL& final_url,
+ const std::string& devtools_id,
+ const std::string& mime_type,
+ int http_response_code);
+ // TODO(alexclarke): Make the above pure virtual and remove this.
+ virtual void OnResourceLoadComplete(const GURL& final_url,
const std::string& mime_type,
- int http_response_code) = 0;
+ int http_response_code) {}
protected:
virtual ~Delegate() {}
@@ -117,6 +134,7 @@ class GenericURLRequestJob : public ManagedDispatchURLRequestJob,
std::unique_ptr<URLFetcher> url_fetcher_;
net::HttpRequestHeaders extra_request_headers_;
scoped_refptr<net::HttpResponseHeaders> response_headers_;
+ std::string devtools_request_id_;
Delegate* delegate_; // Not owned.
const char* body_ = nullptr; // Not owned.
int http_response_code_ = 0;
« 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