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

Unified Diff: content/utility/utility_main.cc

Issue 1251823002: Initialize blink only when needed in utility processes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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
Index: content/utility/utility_main.cc
diff --git a/content/utility/utility_main.cc b/content/utility/utility_main.cc
index 4c6e721287a1cbdc160c11da3558296d710cd9b2..742a476963092b4a6e084c2186d229f6ff79154d 100644
--- a/content/utility/utility_main.cc
+++ b/content/utility/utility_main.cc
@@ -15,6 +15,7 @@
#include "content/utility/utility_thread_impl.h"
#if defined(OS_WIN)
+#include "base/rand_util.h"
#include "sandbox/win/src/sandbox.h"
#endif
@@ -52,6 +53,10 @@ int UtilityMain(const MainFunctionParams& parameters) {
if (!LoadLibraryA("dbghelp.dll"))
return false;
#endif
+ char buffer;
+ // Ensure RtlGenRandom is warm before the token is lowered; otherwise,
+ // base::RandBytes() will CHECK fail when v8 is initialized.
+ base::RandBytes(&buffer, sizeof(buffer));
target_services->LowerToken();
}
#endif

Powered by Google App Engine
This is Rietveld 408576698