OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef NET_SOCKET_SOCKET_TEST_UTIL_H_ | 5 #ifndef NET_SOCKET_SOCKET_TEST_UTIL_H_ |
6 #define NET_SOCKET_SOCKET_TEST_UTIL_H_ | 6 #define NET_SOCKET_SOCKET_TEST_UTIL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
729 | 729 |
730 // DatagramSocket implementation. | 730 // DatagramSocket implementation. |
731 void Close() override; | 731 void Close() override; |
732 int GetPeerAddress(IPEndPoint* address) const override; | 732 int GetPeerAddress(IPEndPoint* address) const override; |
733 int GetLocalAddress(IPEndPoint* address) const override; | 733 int GetLocalAddress(IPEndPoint* address) const override; |
734 const BoundNetLog& NetLog() const override; | 734 const BoundNetLog& NetLog() const override; |
735 | 735 |
736 // DatagramClientSocket implementation. | 736 // DatagramClientSocket implementation. |
737 int BindToNetwork(NetworkChangeNotifier::NetworkHandle network) override; | 737 int BindToNetwork(NetworkChangeNotifier::NetworkHandle network) override; |
738 int BindToDefaultNetwork() override; | 738 int BindToDefaultNetwork() override; |
739 NetworkChangeNotifier::NetworkHandle GetBoundNetwork() override; | 739 NetworkChangeNotifier::NetworkHandle GetBoundNetwork() const override; |
740 int Connect(const IPEndPoint& address) override; | 740 int Connect(const IPEndPoint& address) override; |
741 | 741 |
742 // AsyncSocket implementation. | 742 // AsyncSocket implementation. |
743 void OnReadComplete(const MockRead& data) override; | 743 void OnReadComplete(const MockRead& data) override; |
744 void OnWriteComplete(int rv) override; | 744 void OnWriteComplete(int rv) override; |
745 void OnConnectComplete(const MockConnect& data) override; | 745 void OnConnectComplete(const MockConnect& data) override; |
746 void OnDataProviderDestroyed() override; | 746 void OnDataProviderDestroyed() override; |
747 | 747 |
748 void set_source_port(uint16_t port) { source_port_ = port; } | 748 void set_source_port(uint16_t port) { source_port_ = port; } |
749 uint16_t source_port() const { return source_port_; } | 749 uint16_t source_port() const { return source_port_; } |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
987 | 987 |
988 // Helper function to get the total data size of the MockReads in |reads|. | 988 // Helper function to get the total data size of the MockReads in |reads|. |
989 int64_t CountReadBytes(const MockRead reads[], size_t reads_size); | 989 int64_t CountReadBytes(const MockRead reads[], size_t reads_size); |
990 | 990 |
991 // Helper function to get the total data size of the MockWrites in |writes|. | 991 // Helper function to get the total data size of the MockWrites in |writes|. |
992 int64_t CountWriteBytes(const MockWrite writes[], size_t writes_size); | 992 int64_t CountWriteBytes(const MockWrite writes[], size_t writes_size); |
993 | 993 |
994 } // namespace net | 994 } // namespace net |
995 | 995 |
996 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_ | 996 #endif // NET_SOCKET_SOCKET_TEST_UTIL_H_ |
OLD | NEW |