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_PPAPI_PLUGIN_PROCESS_HOST_H_ | 5 #ifndef CONTENT_BROWSER_PPAPI_PLUGIN_PROCESS_HOST_H_ |
6 #define CONTENT_BROWSER_PPAPI_PLUGIN_PROCESS_HOST_H_ | 6 #define CONTENT_BROWSER_PPAPI_PLUGIN_PROCESS_HOST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <queue> | 10 #include <queue> |
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/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "content/browser/renderer_host/pepper_file_message_filter.h" | 16 #include "content/browser/renderer_host/pepper_file_message_filter.h" |
17 #include "content/browser/renderer_host/pepper_message_filter.h" | 17 #include "content/browser/renderer_host/pepper_message_filter.h" |
18 #include "content/public/browser/browser_child_process_host_delegate.h" | 18 #include "content/public/browser/browser_child_process_host_delegate.h" |
19 #include "content/public/browser/browser_child_process_host_iterator.h" | 19 #include "content/public/browser/browser_child_process_host_iterator.h" |
20 #include "ipc/ipc_message.h" | 20 #include "ipc/ipc_sender.h" |
21 | 21 |
22 class BrowserChildProcessHostImpl; | 22 class BrowserChildProcessHostImpl; |
23 | 23 |
24 namespace content { | 24 namespace content { |
25 struct PepperPluginInfo; | 25 struct PepperPluginInfo; |
26 class ResourceContext; | 26 class ResourceContext; |
27 } | 27 } |
28 | 28 |
29 namespace net { | 29 namespace net { |
30 class HostResolver; | 30 class HostResolver; |
31 } | 31 } |
32 | 32 |
33 // Process host for PPAPI plugin and broker processes. | 33 // Process host for PPAPI plugin and broker processes. |
34 // When used for the broker, interpret all references to "plugin" with "broker". | 34 // When used for the broker, interpret all references to "plugin" with "broker". |
35 class PpapiPluginProcessHost : public content::BrowserChildProcessHostDelegate, | 35 class PpapiPluginProcessHost : public content::BrowserChildProcessHostDelegate, |
36 public IPC::Message::Sender { | 36 public IPC::Sender { |
37 public: | 37 public: |
38 class Client { | 38 class Client { |
39 public: | 39 public: |
40 // Gets the information about the renderer that's requesting the channel. | 40 // Gets the information about the renderer that's requesting the channel. |
41 virtual void GetPpapiChannelInfo(base::ProcessHandle* renderer_handle, | 41 virtual void GetPpapiChannelInfo(base::ProcessHandle* renderer_handle, |
42 int* renderer_id) = 0; | 42 int* renderer_id) = 0; |
43 | 43 |
44 // Called when the channel is asynchronously opened to the plugin or on | 44 // Called when the channel is asynchronously opened to the plugin or on |
45 // error. On error, the parameters should be: | 45 // error. On error, the parameters should be: |
46 // base::kNullProcessHandle | 46 // base::kNullProcessHandle |
(...skipping 18 matching lines...) Expand all Loading... |
65 | 65 |
66 virtual ~PpapiPluginProcessHost(); | 66 virtual ~PpapiPluginProcessHost(); |
67 | 67 |
68 static PpapiPluginProcessHost* CreatePluginHost( | 68 static PpapiPluginProcessHost* CreatePluginHost( |
69 const content::PepperPluginInfo& info, | 69 const content::PepperPluginInfo& info, |
70 const FilePath& profile_data_directory, | 70 const FilePath& profile_data_directory, |
71 net::HostResolver* host_resolver); | 71 net::HostResolver* host_resolver); |
72 static PpapiPluginProcessHost* CreateBrokerHost( | 72 static PpapiPluginProcessHost* CreateBrokerHost( |
73 const content::PepperPluginInfo& info); | 73 const content::PepperPluginInfo& info); |
74 | 74 |
75 // IPC::Message::Sender implementation: | 75 // IPC::Sender implementation: |
76 virtual bool Send(IPC::Message* message) OVERRIDE; | 76 virtual bool Send(IPC::Message* message) OVERRIDE; |
77 | 77 |
78 // Opens a new channel to the plugin. The client will be notified when the | 78 // Opens a new channel to the plugin. The client will be notified when the |
79 // channel is ready or if there's an error. | 79 // channel is ready or if there's an error. |
80 void OpenChannelToPlugin(Client* client); | 80 void OpenChannelToPlugin(Client* client); |
81 | 81 |
82 const FilePath& plugin_path() const { return plugin_path_; } | 82 const FilePath& plugin_path() const { return plugin_path_; } |
83 const FilePath& profile_data_directory() const { | 83 const FilePath& profile_data_directory() const { |
84 return profile_data_directory_; | 84 return profile_data_directory_; |
85 } | 85 } |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 : public content::BrowserChildProcessHostTypeIterator< | 156 : public content::BrowserChildProcessHostTypeIterator< |
157 PpapiPluginProcessHost> { | 157 PpapiPluginProcessHost> { |
158 public: | 158 public: |
159 PpapiBrokerProcessHostIterator() | 159 PpapiBrokerProcessHostIterator() |
160 : content::BrowserChildProcessHostTypeIterator< | 160 : content::BrowserChildProcessHostTypeIterator< |
161 PpapiPluginProcessHost>(content::PROCESS_TYPE_PPAPI_BROKER) {} | 161 PpapiPluginProcessHost>(content::PROCESS_TYPE_PPAPI_BROKER) {} |
162 }; | 162 }; |
163 | 163 |
164 #endif // CONTENT_BROWSER_PPAPI_PLUGIN_PROCESS_HOST_H_ | 164 #endif // CONTENT_BROWSER_PPAPI_PLUGIN_PROCESS_HOST_H_ |
165 | 165 |
OLD | NEW |