OLD | NEW |
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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 scoped_refptr<net::HttpResponseHeaders> response_headers, | 148 scoped_refptr<net::HttpResponseHeaders> response_headers, |
149 const char* body, | 149 const char* body, |
150 size_t body_size) = 0; | 150 size_t body_size) = 0; |
151 | 151 |
152 protected: | 152 protected: |
153 virtual ~Delegate() {} | 153 virtual ~Delegate() {} |
154 }; | 154 }; |
155 | 155 |
156 // NOTE |url_request_dispatcher| and |delegate| must outlive the | 156 // NOTE |url_request_dispatcher| and |delegate| must outlive the |
157 // GenericURLRequestJob. | 157 // GenericURLRequestJob. |
158 // TODO(alexclarke): Remove the default parameter. | 158 GenericURLRequestJob(net::URLRequest* request, |
159 GenericURLRequestJob( | 159 net::NetworkDelegate* network_delegate, |
160 net::URLRequest* request, | 160 URLRequestDispatcher* url_request_dispatcher, |
161 net::NetworkDelegate* network_delegate, | 161 std::unique_ptr<URLFetcher> url_fetcher, |
162 URLRequestDispatcher* url_request_dispatcher, | 162 Delegate* delegate, |
163 std::unique_ptr<URLFetcher> url_fetcher, | 163 HeadlessBrowserContext* headless_browser_context); |
164 Delegate* delegate, | |
165 HeadlessBrowserContext* headless_browser_context = nullptr); | |
166 ~GenericURLRequestJob() override; | 164 ~GenericURLRequestJob() override; |
167 | 165 |
168 // net::URLRequestJob implementation: | 166 // net::URLRequestJob implementation: |
169 void SetExtraRequestHeaders(const net::HttpRequestHeaders& headers) override; | 167 void SetExtraRequestHeaders(const net::HttpRequestHeaders& headers) override; |
170 void Start() override; | 168 void Start() override; |
171 int ReadRawData(net::IOBuffer* buf, int buf_size) override; | 169 int ReadRawData(net::IOBuffer* buf, int buf_size) override; |
172 void GetResponseInfo(net::HttpResponseInfo* info) override; | 170 void GetResponseInfo(net::HttpResponseInfo* info) override; |
173 bool GetMimeType(std::string* mime_type) const override; | 171 bool GetMimeType(std::string* mime_type) const override; |
174 bool GetCharset(std::string* charset) override; | 172 bool GetCharset(std::string* charset) override; |
175 void GetLoadTimingInfo(net::LoadTimingInfo* load_timing_info) const override; | 173 void GetLoadTimingInfo(net::LoadTimingInfo* load_timing_info) const override; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 static uint64_t next_request_id_; | 224 static uint64_t next_request_id_; |
227 | 225 |
228 base::WeakPtrFactory<GenericURLRequestJob> weak_factory_; | 226 base::WeakPtrFactory<GenericURLRequestJob> weak_factory_; |
229 | 227 |
230 DISALLOW_COPY_AND_ASSIGN(GenericURLRequestJob); | 228 DISALLOW_COPY_AND_ASSIGN(GenericURLRequestJob); |
231 }; | 229 }; |
232 | 230 |
233 } // namespace headless | 231 } // namespace headless |
234 | 232 |
235 #endif // HEADLESS_PUBLIC_UTIL_GENERIC_URL_REQUEST_JOB_H_ | 233 #endif // HEADLESS_PUBLIC_UTIL_GENERIC_URL_REQUEST_JOB_H_ |
OLD | NEW |