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

Side by Side Diff: headless/public/util/generic_url_request_job.h

Issue 2511143002: Implement GenericURLRequestJob::GetLoadTimingInfo (Closed)
Patch Set: Added a TODO Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | headless/public/util/generic_url_request_job.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef HEADLESS_PUBLIC_UTIL_GENERIC_URL_REQUEST_JOB_H_ 5 #ifndef HEADLESS_PUBLIC_UTIL_GENERIC_URL_REQUEST_JOB_H_
6 #define HEADLESS_PUBLIC_UTIL_GENERIC_URL_REQUEST_JOB_H_ 6 #define HEADLESS_PUBLIC_UTIL_GENERIC_URL_REQUEST_JOB_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <functional> 9 #include <functional>
10 #include <memory> 10 #include <memory>
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 ~GenericURLRequestJob() override; 88 ~GenericURLRequestJob() override;
89 89
90 // net::URLRequestJob implementation: 90 // net::URLRequestJob implementation:
91 void SetExtraRequestHeaders(const net::HttpRequestHeaders& headers) override; 91 void SetExtraRequestHeaders(const net::HttpRequestHeaders& headers) override;
92 void Start() override; 92 void Start() override;
93 int ReadRawData(net::IOBuffer* buf, int buf_size) override; 93 int ReadRawData(net::IOBuffer* buf, int buf_size) override;
94 int GetResponseCode() const override; 94 int GetResponseCode() const override;
95 void GetResponseInfo(net::HttpResponseInfo* info) override; 95 void GetResponseInfo(net::HttpResponseInfo* info) override;
96 bool GetMimeType(std::string* mime_type) const override; 96 bool GetMimeType(std::string* mime_type) const override;
97 bool GetCharset(std::string* charset) override; 97 bool GetCharset(std::string* charset) override;
98 void GetLoadTimingInfo(net::LoadTimingInfo* load_timing_info) const override;
98 99
99 // URLFetcher::FetchResultListener implementation: 100 // URLFetcher::FetchResultListener implementation:
100 void OnFetchStartError(net::Error error) override; 101 void OnFetchStartError(net::Error error) override;
101 void OnFetchComplete(const GURL& final_url, 102 void OnFetchComplete(const GURL& final_url,
102 int http_response_code, 103 int http_response_code,
103 scoped_refptr<net::HttpResponseHeaders> response_headers, 104 scoped_refptr<net::HttpResponseHeaders> response_headers,
104 const char* body, 105 const char* body,
105 size_t body_size) override; 106 size_t body_size) override;
106 107
107 private: 108 private:
108 void PrepareCookies(const GURL& rewritten_url, 109 void PrepareCookies(const GURL& rewritten_url,
109 const std::string& method, 110 const std::string& method,
110 const url::Origin& site_for_cookies); 111 const url::Origin& site_for_cookies);
111 112
112 void OnCookiesAvailable(const GURL& rewritten_url, 113 void OnCookiesAvailable(const GURL& rewritten_url,
113 const std::string& method, 114 const std::string& method,
114 const net::CookieList& cookie_list); 115 const net::CookieList& cookie_list);
115 116
116 std::unique_ptr<URLFetcher> url_fetcher_; 117 std::unique_ptr<URLFetcher> url_fetcher_;
117 net::HttpRequestHeaders extra_request_headers_; 118 net::HttpRequestHeaders extra_request_headers_;
118 scoped_refptr<net::HttpResponseHeaders> response_headers_; 119 scoped_refptr<net::HttpResponseHeaders> response_headers_;
119 Delegate* delegate_; // Not owned. 120 Delegate* delegate_; // Not owned.
120 const char* body_ = nullptr; // Not owned. 121 const char* body_ = nullptr; // Not owned.
121 int http_response_code_ = 0; 122 int http_response_code_ = 0;
122 size_t body_size_ = 0; 123 size_t body_size_ = 0;
123 size_t read_offset_ = 0; 124 size_t read_offset_ = 0;
125 base::TimeTicks response_time_;
124 126
125 base::WeakPtrFactory<GenericURLRequestJob> weak_factory_; 127 base::WeakPtrFactory<GenericURLRequestJob> weak_factory_;
126 128
127 DISALLOW_COPY_AND_ASSIGN(GenericURLRequestJob); 129 DISALLOW_COPY_AND_ASSIGN(GenericURLRequestJob);
128 }; 130 };
129 131
130 } // namespace headless 132 } // namespace headless
131 133
132 #endif // HEADLESS_PUBLIC_UTIL_GENERIC_URL_REQUEST_JOB_H_ 134 #endif // HEADLESS_PUBLIC_UTIL_GENERIC_URL_REQUEST_JOB_H_
OLDNEW
« 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