socket_permission_request.h revision c2e0dbddbe15c98d52c4786dac06cb8952a8ae6d
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  };
23
24  SocketPermissionRequest(OperationType type,
25                          const std::string& host,
26                          int port)
27    : type(type),
28      host(host),
29      port(port) {
30  }
31
32  OperationType type;
33  std::string host;
34  int port;
35};
36
37}  // namespace content
38
39#endif  // CONTENT_PUBLIC_COMMON_SOCKET_PERMISSION_REQUEST_H_
40