| OLD | NEW |
| 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 uint32 plugin_dispatcher_id, | 155 uint32 plugin_dispatcher_id, |
| 155 uint32* socket_id); | 156 uint32* socket_id); |
| 156 void OnUDPSetBoolSocketFeature(int32 routing_id, | 157 void OnUDPSetBoolSocketFeature(int32 routing_id, |
| 157 uint32 socket_id, | 158 uint32 socket_id, |
| 158 int32_t name, | 159 int32_t name, |
| 159 bool value); | 160 bool value); |
| 160 void OnUDPBind(int32 routing_id, | 161 void OnUDPBind(int32 routing_id, |
| 161 uint32 socket_id, | 162 uint32 socket_id, |
| 162 const PP_NetAddress_Private& addr); | 163 const PP_NetAddress_Private& addr); |
| 163 void OnUDPRecvFrom(uint32 socket_id, int32_t num_bytes); | 164 void OnUDPRecvFrom(uint32 socket_id, int32_t num_bytes); |
| 164 void OnUDPSendTo(uint32 socket_id, | 165 void OnUDPSendTo(int32 routing_id, |
| 166 uint32 socket_id, |
| 165 const std::string& data, | 167 const std::string& data, |
| 166 const PP_NetAddress_Private& addr); | 168 const PP_NetAddress_Private& addr); |
| 167 void OnUDPClose(uint32 socket_id); | 169 void OnUDPClose(uint32 socket_id); |
| 168 | 170 |
| 169 void OnTCPServerListen(int32 routing_id, | 171 void OnTCPServerListen(int32 routing_id, |
| 170 uint32 plugin_dispatcher_id, | 172 uint32 plugin_dispatcher_id, |
| 171 PP_Resource socket_resource, | 173 PP_Resource socket_resource, |
| 172 const PP_NetAddress_Private& addr, | 174 const PP_NetAddress_Private& addr, |
| 173 int32_t backlog); | 175 int32_t backlog); |
| 174 void OnTCPServerAccept(int32 tcp_client_socket_routing_id, | 176 void OnTCPServerAccept(int32 tcp_client_socket_routing_id, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 197 const std::string& host, | 199 const std::string& host, |
| 198 uint16_t port); | 200 uint16_t port); |
| 199 void DoTCPConnectWithNetAddress(bool allowed, | 201 void DoTCPConnectWithNetAddress(bool allowed, |
| 200 int32 routing_id, | 202 int32 routing_id, |
| 201 uint32 socket_id, | 203 uint32 socket_id, |
| 202 const PP_NetAddress_Private& net_addr); | 204 const PP_NetAddress_Private& net_addr); |
| 203 void DoUDPBind(bool allowed, | 205 void DoUDPBind(bool allowed, |
| 204 int32 routing_id, | 206 int32 routing_id, |
| 205 uint32 socket_id, | 207 uint32 socket_id, |
| 206 const PP_NetAddress_Private& addr); | 208 const PP_NetAddress_Private& addr); |
| 209 void DoUDPSendTo(bool allowed, |
| 210 int32 routing_id, |
| 211 uint32 socket_id, |
| 212 const std::string& data, |
| 213 const PP_NetAddress_Private& addr); |
| 207 void DoTCPServerListen(bool allowed, | 214 void DoTCPServerListen(bool allowed, |
| 208 int32 routing_id, | 215 int32 routing_id, |
| 209 uint32 plugin_dispatcher_id, | 216 uint32 plugin_dispatcher_id, |
| 210 PP_Resource socket_resource, | 217 PP_Resource socket_resource, |
| 211 const PP_NetAddress_Private& addr, | 218 const PP_NetAddress_Private& addr, |
| 212 int32_t backlog); | 219 int32_t backlog); |
| 213 void DoHostResolverResolve(bool allowed, | |
| 214 int32 routing_id, | |
| 215 uint32 plugin_dispatcher_id, | |
| 216 uint32 host_resolver_id, | |
| 217 const ppapi::HostPortPair& host_port, | |
| 218 const PP_HostResolver_Private_Hint& hint); | |
| 219 | 220 |
| 220 void OnX509CertificateParseDER(const std::vector<char>& der, | 221 void OnX509CertificateParseDER(const std::vector<char>& der, |
| 221 bool* succeeded, | 222 bool* succeeded, |
| 222 ppapi::PPB_X509Certificate_Fields* result); | 223 ppapi::PPB_X509Certificate_Fields* result); |
| 223 void OnUpdateActivity(); | 224 void OnUpdateActivity(); |
| 224 void OnGetDeviceID(std::string* id); | 225 void OnGetDeviceID(std::string* id); |
| 225 void OnGetLocalDataRestrictions(const GURL& document_url, | 226 void OnGetLocalDataRestrictions(const GURL& document_url, |
| 226 const GURL& plugin_url, | 227 const GURL& plugin_url, |
| 227 PP_FlashLSORestrictions* restrictions); | 228 PP_FlashLSORestrictions* restrictions); |
| 228 | 229 |
| 229 // Callback when the font list has been retrieved on a background thread. | 230 // Callback when the font list has been retrieved on a background thread. |
| 230 void GetFontFamiliesComplete(IPC::Message* reply_msg, | 231 void GetFontFamiliesComplete(IPC::Message* reply_msg, |
| 231 scoped_ptr<base::ListValue> result); | 232 scoped_ptr<base::ListValue> result); |
| 232 | 233 |
| 233 uint32 GenerateSocketID(); | 234 uint32 GenerateSocketID(); |
| 234 | 235 |
| 235 // Return true if render with given ID can use socket APIs. | 236 // Return true if render with given ID can use socket APIs. |
| 236 bool CanUseSocketAPIs(int32 render_id); | 237 bool CanUseSocketAPIs(int32 render_id, |
| 238 const content::ContentBrowserClient::SocketPermissionParam& params); |
| 239 |
| 240 content::ContentBrowserClient::SocketPermissionParam |
| 241 CreateSocketPermissionParam( |
| 242 content::ContentBrowserClient::SocketPermissionParam::OperationType type, |
| 243 const PP_NetAddress_Private& net_addr); |
| 237 | 244 |
| 238 void GetAndSendNetworkList(); | 245 void GetAndSendNetworkList(); |
| 239 void DoGetNetworkList(); | 246 void DoGetNetworkList(); |
| 240 void SendNetworkList(scoped_ptr<net::NetworkInterfaceList> list); | 247 void SendNetworkList(scoped_ptr<net::NetworkInterfaceList> list); |
| 241 | 248 |
| 242 ProcessType process_type_; | 249 ProcessType process_type_; |
| 243 | 250 |
| 244 // Render process ID. | 251 // Render process ID. |
| 245 int process_id_; | 252 int process_id_; |
| 246 | 253 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 265 | 272 |
| 266 NetworkMonitorIdSet network_monitor_ids_; | 273 NetworkMonitorIdSet network_monitor_ids_; |
| 267 | 274 |
| 268 FilePath browser_path_; | 275 FilePath browser_path_; |
| 269 bool incognito_; | 276 bool incognito_; |
| 270 | 277 |
| 271 DISALLOW_COPY_AND_ASSIGN(PepperMessageFilter); | 278 DISALLOW_COPY_AND_ASSIGN(PepperMessageFilter); |
| 272 }; | 279 }; |
| 273 | 280 |
| 274 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_MESSAGE_FILTER_H_ | 281 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_PEPPER_MESSAGE_FILTER_H_ |
| OLD | NEW |