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 #include "content/browser/plugin_process_host.h" | 5 #include "content/browser/plugin_process_host.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #elif defined(OS_POSIX) | 9 #elif defined(OS_POSIX) |
10 #include <utility> // for pair<> | 10 #include <utility> // for pair<> |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 if (channel_id.empty()) | 182 if (channel_id.empty()) |
183 return false; | 183 return false; |
184 | 184 |
185 // Build command line for plugin. When we have a plugin launcher, we can't | 185 // Build command line for plugin. When we have a plugin launcher, we can't |
186 // allow "self" on linux and we need the real file path. | 186 // allow "self" on linux and we need the real file path. |
187 const base::CommandLine& browser_command_line = | 187 const base::CommandLine& browser_command_line = |
188 *base::CommandLine::ForCurrentProcess(); | 188 *base::CommandLine::ForCurrentProcess(); |
189 base::CommandLine::StringType plugin_launcher = | 189 base::CommandLine::StringType plugin_launcher = |
190 browser_command_line.GetSwitchValueNative(switches::kPluginLauncher); | 190 browser_command_line.GetSwitchValueNative(switches::kPluginLauncher); |
191 | 191 |
192 #if defined(OS_MACOSX) | 192 #if defined(OS_LINUX) |
193 // Run the plugin process in a mode tolerant of heap execution without | |
194 // explicit mprotect calls. Some plugins still rely on this quaint and | |
195 // archaic "feature." See http://crbug.com/93551. | |
196 int flags = ChildProcessHost::CHILD_ALLOW_HEAP_EXECUTION; | |
197 #elif defined(OS_LINUX) | |
198 int flags = plugin_launcher.empty() ? ChildProcessHost::CHILD_ALLOW_SELF : | 193 int flags = plugin_launcher.empty() ? ChildProcessHost::CHILD_ALLOW_SELF : |
199 ChildProcessHost::CHILD_NORMAL; | 194 ChildProcessHost::CHILD_NORMAL; |
200 #else | 195 #else |
201 int flags = ChildProcessHost::CHILD_NORMAL; | 196 int flags = ChildProcessHost::CHILD_NORMAL; |
202 #endif | 197 #endif |
203 | 198 |
204 base::FilePath exe_path = ChildProcessHost::GetChildPath(flags); | 199 base::FilePath exe_path = ChildProcessHost::GetChildPath(flags); |
205 if (exe_path.empty()) | 200 if (exe_path.empty()) |
206 return false; | 201 return false; |
207 | 202 |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 | 423 |
429 void PluginProcessHost::GetContexts(const ResourceHostMsg_Request& request, | 424 void PluginProcessHost::GetContexts(const ResourceHostMsg_Request& request, |
430 ResourceContext** resource_context, | 425 ResourceContext** resource_context, |
431 net::URLRequestContext** request_context) { | 426 net::URLRequestContext** request_context) { |
432 *resource_context = | 427 *resource_context = |
433 resource_context_map_[request.origin_pid].resource_context; | 428 resource_context_map_[request.origin_pid].resource_context; |
434 *request_context = (*resource_context)->GetRequestContext(); | 429 *request_context = (*resource_context)->GetRequestContext(); |
435 } | 430 } |
436 | 431 |
437 } // namespace content | 432 } // namespace content |
OLD | NEW |