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

Unified Diff: content/browser/zygote_main_linux.cc

Issue 6684018: Initialize NSS with no DB in the renderer process (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed comments Created 9 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
« base/nss_util.cc ('K') | « content/browser/zygote_host_linux.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/zygote_main_linux.cc
diff --git a/content/browser/zygote_main_linux.cc b/content/browser/zygote_main_linux.cc
index 47932817e82a7ec24dcfde47d0e168bc3fb5c11b..33a1d56ca38f3827a0ad1752075b3e458ec580f7 100644
--- a/content/browser/zygote_main_linux.cc
+++ b/content/browser/zygote_main_linux.cc
@@ -21,6 +21,7 @@
#include "content/browser/zygote_host_linux.h"
+#include "base/base64.h"
wtc 2011/03/15 21:37:20 Nit: why does the new code need "base/base64.h"?
#include "base/basictypes.h"
#include "base/command_line.h"
#include "base/eintr_wrapper.h"
@@ -28,6 +29,7 @@
#include "base/global_descriptors_posix.h"
#include "base/hash_tables.h"
#include "base/linux_util.h"
+#include "base/nss_util.h"
#include "base/path_service.h"
#include "base/pickle.h"
#include "base/process_util.h"
@@ -600,6 +602,20 @@ static void PreSandboxInit() {
if (PathService::Get(base::DIR_MODULE, &module_path))
media::InitializeMediaLibrary(module_path);
+ // Remoting requires NSS to function properly. It is not used for other
+ // reasons so load NSS only if remoting is enabled.
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ if (command_line.HasSwitch(switches::kEnableRemoting)) {
+ // We are going to fork to engage the sandbox and we have not loaded
+ // any security modules so it is safe to disable the fork check in NSS.
+ base::DisableNSSForkCheck();
+
+ // Initialize NSS so that we load the necessary library files
+ // before we enter the sandbox.
+ base::ForceNSSNoDBInit();
+ base::EnsureNSSInit();
+ }
+
// Ensure access to the Pepper plugins before the sandbox is turned on.
PepperPluginRegistry::PreloadModules();
}
« base/nss_util.cc ('K') | « content/browser/zygote_host_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698