OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/child/child_process.h" | 5 #include "content/child/child_process.h" |
6 | 6 |
7 #if defined(OS_POSIX) && !defined(OS_ANDROID) | 7 #if defined(OS_POSIX) && !defined(OS_ANDROID) |
8 #include <signal.h> // For SigUSR1Handler below. | 8 #include <signal.h> // For SigUSR1Handler below. |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 30 matching lines...) Expand all Loading... |
41 DCHECK(!g_lazy_tls.Pointer()->Get()); | 41 DCHECK(!g_lazy_tls.Pointer()->Get()); |
42 g_lazy_tls.Pointer()->Set(this); | 42 g_lazy_tls.Pointer()->Set(this); |
43 | 43 |
44 base::StatisticsRecorder::Initialize(); | 44 base::StatisticsRecorder::Initialize(); |
45 | 45 |
46 // We can't recover from failing to start the IO thread. | 46 // We can't recover from failing to start the IO thread. |
47 CHECK(io_thread_.StartWithOptions( | 47 CHECK(io_thread_.StartWithOptions( |
48 base::Thread::Options(base::MessageLoop::TYPE_IO, 0))); | 48 base::Thread::Options(base::MessageLoop::TYPE_IO, 0))); |
49 | 49 |
50 #if defined(OS_ANDROID) | 50 #if defined(OS_ANDROID) |
51 io_thread_.SetPriority(base::kThreadPriority_Display); | 51 io_thread_.SetPriority(base::ThreadPriority::DISPLAY); |
52 #endif | 52 #endif |
53 } | 53 } |
54 | 54 |
55 ChildProcess::~ChildProcess() { | 55 ChildProcess::~ChildProcess() { |
56 DCHECK(g_lazy_tls.Pointer()->Get() == this); | 56 DCHECK(g_lazy_tls.Pointer()->Get() == this); |
57 | 57 |
58 // Signal this event before destroying the child process. That way all | 58 // Signal this event before destroying the child process. That way all |
59 // background threads can cleanup. | 59 // background threads can cleanup. |
60 // For example, in the renderer the RenderThread instances will be able to | 60 // For example, in the renderer the RenderThread instances will be able to |
61 // notice shutdown before the render process begins waiting for them to exit. | 61 // notice shutdown before the render process begins waiting for them to exit. |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 memset(&sa, 0, sizeof(sa)); | 139 memset(&sa, 0, sizeof(sa)); |
140 sa.sa_handler = SigUSR1Handler; | 140 sa.sa_handler = SigUSR1Handler; |
141 sigaction(SIGUSR1, &sa, NULL); | 141 sigaction(SIGUSR1, &sa, NULL); |
142 | 142 |
143 pause(); | 143 pause(); |
144 #endif // defined(OS_ANDROID) | 144 #endif // defined(OS_ANDROID) |
145 #endif // defined(OS_POSIX) | 145 #endif // defined(OS_POSIX) |
146 } | 146 } |
147 | 147 |
148 } // namespace content | 148 } // namespace content |
OLD | NEW |