| 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_MESSAGE_FILTER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_PEPPER_MESSAGE_FILTER_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_PEPPER_MESSAGE_FILTER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_PEPPER_MESSAGE_FILTER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/file_path.h" |
| 14 #include "base/memory/linked_ptr.h" | 15 #include "base/memory/linked_ptr.h" |
| 15 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/process.h" | 17 #include "base/process.h" |
| 17 #include "base/time.h" | 18 #include "base/time.h" |
| 18 #include "content/public/browser/browser_message_filter.h" | 19 #include "content/public/browser/browser_message_filter.h" |
| 19 #include "net/base/network_change_notifier.h" | 20 #include "net/base/network_change_notifier.h" |
| 20 #include "net/base/net_util.h" | 21 #include "net/base/net_util.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 | 26 |
| 26 class PepperTCPServerSocket; | 27 class PepperTCPServerSocket; |
| 27 class PepperTCPSocket; | 28 class PepperTCPSocket; |
| 28 class PepperUDPSocket; | 29 class PepperUDPSocket; |
| 29 struct PP_HostResolver_Private_Hint; | 30 struct PP_HostResolver_Private_Hint; |
| 30 struct PP_NetAddress_Private; | 31 struct PP_NetAddress_Private; |
| 31 | 32 |
| 32 namespace base { | 33 namespace base { |
| 33 class ListValue; | 34 class ListValue; |
| 34 } | 35 } |
| 35 | 36 |
| 36 namespace content { | 37 namespace content { |
| 38 class BrowserContext; |
| 37 class ResourceContext; | 39 class ResourceContext; |
| 38 } | 40 } |
| 39 | 41 |
| 40 namespace net { | 42 namespace net { |
| 41 class AddressList; | 43 class AddressList; |
| 42 class CertVerifier; | 44 class CertVerifier; |
| 43 class HostResolver; | 45 class HostResolver; |
| 44 } | 46 } |
| 45 | 47 |
| 46 namespace ppapi { | 48 namespace ppapi { |
| 47 struct HostPortPair; | 49 struct HostPortPair; |
| 48 class PPB_X509Certificate_Fields; | 50 class PPB_X509Certificate_Fields; |
| 49 } | 51 } |
| 50 | 52 |
| 51 // This class is used in two contexts, both supporting PPAPI plugins. The first | 53 // This class is used in two contexts, both supporting PPAPI plugins. The first |
| 52 // is on the renderer->browser channel, to handle requests from in-process | 54 // is on the renderer->browser channel, to handle requests from in-process |
| 53 // PPAPI plugins and any requests that the PPAPI implementation code in the | 55 // PPAPI plugins and any requests that the PPAPI implementation code in the |
| 54 // renderer needs to make. The second is on the plugin->browser channel to | 56 // renderer needs to make. The second is on the plugin->browser channel to |
| 55 // handle requests that out-of-process plugins send directly to the browser. | 57 // handle requests that out-of-process plugins send directly to the browser. |
| 56 class PepperMessageFilter | 58 class PepperMessageFilter |
| 57 : public content::BrowserMessageFilter, | 59 : public content::BrowserMessageFilter, |
| 58 public net::NetworkChangeNotifier::IPAddressObserver { | 60 public net::NetworkChangeNotifier::IPAddressObserver { |
| 59 public: | 61 public: |
| 60 enum ProcessType { PLUGIN, RENDERER }; | 62 enum ProcessType { PLUGIN, RENDERER }; |
| 61 | 63 |
| 62 // Constructor when used in the context of a render process (the argument is | 64 // Constructor when used in the context of a render process (the argument is |
| 63 // provided for sanity checking). | 65 // provided for sanity checking). |
| 64 PepperMessageFilter(ProcessType type, | 66 PepperMessageFilter(ProcessType type, |
| 65 int process_id, | 67 int process_id, |
| 66 content::ResourceContext* resource_context); | 68 content::BrowserContext* browser_context); |
| 67 | 69 |
| 68 // Constructor when used in the context of a PPAPI process (the argument is | 70 // Constructor when used in the context of a PPAPI process (the argument is |
| 69 // provided for sanity checking). | 71 // provided for sanity checking). |
| 70 PepperMessageFilter(ProcessType type, net::HostResolver* host_resolver); | 72 PepperMessageFilter(ProcessType type, net::HostResolver* host_resolver); |
| 71 | 73 |
| 72 // content::BrowserMessageFilter methods. | 74 // content::BrowserMessageFilter methods. |
| 73 virtual void OverrideThreadForMessage( | 75 virtual void OverrideThreadForMessage( |
| 74 const IPC::Message& message, | 76 const IPC::Message& message, |
| 75 content::BrowserThread::ID* thread) OVERRIDE; | 77 content::BrowserThread::ID* thread) OVERRIDE; |
| 76 virtual bool OnMessageReceived(const IPC::Message& message, | 78 virtual bool OnMessageReceived(const IPC::Message& message, |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 scoped_ptr<net::CertVerifier> cert_verifier_; | 247 scoped_ptr<net::CertVerifier> cert_verifier_; |
| 246 | 248 |
| 247 uint32 next_socket_id_; | 249 uint32 next_socket_id_; |
| 248 | 250 |
| 249 TCPSocketMap tcp_sockets_; | 251 TCPSocketMap tcp_sockets_; |
| 250 UDPSocketMap udp_sockets_; | 252 UDPSocketMap udp_sockets_; |
| 251 TCPServerSocketMap tcp_server_sockets_; | 253 TCPServerSocketMap tcp_server_sockets_; |
| 252 | 254 |
| 253 NetworkMonitorIdSet network_monitor_ids_; | 255 NetworkMonitorIdSet network_monitor_ids_; |
| 254 | 256 |
| 257 FilePath browser_path_; |
| 258 |
| 255 DISALLOW_COPY_AND_ASSIGN(PepperMessageFilter); | 259 DISALLOW_COPY_AND_ASSIGN(PepperMessageFilter); |
| 256 }; | 260 }; |
| 257 | 261 |
| 258 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_MESSAGE_FILTER_H_ | 262 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_MESSAGE_FILTER_H_ |
| OLD | NEW |