Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: chrome/browser/plugin_process_host.h

Issue 24017: More refactoring of PluginProcessHost (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/memory_details.cc ('k') | chrome/browser/plugin_process_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 CHROME_BROWSER_PLUGIN_PROCESS_HOST_H_ 5 #ifndef CHROME_BROWSER_PLUGIN_PROCESS_HOST_H_
6 #define CHROME_BROWSER_PLUGIN_PROCESS_HOST_H_ 6 #define CHROME_BROWSER_PLUGIN_PROCESS_HOST_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/id_map.h"
12 #include "base/object_watcher.h" 11 #include "base/object_watcher.h"
13 #include "base/scoped_ptr.h" 12 #include "base/scoped_ptr.h"
14 #include "base/task.h" 13 #include "base/task.h"
15 #include "chrome/browser/net/resolve_proxy_msg_helper.h" 14 #include "chrome/browser/net/resolve_proxy_msg_helper.h"
16 #include "chrome/browser/renderer_host/resource_message_filter.h" 15 #include "chrome/browser/renderer_host/resource_message_filter.h"
17 #include "chrome/common/child_process_info.h" 16 #include "chrome/common/child_process_info.h"
18 #include "chrome/common/ipc_channel_proxy.h" 17 #include "chrome/common/ipc_channel.h"
19 #include "webkit/glue/webplugin.h" 18 #include "webkit/glue/webplugin.h"
20 19
21 class PluginService;
22 class PluginProcessHost;
23 class ResourceDispatcherHost; 20 class ResourceDispatcherHost;
24 class URLRequestContext; 21 class URLRequestContext;
25 struct ViewHostMsg_Resource_Request; 22 struct ViewHostMsg_Resource_Request;
26 class GURL; 23 class GURL;
27 24
28 // Represents the browser side of the browser <--> plugin communication 25 // Represents the browser side of the browser <--> plugin communication
29 // channel. Different plugins run in their own process, but multiple instances 26 // channel. Different plugins run in their own process, but multiple instances
30 // of the same plugin run in the same process. There will be one 27 // of the same plugin run in the same process. There will be one
31 // PluginProcessHost per plugin process, matched with a corresponding 28 // PluginProcessHost per plugin process, matched with a corresponding
32 // PluginProcess running in the plugin process. The browser is responsible for 29 // PluginProcess running in the plugin process. The browser is responsible for
33 // starting the plugin process when a plugin is created that doesn't already 30 // starting the plugin process when a plugin is created that doesn't already
34 // have a process. After that, most of the communication is directly between 31 // have a process. After that, most of the communication is directly between
35 // the renderer and plugin processes. 32 // the renderer and plugin processes.
36 class PluginProcessHost : public ChildProcessInfo, 33 class PluginProcessHost : public ChildProcessInfo,
37 public IPC::Channel::Listener, 34 public IPC::Channel::Listener,
38 public IPC::Message::Sender, 35 public IPC::Message::Sender,
39 public base::ObjectWatcher::Delegate, 36 public base::ObjectWatcher::Delegate,
40 public ResolveProxyMsgHelper::Delegate { 37 public ResolveProxyMsgHelper::Delegate {
41 public: 38 public:
42 PluginProcessHost(PluginService* plugin_service); 39 PluginProcessHost();
43 ~PluginProcessHost(); 40 ~PluginProcessHost();
44 41
45 // Initialize the new plugin process, returning true on success. This must 42 // Initialize the new plugin process, returning true on success. This must
46 // be called before the object can be used. If plugin_path is the 43 // be called before the object can be used. If plugin_path is the
47 // ActiveX-shim, then activex_clsid is the class id of ActiveX control, 44 // ActiveX-shim, then activex_clsid is the class id of ActiveX control,
48 // otherwise activex_clsid is ignored. 45 // otherwise activex_clsid is ignored.
49 bool Init(const WebPluginInfo& info, 46 bool Init(const WebPluginInfo& info,
50 const std::string& activex_clsid, 47 const std::string& activex_clsid,
51 const std::wstring& locale); 48 const std::wstring& locale);
52 49
(...skipping 29 matching lines...) Expand all
82 79
83 // This function is called on the IO thread once we receive a reply from the 80 // This function is called on the IO thread once we receive a reply from the
84 // modal HTML dialog (in the form of a JSON string). This function forwards 81 // modal HTML dialog (in the form of a JSON string). This function forwards
85 // that reply back to the plugin that requested the dialog. 82 // that reply back to the plugin that requested the dialog.
86 void OnModalDialogResponse(const std::string& json_retval, 83 void OnModalDialogResponse(const std::string& json_retval,
87 IPC::Message* sync_result); 84 IPC::Message* sync_result);
88 85
89 // Shuts down the current plugin process instance. 86 // Shuts down the current plugin process instance.
90 void Shutdown(); 87 void Shutdown();
91 88
89 const WebPluginInfo& info() const { return info_; }
90
92 private: 91 private:
93 friend class PluginResolveProxyHelper; 92 friend class PluginResolveProxyHelper;
94 93
95 // Sends a message to the plugin process to request creation of a new channel 94 // Sends a message to the plugin process to request creation of a new channel
96 // for the given mime type. 95 // for the given mime type.
97 void RequestPluginChannel(ResourceMessageFilter* renderer_message_filter, 96 void RequestPluginChannel(ResourceMessageFilter* renderer_message_filter,
98 const std::string& mime_type, 97 const std::string& mime_type,
99 IPC::Message* reply_msg); 98 IPC::Message* reply_msg);
100 // Message handlers. 99 // Message handlers.
101 void OnChannelCreated(int process_id, const std::wstring& channel_name); 100 void OnChannelCreated(int process_id, const std::wstring& channel_name);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 145
147 // The IPC::Channel. 146 // The IPC::Channel.
148 scoped_ptr<IPC::Channel> channel_; 147 scoped_ptr<IPC::Channel> channel_;
149 148
150 // IPC Channel's id. 149 // IPC Channel's id.
151 std::wstring channel_id_; 150 std::wstring channel_id_;
152 151
153 // Information about the plugin. 152 // Information about the plugin.
154 WebPluginInfo info_; 153 WebPluginInfo info_;
155 154
156 PluginService* plugin_service_;
157
158 ResourceDispatcherHost* resource_dispatcher_host_;
159
160 // Helper class for handling PluginProcessHost_ResolveProxy messages (manages 155 // Helper class for handling PluginProcessHost_ResolveProxy messages (manages
161 // the requests to the proxy service). 156 // the requests to the proxy service).
162 ResolveProxyMsgHelper resolve_proxy_msg_helper_; 157 ResolveProxyMsgHelper resolve_proxy_msg_helper_;
163 158
164 DISALLOW_EVIL_CONSTRUCTORS(PluginProcessHost); 159 DISALLOW_EVIL_CONSTRUCTORS(PluginProcessHost);
165 }; 160 };
166 161
167 #endif // CHROME_BROWSER_PLUGIN_PROCESS_HOST_H_ 162 #endif // CHROME_BROWSER_PLUGIN_PROCESS_HOST_H_
168 163
OLDNEW
« no previous file with comments | « chrome/browser/memory_details.cc ('k') | chrome/browser/plugin_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698