OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/debug/leak_annotations.h" | 6 #include "base/debug/leak_annotations.h" |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/run_loop.h" |
8 #include "base/threading/platform_thread.h" | 9 #include "base/threading/platform_thread.h" |
9 #include "base/timer/hi_res_timer_manager.h" | 10 #include "base/timer/hi_res_timer_manager.h" |
10 #include "build/build_config.h" | 11 #include "build/build_config.h" |
11 #include "content/child/child_process.h" | 12 #include "content/child/child_process.h" |
12 #include "content/common/sandbox_linux/sandbox_linux.h" | 13 #include "content/common/sandbox_linux/sandbox_linux.h" |
13 #include "content/public/common/content_switches.h" | 14 #include "content/public/common/content_switches.h" |
14 #include "content/public/common/main_function_params.h" | 15 #include "content/public/common/main_function_params.h" |
15 #include "content/public/common/sandbox_init.h" | 16 #include "content/public/common/sandbox_init.h" |
16 #include "content/utility/utility_thread_impl.h" | 17 #include "content/utility/utility_thread_impl.h" |
17 | 18 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 if (!target_services) | 50 if (!target_services) |
50 return false; | 51 return false; |
51 char buffer; | 52 char buffer; |
52 // Ensure RtlGenRandom is warm before the token is lowered; otherwise, | 53 // Ensure RtlGenRandom is warm before the token is lowered; otherwise, |
53 // base::RandBytes() will CHECK fail when v8 is initialized. | 54 // base::RandBytes() will CHECK fail when v8 is initialized. |
54 base::RandBytes(&buffer, sizeof(buffer)); | 55 base::RandBytes(&buffer, sizeof(buffer)); |
55 target_services->LowerToken(); | 56 target_services->LowerToken(); |
56 } | 57 } |
57 #endif | 58 #endif |
58 | 59 |
59 base::MessageLoop::current()->Run(); | 60 base::RunLoop().Run(); |
60 | 61 |
61 #if defined(LEAK_SANITIZER) | 62 #if defined(LEAK_SANITIZER) |
62 // Invoke LeakSanitizer before shutting down the utility thread, to avoid | 63 // Invoke LeakSanitizer before shutting down the utility thread, to avoid |
63 // reporting shutdown-only leaks. | 64 // reporting shutdown-only leaks. |
64 __lsan_do_leak_check(); | 65 __lsan_do_leak_check(); |
65 #endif | 66 #endif |
66 | 67 |
67 return 0; | 68 return 0; |
68 } | 69 } |
69 | 70 |
70 } // namespace content | 71 } // namespace content |
OLD | NEW |