summaryrefslogtreecommitdiffstats
path: root/content/public/common/socket_permission_request.h
blob: b7b4389b9b4789f8c203b5bf51470d2ffc3c8f0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CONTENT_PUBLIC_COMMON_SOCKET_PERMISSION_REQUEST_H_
#define CONTENT_PUBLIC_COMMON_SOCKET_PERMISSION_REQUEST_H_

#include <string>

namespace content {

// This module provides helper types for checking socket permission.

struct SocketPermissionRequest {
  enum OperationType {
    NONE = 0,
    TCP_CONNECT,
    TCP_LISTEN,
    UDP_BIND,
    UDP_SEND_TO,
    UDP_MULTICAST_MEMBERSHIP,
    RESOLVE_HOST,
    RESOLVE_PROXY,
    NETWORK_STATE,
    OPERATION_TYPE_LAST = NETWORK_STATE
  };

  SocketPermissionRequest(OperationType type,
                          const std::string& host,
                          int port)
    : type(type),
      host(host),
      port(port) {
  }

  OperationType type;
  std::string host;
  int port;
};

}  // namespace content

#endif  // CONTENT_PUBLIC_COMMON_SOCKET_PERMISSION_REQUEST_H_