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

Unified Diff: content/browser/plugin_process_host.cc

Issue 8774040: Don't make classes derive from ChildProcessHost, and instead have them use it through composition... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix linker errors on posix Created 9 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/plugin_process_host.h ('k') | content/browser/ppapi_plugin_process_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/plugin_process_host.cc
===================================================================
--- content/browser/plugin_process_host.cc (revision 112722)
+++ content/browser/plugin_process_host.cc (working copy)
@@ -22,6 +22,7 @@
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "content/browser/plugin_service.h"
+#include "content/common/child_process_host.h"
#include "content/common/plugin_messages.h"
#include "content/common/resource_messages.h"
#include "content/public/browser/browser_thread.h"
@@ -167,7 +168,7 @@
info_ = info;
set_name(info_.name);
- if (!CreateChannel())
+ if (!child_process_host()->CreateChannel())
return false;
// Build command line for plugin. When we have a plugin launcher, we can't
@@ -180,14 +181,15 @@
// Run the plug-in process in a mode tolerant of heap execution without
// explicit mprotect calls. Some plug-ins still rely on this quaint and
// archaic "feature." See http://crbug.com/93551.
- int flags = CHILD_ALLOW_HEAP_EXECUTION;
+ int flags = ChildProcessHost::CHILD_ALLOW_HEAP_EXECUTION;
#elif defined(OS_LINUX)
- int flags = plugin_launcher.empty() ? CHILD_ALLOW_SELF : CHILD_NORMAL;
+ int flags = plugin_launcher.empty() ? ChildProcessHost::CHILD_ALLOW_SELF :
+ ChildProcessHost::CHILD_NORMAL;
#else
- int flags = CHILD_NORMAL;
+ int flags = ChildProcessHost::CHILD_NORMAL;
#endif
- FilePath exe_path = GetChildPath(flags);
+ FilePath exe_path = ChildProcessHost::GetChildPath(flags);
if (exe_path.empty())
return false;
@@ -233,7 +235,8 @@
cmd_line->AppendSwitchASCII(switches::kLang, locale);
}
- cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id());
+ cmd_line->AppendSwitchASCII(switches::kProcessChannelID,
+ child_process_host()->channel_id());
#if defined(OS_POSIX)
base::environment_vector env;
@@ -279,6 +282,10 @@
BrowserChildProcessHost::ForceShutdown();
}
+void PluginProcessHost::AddFilter(IPC::ChannelProxy::MessageFilter* filter) {
+ child_process_host()->AddFilter(filter);
+}
+
bool PluginProcessHost::OnMessageReceived(const IPC::Message& msg) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(PluginProcessHost, msg)
@@ -359,7 +366,7 @@
void PluginProcessHost::OpenChannelToPlugin(Client* client) {
Notify(content::NOTIFICATION_CHILD_INSTANCE_CREATED);
client->SetPluginInfo(info_);
- if (opening_channel()) {
+ if (child_process_host()->opening_channel()) {
// The channel is already in the process of being opened. Put
// this "open channel" request into a queue of requests that will
// be run once the channel is open.
« no previous file with comments | « content/browser/plugin_process_host.h ('k') | content/browser/ppapi_plugin_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698