| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 CONTENT_PUBLIC_TEST_TEST_DOWNLOAD_REQUEST_HANDLER_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_TEST_DOWNLOAD_REQUEST_HANDLER_H_ |
| 6 #define CONTENT_PUBLIC_TEST_TEST_DOWNLOAD_REQUEST_HANDLER_H_ | 6 #define CONTENT_PUBLIC_TEST_TEST_DOWNLOAD_REQUEST_HANDLER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <queue> | 9 #include <queue> |
| 10 | 10 |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 // Notes: | 189 // Notes: |
| 190 // | 190 // |
| 191 // * Distinctions about which read requests signal the error is often only | 191 // * Distinctions about which read requests signal the error is often only |
| 192 // important at the //net layer. From //content, it would appear that 100 | 192 // important at the //net layer. From //content, it would appear that 100 |
| 193 // bytes were read and then request failed with ERR_CONNECTION_RESET. | 193 // bytes were read and then request failed with ERR_CONNECTION_RESET. |
| 194 std::queue<InjectedError> injected_errors; | 194 std::queue<InjectedError> injected_errors; |
| 195 }; | 195 }; |
| 196 | 196 |
| 197 // Details about completed requests returned by GetCompletedRequestInfo(). | 197 // Details about completed requests returned by GetCompletedRequestInfo(). |
| 198 struct CompletedRequest { | 198 struct CompletedRequest { |
| 199 CompletedRequest(); |
| 200 CompletedRequest(CompletedRequest&&); |
| 201 ~CompletedRequest(); |
| 202 |
| 199 // Count of bytes read by the client of the URLRequestJob. This counts the | 203 // Count of bytes read by the client of the URLRequestJob. This counts the |
| 200 // number of bytes of the entity that was transferred *after* content | 204 // number of bytes of the entity that was transferred *after* content |
| 201 // decoding is complete. | 205 // decoding is complete. |
| 202 int64_t transferred_byte_count = -1; | 206 int64_t transferred_byte_count = -1; |
| 203 | 207 |
| 204 net::HttpRequestHeaders request_headers; | 208 net::HttpRequestHeaders request_headers; |
| 209 |
| 210 std::string referrer; |
| 211 net::URLRequest::ReferrerPolicy referrer_policy = |
| 212 net::URLRequest::NEVER_CLEAR_REFERRER; |
| 213 |
| 214 GURL first_party_for_cookies; |
| 215 net::URLRequest::FirstPartyURLPolicy first_party_url_policy = |
| 216 net::URLRequest::NEVER_CHANGE_FIRST_PARTY_URL; |
| 217 |
| 218 url::Origin initiator; |
| 219 |
| 220 private: |
| 221 DISALLOW_COPY_AND_ASSIGN(CompletedRequest); |
| 205 }; | 222 }; |
| 206 | 223 |
| 207 using CompletedRequests = std::vector<CompletedRequest>; | 224 using CompletedRequests = std::vector<std::unique_ptr<CompletedRequest>>; |
| 208 | 225 |
| 209 // Registers a request handler at the default URL. Call url() to determine the | 226 // Registers a request handler at the default URL. Call url() to determine the |
| 210 // URL. | 227 // URL. |
| 211 // | 228 // |
| 212 // Notes: | 229 // Notes: |
| 213 // * This constructor is only meant to be used for convenience when the caller | 230 // * This constructor is only meant to be used for convenience when the caller |
| 214 // is not interested in the URL used for interception. The URL used is | 231 // is not interested in the URL used for interception. The URL used is |
| 215 // generated at run time and should not be assumed to be the same across | 232 // generated at run time and should not be assumed to be the same across |
| 216 // different runs of the same test. | 233 // different runs of the same test. |
| 217 // | 234 // |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 class PartialResponseJob; | 314 class PartialResponseJob; |
| 298 | 315 |
| 299 GURL url_; | 316 GURL url_; |
| 300 base::WeakPtr<Interceptor> interceptor_; | 317 base::WeakPtr<Interceptor> interceptor_; |
| 301 DISALLOW_COPY_AND_ASSIGN(TestDownloadRequestHandler); | 318 DISALLOW_COPY_AND_ASSIGN(TestDownloadRequestHandler); |
| 302 }; | 319 }; |
| 303 | 320 |
| 304 } // namespace content | 321 } // namespace content |
| 305 | 322 |
| 306 #endif // CONTENT_PUBLIC_TEST_TEST_DOWNLOAD_REQUEST_HANDLER_H_ | 323 #endif // CONTENT_PUBLIC_TEST_TEST_DOWNLOAD_REQUEST_HANDLER_H_ |
| OLD | NEW |