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

Side by Side Diff: content/browser/ppapi_broker_process_host.cc

Issue 7714018: Give plug-in processes an executable heap and disable PIE/ASLR for Native (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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
OLDNEW
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 #include "content/browser/ppapi_broker_process_host.h" 5 #include "content/browser/ppapi_broker_process_host.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/process_util.h" 9 #include "base/process_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 18 matching lines...) Expand all
29 set_version(UTF8ToUTF16(info.version)); 29 set_version(UTF8ToUTF16(info.version));
30 30
31 if (!CreateChannel()) 31 if (!CreateChannel())
32 return false; 32 return false;
33 33
34 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); 34 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess();
35 // Use the same launcher mechanism as ppapi plugins. 35 // Use the same launcher mechanism as ppapi plugins.
36 CommandLine::StringType plugin_launcher = 36 CommandLine::StringType plugin_launcher =
37 browser_command_line.GetSwitchValueNative(switches::kPpapiPluginLauncher); 37 browser_command_line.GetSwitchValueNative(switches::kPpapiPluginLauncher);
38 38
39 FilePath exe_path = ChildProcessHost::GetChildPath(plugin_launcher.empty()); 39 #if defined(OS_LINUX)
40 int flags = plugin_launcher.empty() ? ChildProcessHost::CHILD_ALLOW_SELF :
41 ChildProcessHost::CHILD_NORMAL;
42 #else
43 int flags = ChildProcessHost::CHILD_NORMAL;
44 #endif
45
46 FilePath exe_path = ChildProcessHost::GetChildPath(flags);
40 if (exe_path.empty()) 47 if (exe_path.empty())
41 return false; 48 return false;
42 49
43 CommandLine* cmd_line = new CommandLine(exe_path); 50 CommandLine* cmd_line = new CommandLine(exe_path);
44 cmd_line->AppendSwitchASCII(switches::kProcessType, 51 cmd_line->AppendSwitchASCII(switches::kProcessType,
45 switches::kPpapiBrokerProcess); 52 switches::kPpapiBrokerProcess);
46 cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id()); 53 cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id());
47 54
48 if (!plugin_launcher.empty()) 55 if (!plugin_launcher.empty())
49 cmd_line->PrependWrapper(plugin_launcher); 56 cmd_line->PrependWrapper(plugin_launcher);
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 ::DuplicateHandle(::GetCurrentProcess(), broker_process, 175 ::DuplicateHandle(::GetCurrentProcess(), broker_process,
169 renderer_process, &renderers_broker_handle, 176 renderer_process, &renderers_broker_handle,
170 0, FALSE, DUPLICATE_SAME_ACCESS); 177 0, FALSE, DUPLICATE_SAME_ACCESS);
171 #elif defined(OS_POSIX) 178 #elif defined(OS_POSIX)
172 // Don't need to duplicate anything on POSIX since it's just a PID. 179 // Don't need to duplicate anything on POSIX since it's just a PID.
173 base::ProcessHandle renderers_broker_handle = broker_process; 180 base::ProcessHandle renderers_broker_handle = broker_process;
174 #endif 181 #endif
175 182
176 client->OnChannelOpened(renderers_broker_handle, channel_handle); 183 client->OnChannelOpened(renderers_broker_handle, channel_handle);
177 } 184 }
OLDNEW
« no previous file with comments | « content/browser/plugin_process_host.cc ('k') | content/browser/renderer_host/browser_render_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698