OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_test_util.h" | 5 #include "net/http/http_transaction_test_util.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <unordered_map> | 8 #include <unordered_map> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 const HttpResponseInfo* MockNetworkTransaction::GetResponseInfo() const { | 345 const HttpResponseInfo* MockNetworkTransaction::GetResponseInfo() const { |
346 return &response_; | 346 return &response_; |
347 } | 347 } |
348 | 348 |
349 LoadState MockNetworkTransaction::GetLoadState() const { | 349 LoadState MockNetworkTransaction::GetLoadState() const { |
350 if (data_cursor_) | 350 if (data_cursor_) |
351 return LOAD_STATE_READING_RESPONSE; | 351 return LOAD_STATE_READING_RESPONSE; |
352 return LOAD_STATE_IDLE; | 352 return LOAD_STATE_IDLE; |
353 } | 353 } |
354 | 354 |
355 UploadProgress MockNetworkTransaction::GetUploadProgress() const { | |
356 return UploadProgress(); | |
357 } | |
358 | |
359 void MockNetworkTransaction::SetQuicServerInfo( | 355 void MockNetworkTransaction::SetQuicServerInfo( |
360 QuicServerInfo* quic_server_info) { | 356 QuicServerInfo* quic_server_info) { |
361 } | 357 } |
362 | 358 |
363 bool MockNetworkTransaction::GetLoadTimingInfo( | 359 bool MockNetworkTransaction::GetLoadTimingInfo( |
364 LoadTimingInfo* load_timing_info) const { | 360 LoadTimingInfo* load_timing_info) const { |
365 if (socket_log_id_ != NetLog::Source::kInvalidId) { | 361 if (socket_log_id_ != NetLog::Source::kInvalidId) { |
366 // The minimal set of times for a request that gets a response, assuming it | 362 // The minimal set of times for a request that gets a response, assuming it |
367 // gets a new socket. | 363 // gets a new socket. |
368 load_timing_info->socket_reused = false; | 364 load_timing_info->socket_reused = false; |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 content.append(buf->data(), rv); | 572 content.append(buf->data(), rv); |
577 else if (rv < 0) | 573 else if (rv < 0) |
578 return rv; | 574 return rv; |
579 } while (rv > 0); | 575 } while (rv > 0); |
580 | 576 |
581 result->swap(content); | 577 result->swap(content); |
582 return OK; | 578 return OK; |
583 } | 579 } |
584 | 580 |
585 } // namespace net | 581 } // namespace net |
OLD | NEW |