Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Side by Side Diff: extensions/common/permissions/socket_permission_entry.h

Issue 201203006: Move basic API permissions code out of //chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move moar things Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 #ifndef CHROME_COMMON_EXTENSIONS_PERMISSIONS_SOCKET_PERMISSION_ENTRY_H_ 4 #ifndef EXTENSIONS_COMMON_PERMISSIONS_SOCKET_PERMISSION_ENTRY_H_
5 #define CHROME_COMMON_EXTENSIONS_PERMISSIONS_SOCKET_PERMISSION_ENTRY_H_ 5 #define EXTENSIONS_COMMON_PERMISSIONS_SOCKET_PERMISSION_ENTRY_H_
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "content/public/common/socket_permission_request.h" 10 #include "content/public/common/socket_permission_request.h"
11 #include "ipc/ipc_param_traits.h" 11 #include "ipc/ipc_param_traits.h"
12 12
13 namespace ipc_fuzzer { 13 namespace ipc_fuzzer {
14 template <class T> struct FuzzTraits; 14 template <class T>
15 template <class T> struct GenerateTraits; 15 struct FuzzTraits;
16 template <class T>
17 struct GenerateTraits;
16 } // namespace ipc_fuzzer 18 } // namespace ipc_fuzzer
17 19
18 namespace extensions { 20 namespace extensions {
19 21
20 // Internal representation of a socket permission for a specific operation, such 22 // Internal representation of a socket permission for a specific operation, such
21 // as UDP "bind", host 127.0.0.1, port *. 23 // as UDP "bind", host 127.0.0.1, port *.
22 class SocketPermissionEntry { 24 class SocketPermissionEntry {
23 public: 25 public:
24 enum HostType { 26 enum HostType { ANY_HOST, HOSTS_IN_DOMAINS, SPECIFIC_HOSTS, };
25 ANY_HOST,
26 HOSTS_IN_DOMAINS,
27 SPECIFIC_HOSTS,
28 };
29 27
30 SocketPermissionEntry(); 28 SocketPermissionEntry();
31 ~SocketPermissionEntry(); 29 ~SocketPermissionEntry();
32 30
33 // operators <, == are needed by container std::set and algorithms 31 // operators <, == are needed by container std::set and algorithms
34 // std::set_includes and std::set_differences. 32 // std::set_includes and std::set_differences.
35 bool operator<(const SocketPermissionEntry& rhs) const; 33 bool operator<(const SocketPermissionEntry& rhs) const;
36 bool operator==(const SocketPermissionEntry& rhs) const; 34 bool operator==(const SocketPermissionEntry& rhs) const;
37 35
38 bool Check(const content::SocketPermissionRequest& request) const; 36 bool Check(const content::SocketPermissionRequest& request) const;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 74
77 // The permission type, host and port. 75 // The permission type, host and port.
78 content::SocketPermissionRequest pattern_; 76 content::SocketPermissionRequest pattern_;
79 77
80 // True if there was a wildcard in the host name. 78 // True if there was a wildcard in the host name.
81 bool match_subdomains_; 79 bool match_subdomains_;
82 }; 80 };
83 81
84 } // namespace extensions 82 } // namespace extensions
85 83
86 #endif // CHROME_COMMON_EXTENSIONS_PERMISSIONS_SOCKET_PERMISSION_ENTRY_H_ 84 #endif // EXTENSIONS_COMMON_PERMISSIONS_SOCKET_PERMISSION_ENTRY_H_
OLDNEW
« no previous file with comments | « extensions/common/permissions/socket_permission_data.cc ('k') | extensions/common/permissions/socket_permission_entry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698