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

Side by Side Diff: content/browser/renderer_host/pepper/pepper_message_filter.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: fixed Android build Created 8 years, 1 month 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 4
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_MESSAGE_FILTER_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_MESSAGE_FILTER_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_MESSAGE_FILTER_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_MESSAGE_FILTER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/file_path.h" 13 #include "base/file_path.h"
14 #include "base/memory/linked_ptr.h" 14 #include "base/memory/linked_ptr.h"
15 #include "base/memory/scoped_ptr.h" 15 #include "base/memory/scoped_ptr.h"
16 #include "base/process.h" 16 #include "base/process.h"
17 #include "base/time.h" 17 #include "base/time.h"
18 #include "content/public/browser/browser_message_filter.h" 18 #include "content/public/browser/browser_message_filter.h"
19 #include "content/public/browser/content_browser_client.h"
19 #include "net/base/net_util.h" 20 #include "net/base/net_util.h"
20 #include "net/base/network_change_notifier.h" 21 #include "net/base/network_change_notifier.h"
21 #include "net/base/ssl_config_service.h" 22 #include "net/base/ssl_config_service.h"
22 #include "net/socket/stream_socket.h" 23 #include "net/socket/stream_socket.h"
23 #include "ppapi/c/pp_resource.h" 24 #include "ppapi/c/pp_resource.h"
24 #include "ppapi/c/pp_stdint.h" 25 #include "ppapi/c/pp_stdint.h"
25 #include "ppapi/c/private/ppb_flash.h" 26 #include "ppapi/c/private/ppb_flash.h"
26 #include "ppapi/c/private/ppb_udp_socket_private.h" 27 #include "ppapi/c/private/ppb_udp_socket_private.h"
27 #include "ppapi/host/ppapi_host.h" 28 #include "ppapi/host/ppapi_host.h"
28 #include "ppapi/shared_impl/ppapi_permissions.h" 29 #include "ppapi/shared_impl/ppapi_permissions.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 uint32 plugin_dispatcher_id, 154 uint32 plugin_dispatcher_id,
154 uint32* socket_id); 155 uint32* socket_id);
155 void OnUDPSetBoolSocketFeature(int32 routing_id, 156 void OnUDPSetBoolSocketFeature(int32 routing_id,
156 uint32 socket_id, 157 uint32 socket_id,
157 int32_t name, 158 int32_t name,
158 bool value); 159 bool value);
159 void OnUDPBind(int32 routing_id, 160 void OnUDPBind(int32 routing_id,
160 uint32 socket_id, 161 uint32 socket_id,
161 const PP_NetAddress_Private& addr); 162 const PP_NetAddress_Private& addr);
162 void OnUDPRecvFrom(uint32 socket_id, int32_t num_bytes); 163 void OnUDPRecvFrom(uint32 socket_id, int32_t num_bytes);
163 void OnUDPSendTo(uint32 socket_id, 164 void OnUDPSendTo(int32 routing_id,
165 uint32 socket_id,
164 const std::string& data, 166 const std::string& data,
165 const PP_NetAddress_Private& addr); 167 const PP_NetAddress_Private& addr);
166 void OnUDPClose(uint32 socket_id); 168 void OnUDPClose(uint32 socket_id);
167 169
168 void OnTCPServerListen(int32 routing_id, 170 void OnTCPServerListen(int32 routing_id,
169 uint32 plugin_dispatcher_id, 171 uint32 plugin_dispatcher_id,
170 PP_Resource socket_resource, 172 PP_Resource socket_resource,
171 const PP_NetAddress_Private& addr, 173 const PP_NetAddress_Private& addr,
172 int32_t backlog); 174 int32_t backlog);
173 void OnTCPServerAccept(int32 tcp_client_socket_routing_id, 175 void OnTCPServerAccept(int32 tcp_client_socket_routing_id,
(...skipping 22 matching lines...) Expand all
196 const std::string& host, 198 const std::string& host,
197 uint16_t port); 199 uint16_t port);
198 void DoTCPConnectWithNetAddress(bool allowed, 200 void DoTCPConnectWithNetAddress(bool allowed,
199 int32 routing_id, 201 int32 routing_id,
200 uint32 socket_id, 202 uint32 socket_id,
201 const PP_NetAddress_Private& net_addr); 203 const PP_NetAddress_Private& net_addr);
202 void DoUDPBind(bool allowed, 204 void DoUDPBind(bool allowed,
203 int32 routing_id, 205 int32 routing_id,
204 uint32 socket_id, 206 uint32 socket_id,
205 const PP_NetAddress_Private& addr); 207 const PP_NetAddress_Private& addr);
208 void DoUDPSendTo(bool allowed,
209 int32 routing_id,
210 uint32 socket_id,
211 const std::string& data,
212 const PP_NetAddress_Private& addr);
206 void DoTCPServerListen(bool allowed, 213 void DoTCPServerListen(bool allowed,
207 int32 routing_id, 214 int32 routing_id,
208 uint32 plugin_dispatcher_id, 215 uint32 plugin_dispatcher_id,
209 PP_Resource socket_resource, 216 PP_Resource socket_resource,
210 const PP_NetAddress_Private& addr, 217 const PP_NetAddress_Private& addr,
211 int32_t backlog); 218 int32_t backlog);
212 void DoHostResolverResolve(bool allowed,
213 int32 routing_id,
214 uint32 plugin_dispatcher_id,
215 uint32 host_resolver_id,
216 const ppapi::HostPortPair& host_port,
217 const PP_HostResolver_Private_Hint& hint);
218 219
219 void OnX509CertificateParseDER(const std::vector<char>& der, 220 void OnX509CertificateParseDER(const std::vector<char>& der,
220 bool* succeeded, 221 bool* succeeded,
221 ppapi::PPB_X509Certificate_Fields* result); 222 ppapi::PPB_X509Certificate_Fields* result);
222 void OnUpdateActivity(); 223 void OnUpdateActivity();
223 void OnGetDeviceID(std::string* id); 224 void OnGetDeviceID(std::string* id);
224 void OnGetLocalDataRestrictions(const GURL& document_url, 225 void OnGetLocalDataRestrictions(const GURL& document_url,
225 const GURL& plugin_url, 226 const GURL& plugin_url,
226 PP_FlashLSORestrictions* restrictions); 227 PP_FlashLSORestrictions* restrictions);
227 228
228 // Callback when the font list has been retrieved on a background thread. 229 // Callback when the font list has been retrieved on a background thread.
229 void GetFontFamiliesComplete(IPC::Message* reply_msg, 230 void GetFontFamiliesComplete(IPC::Message* reply_msg,
230 scoped_ptr<base::ListValue> result); 231 scoped_ptr<base::ListValue> result);
231 232
232 uint32 GenerateSocketID(); 233 uint32 GenerateSocketID();
233 234
234 // Return true if render with given ID can use socket APIs. 235 // Return true if render with given ID can use socket APIs.
235 bool CanUseSocketAPIs(int32 render_id); 236 bool CanUseSocketAPIs(int32 render_id,
237 const content::SocketPermissionRequest& params);
238
239 content::SocketPermissionRequest CreateSocketPermissionRequest(
240 content::SocketPermissionRequest::OperationType type,
241 const PP_NetAddress_Private& net_addr);
236 242
237 void GetAndSendNetworkList(); 243 void GetAndSendNetworkList();
238 void DoGetNetworkList(); 244 void DoGetNetworkList();
239 void SendNetworkList(scoped_ptr<net::NetworkInterfaceList> list); 245 void SendNetworkList(scoped_ptr<net::NetworkInterfaceList> list);
240 246
241 ProcessType process_type_; 247 ProcessType process_type_;
242 248
243 // Render process ID. 249 // Render process ID.
244 int process_id_; 250 int process_id_;
245 251
(...skipping 20 matching lines...) Expand all
266 272
267 FilePath browser_path_; 273 FilePath browser_path_;
268 bool incognito_; 274 bool incognito_;
269 275
270 DISALLOW_COPY_AND_ASSIGN(PepperMessageFilter); 276 DISALLOW_COPY_AND_ASSIGN(PepperMessageFilter);
271 }; 277 };
272 278
273 } // namespace content 279 } // namespace content
274 280
275 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_MESSAGE_FILTER_H_ 281 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_MESSAGE_FILTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698