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_STREAM_SOCKET_H_ | 5 #ifndef NET_SOCKET_STREAM_SOCKET_H_ |
6 #define NET_SOCKET_STREAM_SOCKET_H_ | 6 #define NET_SOCKET_STREAM_SOCKET_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "net/base/net_export.h" | 11 #include "net/base/net_export.h" |
12 #include "net/socket/connection_attempts.h" | 12 #include "net/socket/connection_attempts.h" |
13 #include "net/socket/next_proto.h" | 13 #include "net/socket/next_proto.h" |
14 #include "net/socket/socket.h" | 14 #include "net/socket/socket.h" |
15 | 15 |
| 16 namespace base { |
| 17 namespace trace_event { |
| 18 class ProcessMemoryDump; |
| 19 } |
| 20 } |
| 21 |
16 namespace net { | 22 namespace net { |
17 | 23 |
18 class IPEndPoint; | 24 class IPEndPoint; |
19 class NetLogWithSource; | 25 class NetLogWithSource; |
20 class SSLInfo; | 26 class SSLInfo; |
21 | 27 |
22 class NET_EXPORT_PRIVATE StreamSocket : public Socket { | 28 class NET_EXPORT_PRIVATE StreamSocket : public Socket { |
23 public: | 29 public: |
24 ~StreamSocket() override {} | 30 ~StreamSocket() override {} |
25 | 31 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 109 |
104 // Adds |attempts| to the socket's list of connection attempts. | 110 // Adds |attempts| to the socket's list of connection attempts. |
105 virtual void AddConnectionAttempts(const ConnectionAttempts& attempts) = 0; | 111 virtual void AddConnectionAttempts(const ConnectionAttempts& attempts) = 0; |
106 | 112 |
107 // Returns the total number of number bytes read by the socket. This only | 113 // Returns the total number of number bytes read by the socket. This only |
108 // counts the payload bytes. Transport headers are not counted. Returns | 114 // counts the payload bytes. Transport headers are not counted. Returns |
109 // 0 if the socket does not implement the function. The count is reset when | 115 // 0 if the socket does not implement the function. The count is reset when |
110 // Disconnect() is called. | 116 // Disconnect() is called. |
111 virtual int64_t GetTotalReceivedBytes() const = 0; | 117 virtual int64_t GetTotalReceivedBytes() const = 0; |
112 | 118 |
| 119 // Dumps memory allocation stats. |parent_dump_absolute_name| is the name |
| 120 // used by the parent MemoryAllocatorDump in the memory dump hierarchy. |
| 121 // Default implementation does nothing. |
| 122 virtual void DumpMemoryStats( |
| 123 base::trace_event::ProcessMemoryDump* pmd, |
| 124 const std::string& parent_dump_absolute_name) const {}; |
| 125 |
113 protected: | 126 protected: |
114 // The following class is only used to gather statistics about the history of | 127 // The following class is only used to gather statistics about the history of |
115 // a socket. It is only instantiated and used in basic sockets, such as | 128 // a socket. It is only instantiated and used in basic sockets, such as |
116 // TCPClientSocket* instances. Other classes that are derived from | 129 // TCPClientSocket* instances. Other classes that are derived from |
117 // StreamSocket should forward any potential settings to their underlying | 130 // StreamSocket should forward any potential settings to their underlying |
118 // transport sockets. | 131 // transport sockets. |
119 class UseHistory { | 132 class UseHistory { |
120 public: | 133 public: |
121 UseHistory(); | 134 UseHistory(); |
122 ~UseHistory(); | 135 ~UseHistory(); |
(...skipping 26 matching lines...) Expand all Loading... |
149 // identify the motivation. | 162 // identify the motivation. |
150 bool omnibox_speculation_; | 163 bool omnibox_speculation_; |
151 bool subresource_speculation_; | 164 bool subresource_speculation_; |
152 DISALLOW_COPY_AND_ASSIGN(UseHistory); | 165 DISALLOW_COPY_AND_ASSIGN(UseHistory); |
153 }; | 166 }; |
154 }; | 167 }; |
155 | 168 |
156 } // namespace net | 169 } // namespace net |
157 | 170 |
158 #endif // NET_SOCKET_STREAM_SOCKET_H_ | 171 #endif // NET_SOCKET_STREAM_SOCKET_H_ |
OLD | NEW |