diff options
author | yutak@chromium.org <yutak@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-20 09:25:23 +0000 |
---|---|---|
committer | yutak@chromium.org <yutak@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-20 09:25:23 +0000 |
commit | 9f93574de4d1c73783a3ca5c89c809d73780cd5c (patch) | |
tree | 42a9b7f15976d5a24d50607481aad90d04b64ba5 /chrome/worker | |
parent | ac996efe5d61c29762fe3c740f0cc95a8a5d22ed (diff) | |
download | chromium_src-9f93574de4d1c73783a3ca5c89c809d73780cd5c.zip chromium_src-9f93574de4d1c73783a3ca5c89c809d73780cd5c.tar.gz chromium_src-9f93574de4d1c73783a3ca5c89c809d73780cd5c.tar.bz2 |
Call rand_s() in a worker process before entering the sandbox.
We need to do it to cause advapi32.dll to load the sandbox is turned on.
Otherwise rand_s() will fail in the sandbox.
BUG=47390
TEST=Run "ui_tests --gtest_filter=WorkerTest.WorkerWebSocketLayoutTests".
Review URL: http://codereview.chromium.org/2799047
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53027 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/worker')
-rw-r--r-- | chrome/worker/worker_main.cc | 4 | ||||
-rw-r--r-- | chrome/worker/worker_uitest.cc | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/chrome/worker/worker_main.cc b/chrome/worker/worker_main.cc index d839760..82d0eca 100644 --- a/chrome/worker/worker_main.cc +++ b/chrome/worker/worker_main.cc @@ -36,6 +36,10 @@ int WorkerMain(const MainFunctionParams& parameters) { if (!target_services) return false; + // Cause advapi32 to load before the sandbox is turned on. + unsigned int dummy_rand; + rand_s(&dummy_rand); + target_services->LowerToken(); #endif diff --git a/chrome/worker/worker_uitest.cc b/chrome/worker/worker_uitest.cc index 061c3f2..ca14f9c 100644 --- a/chrome/worker/worker_uitest.cc +++ b/chrome/worker/worker_uitest.cc @@ -425,6 +425,7 @@ TEST_F(WorkerTest, FLAKY_WorkerWebSocketLayoutTests) { static const char* kLayoutTestFiles[] = { "worker-simple.html", "shared-worker-simple.html", + "worker-handshake-challenge-randomness.html" }; FilePath websocket_test_dir; |