| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "ppapi/proxy/ppapi_proxy_export.h" | |
| 9 | 8 |
| 10 namespace ppapi { | 9 namespace ppapi { |
| 11 namespace proxy { | 10 namespace proxy { |
| 12 | 11 |
| 13 class PPAPI_PROXY_EXPORT TCPSocketResourceConstants { | 12 class TCPSocketResourceConstants { |
| 14 public: | 13 public: |
| 15 // The maximum number of bytes that each PpapiHostMsg_PPBTCPSocket_Read | 14 // The maximum number of bytes that each PpapiHostMsg_PPBTCPSocket_Read |
| 16 // message is allowed to request. | 15 // message is allowed to request. |
| 17 static const int32_t kMaxReadSize; | 16 enum { kMaxReadSize = 1024 * 1024 }; |
| 18 // The maximum number of bytes that each PpapiHostMsg_PPBTCPSocket_Write | 17 // The maximum number of bytes that each PpapiHostMsg_PPBTCPSocket_Write |
| 19 // message is allowed to carry. | 18 // message is allowed to carry. |
| 20 static const int32_t kMaxWriteSize; | 19 enum { kMaxWriteSize = 1024 * 1024 }; |
| 21 | 20 |
| 22 // The maximum number that we allow for setting | 21 // The maximum number that we allow for setting |
| 23 // PP_TCPSOCKET_OPTION_SEND_BUFFER_SIZE. This number is only for input | 22 // PP_TCPSOCKET_OPTION_SEND_BUFFER_SIZE. This number is only for input |
| 24 // argument sanity check, it doesn't mean the browser guarantees to support | 23 // argument sanity check, it doesn't mean the browser guarantees to support |
| 25 // such a buffer size. | 24 // such a buffer size. |
| 26 static const int32_t kMaxSendBufferSize; | 25 enum { kMaxSendBufferSize = 1024 * kMaxWriteSize }; |
| 27 // The maximum number that we allow for setting | 26 // The maximum number that we allow for setting |
| 28 // PP_TCPSOCKET_OPTION_RECV_BUFFER_SIZE. This number is only for input | 27 // PP_TCPSOCKET_OPTION_RECV_BUFFER_SIZE. This number is only for input |
| 29 // argument sanity check, it doesn't mean the browser guarantees to support | 28 // argument sanity check, it doesn't mean the browser guarantees to support |
| 30 // such a buffer size. | 29 // such a buffer size. |
| 31 static const int32_t kMaxReceiveBufferSize; | 30 enum { kMaxReceiveBufferSize = 1024 * kMaxReadSize }; |
| 32 | 31 |
| 33 private: | 32 private: |
| 34 DISALLOW_COPY_AND_ASSIGN(TCPSocketResourceConstants); | 33 DISALLOW_COPY_AND_ASSIGN(TCPSocketResourceConstants); |
| 35 }; | 34 }; |
| 36 | 35 |
| 37 } // namespace proxy | 36 } // namespace proxy |
| 38 } // namespace ppapi | 37 } // namespace ppapi |
| OLD | NEW |