| 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/socket/transport_client_socket_pool_test_util.h" | 5 #include "net/socket/transport_client_socket_pool_test_util.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 bool GetSSLInfo(SSLInfo* ssl_info) override { return false; } | 78 bool GetSSLInfo(SSLInfo* ssl_info) override { return false; } |
| 79 void GetConnectionAttempts(ConnectionAttempts* out) const override { | 79 void GetConnectionAttempts(ConnectionAttempts* out) const override { |
| 80 out->clear(); | 80 out->clear(); |
| 81 } | 81 } |
| 82 void ClearConnectionAttempts() override {} | 82 void ClearConnectionAttempts() override {} |
| 83 void AddConnectionAttempts(const ConnectionAttempts& attempts) override {} | 83 void AddConnectionAttempts(const ConnectionAttempts& attempts) override {} |
| 84 int64_t GetTotalReceivedBytes() const override { | 84 int64_t GetTotalReceivedBytes() const override { |
| 85 NOTIMPLEMENTED(); | 85 NOTIMPLEMENTED(); |
| 86 return 0; | 86 return 0; |
| 87 } | 87 } |
| 88 void DumpMemoryStats( |
| 89 base::trace_event::MemoryAllocatorDump* dump) const override { |
| 90 NOTREACHED(); |
| 91 } |
| 88 | 92 |
| 89 // Socket implementation. | 93 // Socket implementation. |
| 90 int Read(IOBuffer* buf, | 94 int Read(IOBuffer* buf, |
| 91 int buf_len, | 95 int buf_len, |
| 92 const CompletionCallback& callback) override { | 96 const CompletionCallback& callback) override { |
| 93 return ERR_FAILED; | 97 return ERR_FAILED; |
| 94 } | 98 } |
| 95 int Write(IOBuffer* buf, | 99 int Write(IOBuffer* buf, |
| 96 int buf_len, | 100 int buf_len, |
| 97 const CompletionCallback& callback) override { | 101 const CompletionCallback& callback) override { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 out->clear(); | 146 out->clear(); |
| 143 for (const auto& addr : addrlist_) | 147 for (const auto& addr : addrlist_) |
| 144 out->push_back(ConnectionAttempt(addr, ERR_CONNECTION_FAILED)); | 148 out->push_back(ConnectionAttempt(addr, ERR_CONNECTION_FAILED)); |
| 145 } | 149 } |
| 146 void ClearConnectionAttempts() override {} | 150 void ClearConnectionAttempts() override {} |
| 147 void AddConnectionAttempts(const ConnectionAttempts& attempts) override {} | 151 void AddConnectionAttempts(const ConnectionAttempts& attempts) override {} |
| 148 int64_t GetTotalReceivedBytes() const override { | 152 int64_t GetTotalReceivedBytes() const override { |
| 149 NOTIMPLEMENTED(); | 153 NOTIMPLEMENTED(); |
| 150 return 0; | 154 return 0; |
| 151 } | 155 } |
| 156 void DumpMemoryStats( |
| 157 base::trace_event::MemoryAllocatorDump* dump) const override { |
| 158 NOTREACHED(); |
| 159 } |
| 152 | 160 |
| 153 // Socket implementation. | 161 // Socket implementation. |
| 154 int Read(IOBuffer* buf, | 162 int Read(IOBuffer* buf, |
| 155 int buf_len, | 163 int buf_len, |
| 156 const CompletionCallback& callback) override { | 164 const CompletionCallback& callback) override { |
| 157 return ERR_FAILED; | 165 return ERR_FAILED; |
| 158 } | 166 } |
| 159 | 167 |
| 160 int Write(IOBuffer* buf, | 168 int Write(IOBuffer* buf, |
| 161 int buf_len, | 169 int buf_len, |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 } | 277 } |
| 270 void ClearConnectionAttempts() override { connection_attempts_.clear(); } | 278 void ClearConnectionAttempts() override { connection_attempts_.clear(); } |
| 271 void AddConnectionAttempts(const ConnectionAttempts& attempts) override { | 279 void AddConnectionAttempts(const ConnectionAttempts& attempts) override { |
| 272 connection_attempts_.insert(connection_attempts_.begin(), attempts.begin(), | 280 connection_attempts_.insert(connection_attempts_.begin(), attempts.begin(), |
| 273 attempts.end()); | 281 attempts.end()); |
| 274 } | 282 } |
| 275 int64_t GetTotalReceivedBytes() const override { | 283 int64_t GetTotalReceivedBytes() const override { |
| 276 NOTIMPLEMENTED(); | 284 NOTIMPLEMENTED(); |
| 277 return 0; | 285 return 0; |
| 278 } | 286 } |
| 287 void DumpMemoryStats( |
| 288 base::trace_event::MemoryAllocatorDump* dump) const override { |
| 289 NOTREACHED(); |
| 290 } |
| 279 | 291 |
| 280 // Socket implementation. | 292 // Socket implementation. |
| 281 int Read(IOBuffer* buf, | 293 int Read(IOBuffer* buf, |
| 282 int buf_len, | 294 int buf_len, |
| 283 const CompletionCallback& callback) override { | 295 const CompletionCallback& callback) override { |
| 284 return ERR_FAILED; | 296 return ERR_FAILED; |
| 285 } | 297 } |
| 286 | 298 |
| 287 int Write(IOBuffer* buf, | 299 int Write(IOBuffer* buf, |
| 288 int buf_len, | 300 int buf_len, |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 run_loop_quit_closure_ = run_loop.QuitClosure(); | 471 run_loop_quit_closure_ = run_loop.QuitClosure(); |
| 460 run_loop.Run(); | 472 run_loop.Run(); |
| 461 run_loop_quit_closure_.Reset(); | 473 run_loop_quit_closure_.Reset(); |
| 462 } | 474 } |
| 463 base::Closure trigger = triggerable_sockets_.front(); | 475 base::Closure trigger = triggerable_sockets_.front(); |
| 464 triggerable_sockets_.pop(); | 476 triggerable_sockets_.pop(); |
| 465 return trigger; | 477 return trigger; |
| 466 } | 478 } |
| 467 | 479 |
| 468 } // namespace net | 480 } // namespace net |
| OLD | NEW |