| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 PPAPI_PROXY_TCP_SOCKET_RESOURCE_BASE_H_ | 5 #ifndef PPAPI_PROXY_TCP_SOCKET_RESOURCE_BASE_H_ |
| 6 #define PPAPI_PROXY_TCP_SOCKET_RESOURCE_BASE_H_ | 6 #define PPAPI_PROXY_TCP_SOCKET_RESOURCE_BASE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <queue> | 10 #include <queue> |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "ppapi/shared_impl/tracked_callback.h" | 21 #include "ppapi/shared_impl/tracked_callback.h" |
| 22 | 22 |
| 23 namespace ppapi { | 23 namespace ppapi { |
| 24 | 24 |
| 25 class PPB_X509Certificate_Fields; | 25 class PPB_X509Certificate_Fields; |
| 26 class PPB_X509Certificate_Private_Shared; | 26 class PPB_X509Certificate_Private_Shared; |
| 27 | 27 |
| 28 namespace proxy { | 28 namespace proxy { |
| 29 | 29 |
| 30 class PPAPI_PROXY_EXPORT TCPSocketResourceBase : public PluginResource { | 30 class PPAPI_PROXY_EXPORT TCPSocketResourceBase : public PluginResource { |
| 31 public: | |
| 32 // TODO(yzshen): Move these constants to ppb_tcp_socket_shared. | |
| 33 // The maximum number of bytes that each PpapiHostMsg_PPBTCPSocket_Read | |
| 34 // message is allowed to request. | |
| 35 static const int32_t kMaxReadSize; | |
| 36 // The maximum number of bytes that each PpapiHostMsg_PPBTCPSocket_Write | |
| 37 // message is allowed to carry. | |
| 38 static const int32_t kMaxWriteSize; | |
| 39 | |
| 40 // The maximum number that we allow for setting | |
| 41 // PP_TCPSOCKET_OPTION_SEND_BUFFER_SIZE. This number is only for input | |
| 42 // argument sanity check, it doesn't mean the browser guarantees to support | |
| 43 // such a buffer size. | |
| 44 static const int32_t kMaxSendBufferSize; | |
| 45 // The maximum number that we allow for setting | |
| 46 // PP_TCPSOCKET_OPTION_RECV_BUFFER_SIZE. This number is only for input | |
| 47 // argument sanity check, it doesn't mean the browser guarantees to support | |
| 48 // such a buffer size. | |
| 49 static const int32_t kMaxReceiveBufferSize; | |
| 50 | |
| 51 protected: | 31 protected: |
| 52 // C-tor used for new sockets. | 32 // C-tor used for new sockets. |
| 53 TCPSocketResourceBase(Connection connection, | 33 TCPSocketResourceBase(Connection connection, |
| 54 PP_Instance instance, | 34 PP_Instance instance, |
| 55 TCPSocketVersion version); | 35 TCPSocketVersion version); |
| 56 | 36 |
| 57 // C-tor used for already accepted sockets. | 37 // C-tor used for already accepted sockets. |
| 58 TCPSocketResourceBase(Connection connection, | 38 TCPSocketResourceBase(Connection connection, |
| 59 PP_Instance instance, | 39 PP_Instance instance, |
| 60 TCPSocketVersion version, | 40 TCPSocketVersion version, |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 | 128 |
| 149 TCPSocketVersion version_; | 129 TCPSocketVersion version_; |
| 150 | 130 |
| 151 DISALLOW_COPY_AND_ASSIGN(TCPSocketResourceBase); | 131 DISALLOW_COPY_AND_ASSIGN(TCPSocketResourceBase); |
| 152 }; | 132 }; |
| 153 | 133 |
| 154 } // namespace proxy | 134 } // namespace proxy |
| 155 } // namespace ppapi | 135 } // namespace ppapi |
| 156 | 136 |
| 157 #endif // PPAPI_PROXY_TCP_SOCKET_RESOURCE_BASE_H_ | 137 #endif // PPAPI_PROXY_TCP_SOCKET_RESOURCE_BASE_H_ |
| OLD | NEW |