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 | 9 |
9 #include "base/bind.h" | 10 #include "base/bind.h" |
10 #include "base/location.h" | 11 #include "base/location.h" |
11 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
12 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
13 #include "base/strings/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
14 #include "base/thread_task_runner_handle.h" | 15 #include "base/thread_task_runner_handle.h" |
15 #include "base/time/clock.h" | 16 #include "base/time/clock.h" |
16 #include "base/time/time.h" | 17 #include "base/time/time.h" |
17 #include "net/base/load_flags.h" | 18 #include "net/base/load_flags.h" |
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 stop_caching_called_ = true; | 524 stop_caching_called_ = true; |
524 } | 525 } |
525 | 526 |
526 int MockNetworkLayer::CreateTransaction(RequestPriority priority, | 527 int MockNetworkLayer::CreateTransaction(RequestPriority priority, |
527 scoped_ptr<HttpTransaction>* trans) { | 528 scoped_ptr<HttpTransaction>* trans) { |
528 transaction_count_++; | 529 transaction_count_++; |
529 last_create_transaction_priority_ = priority; | 530 last_create_transaction_priority_ = priority; |
530 scoped_ptr<MockNetworkTransaction> mock_transaction( | 531 scoped_ptr<MockNetworkTransaction> mock_transaction( |
531 new MockNetworkTransaction(priority, this)); | 532 new MockNetworkTransaction(priority, this)); |
532 last_transaction_ = mock_transaction->AsWeakPtr(); | 533 last_transaction_ = mock_transaction->AsWeakPtr(); |
533 *trans = mock_transaction.Pass(); | 534 *trans = std::move(mock_transaction); |
534 return OK; | 535 return OK; |
535 } | 536 } |
536 | 537 |
537 HttpCache* MockNetworkLayer::GetCache() { | 538 HttpCache* MockNetworkLayer::GetCache() { |
538 return NULL; | 539 return NULL; |
539 } | 540 } |
540 | 541 |
541 HttpNetworkSession* MockNetworkLayer::GetSession() { | 542 HttpNetworkSession* MockNetworkLayer::GetSession() { |
542 return NULL; | 543 return NULL; |
543 } | 544 } |
(...skipping 28 matching lines...) Expand all Loading... |
572 content.append(buf->data(), rv); | 573 content.append(buf->data(), rv); |
573 else if (rv < 0) | 574 else if (rv < 0) |
574 return rv; | 575 return rv; |
575 } while (rv > 0); | 576 } while (rv > 0); |
576 | 577 |
577 result->swap(content); | 578 result->swap(content); |
578 return OK; | 579 return OK; |
579 } | 580 } |
580 | 581 |
581 } // namespace net | 582 } // namespace net |
OLD | NEW |