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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 12805004: Remove mention of the nacl process in content. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | chrome/browser/nacl_host/nacl_broker_host_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_content_browser_client.cc
===================================================================
--- chrome/browser/chrome_content_browser_client.cc (revision 189099)
+++ chrome/browser/chrome_content_browser_client.cc (working copy)
@@ -125,6 +125,7 @@
#if defined(OS_WIN)
#include "chrome/browser/chrome_browser_main_win.h"
+#include "sandbox/win/src/sandbox_policy.h"
#elif defined(OS_MACOSX)
#include "chrome/browser/chrome_browser_main_mac.h"
#include "chrome/browser/spellchecker/spellcheck_message_filter_mac.h"
@@ -2093,6 +2094,33 @@
const wchar_t* ChromeContentBrowserClient::GetResourceDllName() {
return chrome::kBrowserResourcesDll;
}
+
+void ChromeContentBrowserClient::PreSpawnRenderer(
+ sandbox::TargetPolicy* policy,
+ bool* success) {
+ // This code is duplicated in nacl_exe_win_64.cc.
+ // Allow the server side of a pipe restricted to the "chrome.nacl."
+ // namespace so that it cannot impersonate other system or other chrome
+ // service pipes.
+ sandbox::ResultCode result = policy->AddRule(
+ sandbox::TargetPolicy::SUBSYS_NAMED_PIPES,
+ sandbox::TargetPolicy::NAMEDPIPES_ALLOW_ANY,
+ L"\\\\.\\pipe\\chrome.nacl.*");
+ if (result != sandbox::SBOX_ALL_OK) {
+ *success = false;
+ return;
+ }
+
+ // Renderers need to send named pipe handles and shared memory
+ // segment handles to NaCl loader processes.
+ result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_HANDLES,
+ sandbox::TargetPolicy::HANDLES_DUP_ANY,
+ L"File");
+ if (result != sandbox::SBOX_ALL_OK) {
+ *success = false;
+ return;
+ }
+}
#endif
#if defined(USE_NSS)
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | chrome/browser/nacl_host/nacl_broker_host_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698