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

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

Issue 2822473002: Add GetPostData and ID to headless::Request plus fix GetFrameTreeNodeId (Closed)
Patch Set: Add a test for GetPostData Created 3 years, 8 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 | « no previous file | headless/public/util/generic_url_request_job.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 da6a4972e960d6acf4d9b911848ccef98a36c911..ba67f2d2f1fd4ef5b83a1da8d1844e78d0811c38 100644
--- a/headless/public/util/generic_url_request_job.h
+++ b/headless/public/util/generic_url_request_job.h
@@ -36,6 +36,8 @@ class URLRequestDispatcher;
// Wrapper around net::URLRequest with helpers to access select metadata.
class Request {
public:
+ virtual uint64_t GetRequestId() const = 0;
+
virtual const net::URLRequest* GetURLRequest() const = 0;
// The frame from which the request came from.
@@ -44,6 +46,9 @@ class Request {
// The devtools agent host id for the page where the request came from.
virtual std::string GetDevToolsAgentHostId() const = 0;
+ // Gets the POST data, if any, from the net::URLRequest.
+ virtual std::string GetPostData() const = 0;
+
enum class ResourceType {
MAIN_FRAME = 0,
SUB_FRAME = 1,
@@ -178,9 +183,11 @@ class HEADLESS_EXPORT GenericURLRequestJob
protected:
// Request implementation:
+ uint64_t GetRequestId() const override;
const net::URLRequest* GetURLRequest() const override;
int GetFrameTreeNodeId() const override;
std::string GetDevToolsAgentHostId() const override;
+ std::string GetPostData() const override;
ResourceType GetResourceType() const override;
// PendingRequest implementation:
@@ -215,6 +222,8 @@ class HEADLESS_EXPORT GenericURLRequestJob
size_t body_size_ = 0;
size_t read_offset_ = 0;
base::TimeTicks response_time_;
+ const uint64_t request_id_;
+ static uint64_t next_request_id_;
base::WeakPtrFactory<GenericURLRequestJob> weak_factory_;
« no previous file with comments | « no previous file | headless/public/util/generic_url_request_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698