| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/fuzzed_socket.h" | 5 #include "net/socket/fuzzed_socket.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/thread_task_runner_handle.h" | 12 #include "base/threading/thread_task_runner_handle.h" |
| 13 #include "net/base/fuzzed_data_provider.h" | 13 #include "net/base/fuzzed_data_provider.h" |
| 14 #include "net/base/io_buffer.h" | 14 #include "net/base/io_buffer.h" |
| 15 | 15 |
| 16 namespace net { | 16 namespace net { |
| 17 | 17 |
| 18 namespace { | 18 namespace { |
| 19 | 19 |
| 20 // Some of the socket errors that can be returned by normal socket connection | 20 // Some of the socket errors that can be returned by normal socket connection |
| 21 // attempts. | 21 // attempts. |
| 22 const Error kConnectErrors[] = { | 22 const Error kConnectErrors[] = { |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 void FuzzedSocket::OnConnectComplete(const CompletionCallback& callback, | 278 void FuzzedSocket::OnConnectComplete(const CompletionCallback& callback, |
| 279 int result) { | 279 int result) { |
| 280 CHECK(connect_pending_); | 280 CHECK(connect_pending_); |
| 281 connect_pending_ = false; | 281 connect_pending_ = false; |
| 282 if (result < 0) | 282 if (result < 0) |
| 283 error_pending_ = false; | 283 error_pending_ = false; |
| 284 callback.Run(result); | 284 callback.Run(result); |
| 285 } | 285 } |
| 286 | 286 |
| 287 } // namespace net | 287 } // namespace net |
| OLD | NEW |