OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <queue> | 9 #include <queue> |
10 | 10 |
(...skipping 24 matching lines...) Expand all Loading... |
35 public: | 35 public: |
36 class Client { | 36 class Client { |
37 public: | 37 public: |
38 // Gets the information about the renderer that's requesting the channel. | 38 // Gets the information about the renderer that's requesting the channel. |
39 virtual void GetChannelInfo(base::ProcessHandle* renderer_handle, | 39 virtual void GetChannelInfo(base::ProcessHandle* renderer_handle, |
40 int* renderer_id) = 0; | 40 int* renderer_id) = 0; |
41 | 41 |
42 // Called when the channel is asynchronously opened to the plugin or on | 42 // Called when the channel is asynchronously opened to the plugin or on |
43 // error. On error, the parameters should be: | 43 // error. On error, the parameters should be: |
44 // base::kNullProcessHandle | 44 // base::kNullProcessHandle |
45 // IPC::ChannelHandle() | 45 // IPC::ChannelHandle(), |
| 46 // 0 |
46 virtual void OnChannelOpened(base::ProcessHandle plugin_process_handle, | 47 virtual void OnChannelOpened(base::ProcessHandle plugin_process_handle, |
47 const IPC::ChannelHandle& channel_handle) = 0; | 48 const IPC::ChannelHandle& channel_handle, |
| 49 int plugin_child_id) = 0; |
48 }; | 50 }; |
49 | 51 |
50 class PluginClient : public Client { | 52 class PluginClient : public Client { |
51 public: | 53 public: |
52 // Returns the resource context for the renderer requesting the channel. | 54 // Returns the resource context for the renderer requesting the channel. |
53 virtual content::ResourceContext* GetResourceContext() = 0; | 55 virtual content::ResourceContext* GetResourceContext() = 0; |
54 }; | 56 }; |
55 | 57 |
56 class BrokerClient : public Client { | 58 class BrokerClient : public Client { |
57 }; | 59 }; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 114 |
113 // Channel requests that we have already sent to the plugin process, but | 115 // Channel requests that we have already sent to the plugin process, but |
114 // haven't heard back about yet. | 116 // haven't heard back about yet. |
115 std::queue<Client*> sent_requests_; | 117 std::queue<Client*> sent_requests_; |
116 | 118 |
117 // Path to the plugin library. | 119 // Path to the plugin library. |
118 FilePath plugin_path_; | 120 FilePath plugin_path_; |
119 | 121 |
120 const bool is_broker_; | 122 const bool is_broker_; |
121 | 123 |
122 // The unique id created for the process. | |
123 int process_id_; | |
124 | |
125 scoped_ptr<BrowserChildProcessHostImpl> process_; | 124 scoped_ptr<BrowserChildProcessHostImpl> process_; |
126 | 125 |
127 DISALLOW_COPY_AND_ASSIGN(PpapiPluginProcessHost); | 126 DISALLOW_COPY_AND_ASSIGN(PpapiPluginProcessHost); |
128 }; | 127 }; |
129 | 128 |
130 class PpapiPluginProcessHostIterator | 129 class PpapiPluginProcessHostIterator |
131 : public content::BrowserChildProcessHostTypeIterator< | 130 : public content::BrowserChildProcessHostTypeIterator< |
132 PpapiPluginProcessHost> { | 131 PpapiPluginProcessHost> { |
133 public: | 132 public: |
134 PpapiPluginProcessHostIterator() | 133 PpapiPluginProcessHostIterator() |
135 : content::BrowserChildProcessHostTypeIterator< | 134 : content::BrowserChildProcessHostTypeIterator< |
136 PpapiPluginProcessHost>(content::PROCESS_TYPE_PPAPI_PLUGIN) {} | 135 PpapiPluginProcessHost>(content::PROCESS_TYPE_PPAPI_PLUGIN) {} |
137 }; | 136 }; |
138 | 137 |
139 class PpapiBrokerProcessHostIterator | 138 class PpapiBrokerProcessHostIterator |
140 : public content::BrowserChildProcessHostTypeIterator< | 139 : public content::BrowserChildProcessHostTypeIterator< |
141 PpapiPluginProcessHost> { | 140 PpapiPluginProcessHost> { |
142 public: | 141 public: |
143 PpapiBrokerProcessHostIterator() | 142 PpapiBrokerProcessHostIterator() |
144 : content::BrowserChildProcessHostTypeIterator< | 143 : content::BrowserChildProcessHostTypeIterator< |
145 PpapiPluginProcessHost>(content::PROCESS_TYPE_PPAPI_BROKER) {} | 144 PpapiPluginProcessHost>(content::PROCESS_TYPE_PPAPI_BROKER) {} |
146 }; | 145 }; |
147 | 146 |
148 #endif // CONTENT_BROWSER_PPAPI_PLUGIN_PROCESS_HOST_H_ | 147 #endif // CONTENT_BROWSER_PPAPI_PLUGIN_PROCESS_HOST_H_ |
149 | 148 |
OLD | NEW |