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