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 <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 // by a cache hit. | 384 // by a cache hit. |
385 load_timing_info->socket_reused = true; | 385 load_timing_info->socket_reused = true; |
386 load_timing_info->send_start = base::TimeTicks::Now(); | 386 load_timing_info->send_start = base::TimeTicks::Now(); |
387 load_timing_info->send_end = base::TimeTicks::Now(); | 387 load_timing_info->send_end = base::TimeTicks::Now(); |
388 } | 388 } |
389 return true; | 389 return true; |
390 } | 390 } |
391 | 391 |
392 bool MockNetworkTransaction::GetRemoteEndpoint(IPEndPoint* endpoint) const { | 392 bool MockNetworkTransaction::GetRemoteEndpoint(IPEndPoint* endpoint) const { |
393 IPAddress ip_address; | 393 IPAddress ip_address; |
394 CHECK(IPAddress::FromIPLiteral("127.0.0.1", &ip_address)); | 394 CHECK(ip_address.AssignFromIPLiteral("127.0.0.1")); |
395 *endpoint = IPEndPoint(ip_address, 80); | 395 *endpoint = IPEndPoint(ip_address, 80); |
396 return true; | 396 return true; |
397 } | 397 } |
398 | 398 |
399 void MockNetworkTransaction::SetPriority(RequestPriority priority) { | 399 void MockNetworkTransaction::SetPriority(RequestPriority priority) { |
400 priority_ = priority; | 400 priority_ = priority; |
401 } | 401 } |
402 | 402 |
403 void MockNetworkTransaction::SetWebSocketHandshakeStreamCreateHelper( | 403 void MockNetworkTransaction::SetWebSocketHandshakeStreamCreateHelper( |
404 WebSocketHandshakeStreamBase::CreateHelper* create_helper) { | 404 WebSocketHandshakeStreamBase::CreateHelper* create_helper) { |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 content.append(buf->data(), rv); | 570 content.append(buf->data(), rv); |
571 else if (rv < 0) | 571 else if (rv < 0) |
572 return rv; | 572 return rv; |
573 } while (rv > 0); | 573 } while (rv > 0); |
574 | 574 |
575 result->swap(content); | 575 result->swap(content); |
576 return OK; | 576 return OK; |
577 } | 577 } |
578 | 578 |
579 } // namespace net | 579 } // namespace net |
OLD | NEW |