OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 // Represents the browser side of the browser <--> renderer communication | 5 // Represents the browser side of the browser <--> renderer communication |
6 // channel. There will be one RenderProcessHost per renderer process. | 6 // channel. There will be one RenderProcessHost per renderer process. |
7 | 7 |
8 #include "chrome/browser/renderer_host/browser_render_process_host.h" | 8 #include "chrome/browser/renderer_host/browser_render_process_host.h" |
9 | 9 |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "base/thread.h" | 29 #include "base/thread.h" |
30 #include "chrome/browser/browser_process.h" | 30 #include "chrome/browser/browser_process.h" |
31 #include "chrome/browser/child_process_security_policy.h" | 31 #include "chrome/browser/child_process_security_policy.h" |
32 #include "chrome/browser/extensions/extension_message_service.h" | 32 #include "chrome/browser/extensions/extension_message_service.h" |
33 #include "chrome/browser/extensions/user_script_master.h" | 33 #include "chrome/browser/extensions/user_script_master.h" |
34 #include "chrome/browser/history/history.h" | 34 #include "chrome/browser/history/history.h" |
35 #include "chrome/browser/plugin_service.h" | 35 #include "chrome/browser/plugin_service.h" |
36 #include "chrome/browser/profile.h" | 36 #include "chrome/browser/profile.h" |
37 #if defined(OS_LINUX) | 37 #if defined(OS_LINUX) |
38 #include "chrome/browser/renderer_host/render_crash_handler_host_linux.h" | 38 #include "chrome/browser/renderer_host/render_crash_handler_host_linux.h" |
| 39 #include "chrome/browser/renderer_host/render_sandbox_host_linux.h" |
39 #endif | 40 #endif |
40 #include "chrome/browser/renderer_host/render_view_host.h" | 41 #include "chrome/browser/renderer_host/render_view_host.h" |
41 #include "chrome/browser/renderer_host/render_widget_helper.h" | 42 #include "chrome/browser/renderer_host/render_widget_helper.h" |
42 #include "chrome/browser/renderer_host/render_widget_host.h" | 43 #include "chrome/browser/renderer_host/render_widget_host.h" |
43 #include "chrome/browser/renderer_host/resource_message_filter.h" | 44 #include "chrome/browser/renderer_host/resource_message_filter.h" |
44 #include "chrome/browser/renderer_host/web_cache_manager.h" | 45 #include "chrome/browser/renderer_host/web_cache_manager.h" |
45 #include "chrome/browser/visitedlink_master.h" | 46 #include "chrome/browser/visitedlink_master.h" |
46 #include "chrome/common/chrome_switches.h" | 47 #include "chrome/common/chrome_switches.h" |
47 #include "chrome/common/child_process_info.h" | 48 #include "chrome/common/child_process_info.h" |
48 #include "chrome/common/logging_chrome.h" | 49 #include "chrome/common/logging_chrome.h" |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 base::file_handle_mapping_vector fds_to_map; | 339 base::file_handle_mapping_vector fds_to_map; |
339 int src_fd = -1, dest_fd = -1; | 340 int src_fd = -1, dest_fd = -1; |
340 channel_->GetClientFileDescriptorMapping(&src_fd, &dest_fd); | 341 channel_->GetClientFileDescriptorMapping(&src_fd, &dest_fd); |
341 if (src_fd > -1) | 342 if (src_fd > -1) |
342 fds_to_map.push_back(std::pair<int, int>(src_fd, dest_fd)); | 343 fds_to_map.push_back(std::pair<int, int>(src_fd, dest_fd)); |
343 #if defined(OS_LINUX) | 344 #if defined(OS_LINUX) |
344 const int crash_signal_fd = | 345 const int crash_signal_fd = |
345 Singleton<RenderCrashHandlerHostLinux>()->GetDeathSignalSocket(); | 346 Singleton<RenderCrashHandlerHostLinux>()->GetDeathSignalSocket(); |
346 if (crash_signal_fd >= 0) | 347 if (crash_signal_fd >= 0) |
347 fds_to_map.push_back(std::make_pair(crash_signal_fd, 4)); | 348 fds_to_map.push_back(std::make_pair(crash_signal_fd, 4)); |
| 349 const int sandbox_ipc_fd = |
| 350 Singleton<RenderSandboxHostLinux>()->GetRendererSocket(); |
| 351 if (sandbox_ipc_fd >= 0) |
| 352 fds_to_map.push_back(std::make_pair(sandbox_ipc_fd, 5)); |
348 #endif | 353 #endif |
349 base::LaunchApp(cmd_line.argv(), fds_to_map, false, &process); | 354 base::LaunchApp(cmd_line.argv(), fds_to_map, false, &process); |
350 #endif | 355 #endif |
351 if (!process) { | 356 if (!process) { |
352 channel_.reset(); | 357 channel_.reset(); |
353 return false; | 358 return false; |
354 } | 359 } |
355 process_.set_handle(process); | 360 process_.set_handle(process); |
356 SetProcessID(process_.pid()); | 361 SetProcessID(process_.pid()); |
357 } | 362 } |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
814 ExtensionMessageService* ems = ExtensionMessageService::GetInstance(context); | 819 ExtensionMessageService* ems = ExtensionMessageService::GetInstance(context); |
815 ems->AddEventListener(event_name, pid()); | 820 ems->AddEventListener(event_name, pid()); |
816 } | 821 } |
817 | 822 |
818 void BrowserRenderProcessHost::OnExtensionRemoveListener( | 823 void BrowserRenderProcessHost::OnExtensionRemoveListener( |
819 const std::string& event_name) { | 824 const std::string& event_name) { |
820 URLRequestContext* context = profile()->GetRequestContext(); | 825 URLRequestContext* context = profile()->GetRequestContext(); |
821 ExtensionMessageService* ems = ExtensionMessageService::GetInstance(context); | 826 ExtensionMessageService* ems = ExtensionMessageService::GetInstance(context); |
822 ems->RemoveEventListener(event_name, pid()); | 827 ems->RemoveEventListener(event_name, pid()); |
823 } | 828 } |
OLD | NEW |