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_PLUGIN_PROCESS_HOST_H_ | 5 #ifndef CONTENT_BROWSER_PLUGIN_PROCESS_HOST_H_ |
6 #define CONTENT_BROWSER_PLUGIN_PROCESS_HOST_H_ | 6 #define CONTENT_BROWSER_PLUGIN_PROCESS_HOST_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #include <list> | 10 #include <list> |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 void OnAppActivation(); | 113 void OnAppActivation(); |
114 #endif | 114 #endif |
115 | 115 |
116 const WebPluginInfo& info() const { return info_; } | 116 const WebPluginInfo& info() const { return info_; } |
117 | 117 |
118 #if defined(OS_WIN) | 118 #if defined(OS_WIN) |
119 // Tracks plugin parent windows created on the browser UI thread. | 119 // Tracks plugin parent windows created on the browser UI thread. |
120 void AddWindow(HWND window); | 120 void AddWindow(HWND window); |
121 #endif | 121 #endif |
122 | 122 |
| 123 // Given a pid of a plugin process, returns the plugin information in |info| |
| 124 // if we know about that process. Otherwise returns false. |
| 125 // This method can be called on any thread. |
| 126 static bool GetWebPluginInfoFromPluginPid(int pid, WebPluginInfo* info); |
| 127 |
123 private: | 128 private: |
124 // Sends a message to the plugin process to request creation of a new channel | 129 // Sends a message to the plugin process to request creation of a new channel |
125 // for the given mime type. | 130 // for the given mime type. |
126 void RequestPluginChannel(Client* client); | 131 void RequestPluginChannel(Client* client); |
127 | 132 |
128 // Message handlers. | 133 // Message handlers. |
129 void OnChannelCreated(const IPC::ChannelHandle& channel_handle); | 134 void OnChannelCreated(const IPC::ChannelHandle& channel_handle); |
130 void OnChannelDestroyed(int renderer_id); | 135 void OnChannelDestroyed(int renderer_id); |
131 | 136 |
132 #if defined(OS_WIN) | 137 #if defined(OS_WIN) |
(...skipping 21 matching lines...) Expand all Loading... |
154 // plugin process once the channel is opened. | 159 // plugin process once the channel is opened. |
155 std::vector<Client*> pending_requests_; | 160 std::vector<Client*> pending_requests_; |
156 | 161 |
157 // These are the channel requests that we have already sent to | 162 // These are the channel requests that we have already sent to |
158 // the plugin process, but haven't heard back about yet. | 163 // the plugin process, but haven't heard back about yet. |
159 std::list<Client*> sent_requests_; | 164 std::list<Client*> sent_requests_; |
160 | 165 |
161 // Information about the plugin. | 166 // Information about the plugin. |
162 WebPluginInfo info_; | 167 WebPluginInfo info_; |
163 | 168 |
| 169 // The pid of the plugin process. |
| 170 int pid_; |
| 171 |
164 #if defined(OS_WIN) | 172 #if defined(OS_WIN) |
165 // Tracks plugin parent windows created on the UI thread. | 173 // Tracks plugin parent windows created on the UI thread. |
166 std::set<HWND> plugin_parent_windows_set_; | 174 std::set<HWND> plugin_parent_windows_set_; |
167 #endif | 175 #endif |
168 #if defined(OS_MACOSX) | 176 #if defined(OS_MACOSX) |
169 // Tracks plugin windows currently visible. | 177 // Tracks plugin windows currently visible. |
170 std::set<uint32> plugin_visible_windows_set_; | 178 std::set<uint32> plugin_visible_windows_set_; |
171 // Tracks full screen windows currently visible. | 179 // Tracks full screen windows currently visible. |
172 std::set<uint32> plugin_fullscreen_windows_set_; | 180 std::set<uint32> plugin_fullscreen_windows_set_; |
173 // Tracks modal windows currently visible. | 181 // Tracks modal windows currently visible. |
(...skipping 22 matching lines...) Expand all Loading... |
196 : public BrowserChildProcessHostTypeIterator<PluginProcessHost> { | 204 : public BrowserChildProcessHostTypeIterator<PluginProcessHost> { |
197 public: | 205 public: |
198 PluginProcessHostIterator() | 206 PluginProcessHostIterator() |
199 : BrowserChildProcessHostTypeIterator<PluginProcessHost>( | 207 : BrowserChildProcessHostTypeIterator<PluginProcessHost>( |
200 PROCESS_TYPE_PLUGIN) {} | 208 PROCESS_TYPE_PLUGIN) {} |
201 }; | 209 }; |
202 | 210 |
203 } // namespace content | 211 } // namespace content |
204 | 212 |
205 #endif // CONTENT_BROWSER_PLUGIN_PROCESS_HOST_H_ | 213 #endif // CONTENT_BROWSER_PLUGIN_PROCESS_HOST_H_ |
OLD | NEW |