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 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 | 432 |
433 void MockNetworkTransaction::SetBeforeProxyHeadersSentCallback( | 433 void MockNetworkTransaction::SetBeforeProxyHeadersSentCallback( |
434 const BeforeProxyHeadersSentCallback& callback) { | 434 const BeforeProxyHeadersSentCallback& callback) { |
435 } | 435 } |
436 | 436 |
437 int MockNetworkTransaction::ResumeNetworkStart() { | 437 int MockNetworkTransaction::ResumeNetworkStart() { |
438 // Should not get here. | 438 // Should not get here. |
439 return ERR_FAILED; | 439 return ERR_FAILED; |
440 } | 440 } |
441 | 441 |
| 442 void MockNetworkTransaction::GetConnectionAttempts( |
| 443 ConnectionAttempts* out) const { |
| 444 NOTIMPLEMENTED(); |
| 445 } |
| 446 |
442 void MockNetworkTransaction::CallbackLater(const CompletionCallback& callback, | 447 void MockNetworkTransaction::CallbackLater(const CompletionCallback& callback, |
443 int result) { | 448 int result) { |
444 base::MessageLoop::current()->PostTask( | 449 base::MessageLoop::current()->PostTask( |
445 FROM_HERE, base::Bind(&MockNetworkTransaction::RunCallback, | 450 FROM_HERE, base::Bind(&MockNetworkTransaction::RunCallback, |
446 weak_factory_.GetWeakPtr(), callback, result)); | 451 weak_factory_.GetWeakPtr(), callback, result)); |
447 } | 452 } |
448 | 453 |
449 void MockNetworkTransaction::RunCallback(const CompletionCallback& callback, | 454 void MockNetworkTransaction::RunCallback(const CompletionCallback& callback, |
450 int result) { | 455 int result) { |
451 callback.Run(result); | 456 callback.Run(result); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 content.append(buf->data(), rv); | 523 content.append(buf->data(), rv); |
519 else if (rv < 0) | 524 else if (rv < 0) |
520 return rv; | 525 return rv; |
521 } while (rv > 0); | 526 } while (rv > 0); |
522 | 527 |
523 result->swap(content); | 528 result->swap(content); |
524 return OK; | 529 return OK; |
525 } | 530 } |
526 | 531 |
527 } // namespace net | 532 } // namespace net |
OLD | NEW |