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

Unified Diff: content/public/browser/content_browser_client.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: nit 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: content/public/browser/content_browser_client.h
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
index 7c55235a193c638264456bdcf245ed43d82ce51d..644bc917aba02669c2c90b78bba78cd19e5844aa 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -83,6 +83,28 @@ struct ShowDesktopNotificationHostMsgParams;
// the observer interfaces.)
class CONTENT_EXPORT ContentBrowserClient {
public:
+ struct SocketPermissionParam {
jam 2012/10/10 20:48:30 please move this to a separate file (the conventio
Dmitry Polukhin 2012/10/17 09:25:54 Done.
jam 2012/10/17 15:22:42 why do you say it's odd? extensions is in chrome,
Dmitry Polukhin 2012/10/18 08:57:38 ** Presubmit ERRORS ** You added one or more #incl
jam 2012/10/18 15:37:15 this is because chrome\common is including from co
+ enum OperationType {
+ NONE = 0,
+ TCP_CONNECT,
+ TCP_LISTEN,
+ UDP_BIND,
+ UDP_SEND_TO,
+ };
+
+ SocketPermissionParam(OperationType type,
+ const std::string& host,
+ int port)
+ : type(type),
+ host(host),
+ port(port) {
+ }
+
+ OperationType type;
+ std::string host;
+ int port;
+ };
+
virtual ~ContentBrowserClient() {}
// Allows the embedder to set any number of custom BrowserMainParts
@@ -442,9 +464,10 @@ class CONTENT_EXPORT ContentBrowserClient {
virtual void DidCreatePpapiPlugin(BrowserPpapiHost* browser_host) {}
// Returns true if renderer processes can use Pepper TCP/UDP sockets from
- // the given origin.
+ // the given origin and connection type.
virtual bool AllowPepperSocketAPI(BrowserContext* browser_context,
- const GURL& url);
+ const GURL& url,
+ const SocketPermissionParam& params);
// Returns true if renderer processes can use private Pepper File APIs.
virtual bool AllowPepperPrivateFileAPI();
« no previous file with comments | « content/browser/renderer_host/pepper/pepper_udp_socket.h ('k') | content/public/browser/content_browser_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698