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

Side by Side Diff: chrome/worker/worker_main.cc

Issue 3119003: Merge 53027 - Call rand_s() in a worker process before entering the sandbox.... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/472/src/
Patch Set: Created 10 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/worker/worker_uitest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "app/hi_res_timer_manager.h" 5 #include "app/hi_res_timer_manager.h"
6 #include "app/system_monitor.h" 6 #include "app/system_monitor.h"
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "chrome/common/child_process.h" 10 #include "chrome/common/child_process.h"
(...skipping 18 matching lines...) Expand all
29 HighResolutionTimerManager hi_res_timer_manager; 29 HighResolutionTimerManager hi_res_timer_manager;
30 30
31 ChildProcess worker_process; 31 ChildProcess worker_process;
32 worker_process.set_main_thread(new WorkerThread()); 32 worker_process.set_main_thread(new WorkerThread());
33 #if defined(OS_WIN) 33 #if defined(OS_WIN)
34 sandbox::TargetServices* target_services = 34 sandbox::TargetServices* target_services =
35 parameters.sandbox_info_.TargetServices(); 35 parameters.sandbox_info_.TargetServices();
36 if (!target_services) 36 if (!target_services)
37 return false; 37 return false;
38 38
39 // Cause advapi32 to load before the sandbox is turned on.
40 unsigned int dummy_rand;
41 rand_s(&dummy_rand);
42
39 target_services->LowerToken(); 43 target_services->LowerToken();
40 #endif 44 #endif
41 45
42 const CommandLine& parsed_command_line = parameters.command_line_; 46 const CommandLine& parsed_command_line = parameters.command_line_;
43 if (parsed_command_line.HasSwitch(switches::kWaitForDebugger)) { 47 if (parsed_command_line.HasSwitch(switches::kWaitForDebugger)) {
44 ChildProcess::WaitForDebugger(L"Worker"); 48 ChildProcess::WaitForDebugger(L"Worker");
45 } 49 }
46 50
47 // Load the accelerator table from the browser executable and tell the 51 // Load the accelerator table from the browser executable and tell the
48 // message loop to use it when translating messages. 52 // message loop to use it when translating messages.
49 MessageLoop::current()->Run(); 53 MessageLoop::current()->Run();
50 54
51 return 0; 55 return 0;
52 } 56 }
OLDNEW
« no previous file with comments | « no previous file | chrome/worker/worker_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698