Chromium Code Reviews| Index: net/socket/socket_test_util.cc |
| diff --git a/net/socket/socket_test_util.cc b/net/socket/socket_test_util.cc |
| index ddb4c6d47ab2f6f441592b3d43665f27e34d05aa..0a13c28d8559f003e773f81117eadf94a62b2a06 100644 |
| --- a/net/socket/socket_test_util.cc |
| +++ b/net/socket/socket_test_util.cc |
| @@ -1787,19 +1787,18 @@ int ClientSocketPoolTest::GetOrderOfRequest(size_t index) const { |
| return kIndexOutOfBounds; |
| for (size_t i = 0; i < request_order_.size(); i++) |
| - if (requests_[index] == request_order_[i]) |
| + if (requests_[index].get() == request_order_[i]) |
| return i + 1; |
| return kRequestNotFound; |
| } |
| bool ClientSocketPoolTest::ReleaseOneConnection(KeepAlive keep_alive) { |
| - ScopedVector<TestSocketRequest>::iterator i; |
| - for (i = requests_.begin(); i != requests_.end(); ++i) { |
| - if ((*i)->handle()->is_initialized()) { |
| + for (scoped_ptr<TestSocketRequest>& it : requests_) { |
| + if (it->handle()->is_initialized()) { |
| if (keep_alive == NO_KEEP_ALIVE) |
| - (*i)->handle()->socket()->Disconnect(); |
| - (*i)->handle()->Reset(); |
| + it->handle()->socket()->Disconnect(); |
| + it->handle()->Reset(); |
| base::RunLoop().RunUntilIdle(); |
| return true; |
| } |
| @@ -1904,16 +1903,15 @@ int MockTransportClientSocketPool::RequestSocket( |
| client_socket_factory_->CreateTransportClientSocket( |
| AddressList(), net_log.net_log(), NetLog::Source()); |
| MockConnectJob* job = new MockConnectJob(socket.Pass(), handle, callback); |
| - job_list_.push_back(job); |
| + job_list_.push_back(make_scoped_ptr(job)); |
|
mmenke
2015/11/19 16:26:12
Other comment applies here, too.
|
| handle->set_pool_id(1); |
| return job->Connect(); |
| } |
| void MockTransportClientSocketPool::CancelRequest(const std::string& group_name, |
| ClientSocketHandle* handle) { |
| - std::vector<MockConnectJob*>::iterator i; |
| - for (i = job_list_.begin(); i != job_list_.end(); ++i) { |
| - if ((*i)->CancelHandle(handle)) { |
| + for (scoped_ptr<MockConnectJob>& it : job_list_) { |
| + if (it->CancelHandle(handle)) { |
| cancel_count_++; |
| break; |
| } |