| 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 CONTENT_PUBLIC_COMMON_SOCKET_PERMISSION_REQUEST_H_ | 5 #ifndef CONTENT_PUBLIC_COMMON_SOCKET_PERMISSION_REQUEST_H_ |
| 6 #define CONTENT_PUBLIC_COMMON_SOCKET_PERMISSION_REQUEST_H_ | 6 #define CONTENT_PUBLIC_COMMON_SOCKET_PERMISSION_REQUEST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" |
| 11 |
| 10 namespace content { | 12 namespace content { |
| 11 | 13 |
| 12 // This module provides helper types for checking socket permission. | 14 // This module provides helper types for checking socket permission. |
| 13 | 15 |
| 14 struct SocketPermissionRequest { | 16 struct SocketPermissionRequest { |
| 15 enum OperationType { | 17 enum OperationType { |
| 16 NONE = 0, | 18 NONE = 0, |
| 17 TCP_CONNECT, | 19 TCP_CONNECT, |
| 18 TCP_LISTEN, | 20 TCP_LISTEN, |
| 19 UDP_BIND, | 21 UDP_BIND, |
| 20 UDP_SEND_TO, | 22 UDP_SEND_TO, |
| 21 UDP_MULTICAST_MEMBERSHIP, | 23 UDP_MULTICAST_MEMBERSHIP, |
| 22 RESOLVE_HOST, | 24 RESOLVE_HOST, |
| 23 RESOLVE_PROXY, | 25 RESOLVE_PROXY, |
| 24 NETWORK_STATE, | 26 NETWORK_STATE, |
| 25 OPERATION_TYPE_LAST = NETWORK_STATE | 27 OPERATION_TYPE_LAST = NETWORK_STATE |
| 26 }; | 28 }; |
| 27 | 29 |
| 28 SocketPermissionRequest(OperationType type, | 30 SocketPermissionRequest(OperationType type, |
| 29 const std::string& host, | 31 const std::string& host, |
| 30 int port) | 32 uint16 port) |
| 31 : type(type), | 33 : type(type), |
| 32 host(host), | 34 host(host), |
| 33 port(port) { | 35 port(port) { |
| 34 } | 36 } |
| 35 | 37 |
| 36 OperationType type; | 38 OperationType type; |
| 37 std::string host; | 39 std::string host; |
| 38 int port; | 40 uint16 port; |
| 39 }; | 41 }; |
| 40 | 42 |
| 41 } // namespace content | 43 } // namespace content |
| 42 | 44 |
| 43 #endif // CONTENT_PUBLIC_COMMON_SOCKET_PERMISSION_REQUEST_H_ | 45 #endif // CONTENT_PUBLIC_COMMON_SOCKET_PERMISSION_REQUEST_H_ |
| OLD | NEW |