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

Unified Diff: chrome/browser/chrome_browser_main_win.cc

Issue 12805004: Remove mention of the nacl process in content. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix chrome_frame_net_tests and sync 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 | « no previous file | chrome/nacl/nacl_exe_win_64.cc » ('j') | content/common/sandbox_init_win.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_main_win.cc
===================================================================
--- chrome/browser/chrome_browser_main_win.cc (revision 188735)
+++ chrome/browser/chrome_browser_main_win.cc (working copy)
@@ -42,10 +42,12 @@
#include "chrome/installer/util/l10n_string_util.h"
#include "chrome/installer/util/shell_util.h"
#include "content/public/common/main_function_params.h"
+#include "content/public/common/sandbox_init.h"
#include "grit/app_locale_settings.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "installer_util_strings/installer_util_strings.h"
+#include "sandbox/win/src/sandbox_policy.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/l10n/l10n_util_win.h"
#include "ui/base/ui_base_switches.h"
@@ -86,6 +88,31 @@
virtual string16 GetLocalizedString(int installer_string_id) OVERRIDE;
};
cpu_(ooo_6.6-7.5) 2013/03/18 19:46:26 this function looks really ugly here, isn't a bett
jam 2013/03/18 19:50:19 I agree this is a bit of an odd function. I think
+void AddNaClPolicyCallback(CommandLine* cmd_line,
+ sandbox::TargetPolicy* policy) {
+ if (cmd_line->GetSwitchValueASCII(switches::kProcessType) !=
+ switches::kRendererProcess) {
+ return;
+ }
+
+ // 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.*");
+ CHECK(result == sandbox::SBOX_ALL_OK);
+
+ // 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");
+ CHECK(result == sandbox::SBOX_ALL_OK);
+}
+
} // namespace
void RecordBreakpadStatusUMA(MetricsService* metrics) {
@@ -215,6 +242,9 @@
tsf_message_filter.PassAs<MessageLoopForUI::MessageFilter>());
}
}
+
+ content::SetSandboxedProcessStartingCallback(
+ base::Bind(AddNaClPolicyCallback));
}
void ChromeBrowserMainPartsWin::PreMainMessageLoopRun() {
« no previous file with comments | « no previous file | chrome/nacl/nacl_exe_win_64.cc » ('j') | content/common/sandbox_init_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698