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