socket_permission_request.h revision 5821806d5e7f356e8fa4b058a389a808ea183019
15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved. 25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file. 45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 5c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)#ifndef CONTENT_PUBLIC_COMMON_SOCKET_PERMISSION_REQUEST_H_ 65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define CONTENT_PUBLIC_COMMON_SOCKET_PERMISSION_REQUEST_H_ 75d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 85d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include <string> 95d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 105d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)namespace content { 115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// This module provides helper types for checking socket permission. 135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 14868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)struct SocketPermissionRequest { 155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) enum OperationType { 165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) NONE = 0, 175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) TCP_CONNECT, 185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) TCP_LISTEN, 195d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) UDP_BIND, 2090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) UDP_SEND_TO, 2190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) }; 2290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) 2390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) SocketPermissionRequest(OperationType type, 2490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) const std::string& host, 2590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) int port) 2690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) : type(type), 2790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) host(host), 2890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) port(port) { 2990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) } 3090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) 3190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) OperationType type; 3290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) std::string host; 3390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) int port; 3490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)}; 3590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) 3690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)} // namespace content 3790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) 3890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)#endif // CONTENT_PUBLIC_COMMON_SOCKET_PERMISSION_REQUEST_H_ 3990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)