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

Unified Diff: chrome/common/extensions/permissions/socket_permission_data.h

Issue 10993078: Use extensions socket permission for TCP/UDP socket APIs in Pepper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove duplication Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/permissions/socket_permission_data.h
diff --git a/chrome/common/extensions/permissions/socket_permission_data.h b/chrome/common/extensions/permissions/socket_permission_data.h
index 19d08a76eba108ba95a16555a17f2264e2560575..dc5732209ee0dc6865cb9b0eae43dedb038df552 100644
--- a/chrome/common/extensions/permissions/socket_permission_data.h
+++ b/chrome/common/extensions/permissions/socket_permission_data.h
@@ -6,6 +6,8 @@
#include <string>
+#include "content/public/browser/socket_permission_request.h"
+
namespace extensions {
// A pattern that can be used to match socket permission.
@@ -25,14 +27,6 @@ namespace extensions {
// <port number between 0 and 65535>)
class SocketPermissionData {
public:
- enum OperationType {
- NONE = 0,
- TCP_CONNECT,
- TCP_LISTEN,
- UDP_BIND,
- UDP_SEND_TO,
- };
-
enum HostType {
ANY_HOST,
HOSTS_IN_DOMAINS,
@@ -47,7 +41,7 @@ class SocketPermissionData {
bool operator<(const SocketPermissionData& rhs) const;
bool operator==(const SocketPermissionData& rhs) const;
- bool Match(OperationType type, const std::string& host, int port) const;
+ bool Match(content::SocketPermissionRequest request) const;
bool Parse(const std::string& permission);
@@ -59,7 +53,7 @@ class SocketPermissionData {
private:
void Reset();
- OperationType type_;
+ content::SocketPermissionRequest::OperationType type_;
jam 2012/10/18 15:37:15 why only bring in the enum here? i.e. why not the
dpolukhin 2012/10/18 18:01:00 This class represents pattern for matching not a r
jam 2012/10/18 18:17:06 I'm not sure I follow the distinction, i.e. why do
dpolukhin 2012/10/18 18:30:34 New SocketPermissionRequest has 1:1: correspondenc
jam 2012/10/18 21:21:34 so it's just a coincidence that they both have hos
Dmitry Polukhin 2012/10/19 09:24:00 They are related but not the same. But I did it be
std::string host_;
bool match_subdomains_;
int port_;

Powered by Google App Engine
This is Rietveld 408576698