| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "net/http/http_transaction_unittest.h" | 5 #include "net/http/http_transaction_unittest.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 | 257 |
| 258 std::string header_data = base::StringPrintf( | 258 std::string header_data = base::StringPrintf( |
| 259 "%s\n%s\n", resp_status.c_str(), resp_headers.c_str()); | 259 "%s\n%s\n", resp_status.c_str(), resp_headers.c_str()); |
| 260 std::replace(header_data.begin(), header_data.end(), '\n', '\0'); | 260 std::replace(header_data.begin(), header_data.end(), '\n', '\0'); |
| 261 | 261 |
| 262 response_.request_time = base::Time::Now(); | 262 response_.request_time = base::Time::Now(); |
| 263 if (!t->request_time.is_null()) | 263 if (!t->request_time.is_null()) |
| 264 response_.request_time = t->request_time; | 264 response_.request_time = t->request_time; |
| 265 | 265 |
| 266 response_.was_cached = false; | 266 response_.was_cached = false; |
| 267 response_.network_accessed = true; |
| 267 | 268 |
| 268 response_.response_time = base::Time::Now(); | 269 response_.response_time = base::Time::Now(); |
| 269 if (!t->response_time.is_null()) | 270 if (!t->response_time.is_null()) |
| 270 response_.response_time = t->response_time; | 271 response_.response_time = t->response_time; |
| 271 | 272 |
| 272 response_.headers = new net::HttpResponseHeaders(header_data); | 273 response_.headers = new net::HttpResponseHeaders(header_data); |
| 273 response_.vary_data.Init(*request, *response_.headers); | 274 response_.vary_data.Init(*request, *response_.headers); |
| 274 response_.ssl_info.cert_status = t->cert_status; | 275 response_.ssl_info.cert_status = t->cert_status; |
| 275 data_ = resp_data; | 276 data_ = resp_data; |
| 276 | 277 |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 | 409 |
| 409 if (rv > 0) | 410 if (rv > 0) |
| 410 content.append(buf->data(), rv); | 411 content.append(buf->data(), rv); |
| 411 else if (rv < 0) | 412 else if (rv < 0) |
| 412 return rv; | 413 return rv; |
| 413 } while (rv > 0); | 414 } while (rv > 0); |
| 414 | 415 |
| 415 result->swap(content); | 416 result->swap(content); |
| 416 return net::OK; | 417 return net::OK; |
| 417 } | 418 } |
| OLD | NEW |