| 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 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 DCHECK(!g_lazy_tls.Pointer()->Get()); | 47 DCHECK(!g_lazy_tls.Pointer()->Get()); |
| 48 g_lazy_tls.Pointer()->Set(this); | 48 g_lazy_tls.Pointer()->Set(this); |
| 49 | 49 |
| 50 base::StatisticsRecorder::Initialize(); | 50 base::StatisticsRecorder::Initialize(); |
| 51 | 51 |
| 52 // Initialize TaskScheduler if not already done. A TaskScheduler may already | 52 // Initialize TaskScheduler if not already done. A TaskScheduler may already |
| 53 // exist when ChildProcess is instantiated in the browser process or in a | 53 // exist when ChildProcess is instantiated in the browser process or in a |
| 54 // test process. | 54 // test process. |
| 55 if (!base::TaskScheduler::GetInstance()) { | 55 if (!base::TaskScheduler::GetInstance()) { |
| 56 if (task_scheduler_init_params) { | 56 if (task_scheduler_init_params) { |
| 57 base::TaskScheduler::CreateAndSetDefaultTaskScheduler( | 57 base::TaskScheduler::Create(task_scheduler_name); |
| 58 task_scheduler_name, *task_scheduler_init_params.get()); | 58 base::TaskScheduler::GetInstance()->Start( |
| 59 *task_scheduler_init_params.get()); |
| 59 } else { | 60 } else { |
| 60 base::TaskScheduler::CreateAndStartWithDefaultParams(task_scheduler_name); | 61 base::TaskScheduler::CreateAndStartWithDefaultParams(task_scheduler_name); |
| 61 } | 62 } |
| 62 | 63 |
| 63 DCHECK(base::TaskScheduler::GetInstance()); | 64 DCHECK(base::TaskScheduler::GetInstance()); |
| 64 initialized_task_scheduler_ = true; | 65 initialized_task_scheduler_ = true; |
| 65 } | 66 } |
| 66 | 67 |
| 67 // We can't recover from failing to start the IO thread. | 68 // We can't recover from failing to start the IO thread. |
| 68 base::Thread::Options thread_options(base::MessageLoop::TYPE_IO, 0); | 69 base::Thread::Options thread_options(base::MessageLoop::TYPE_IO, 0); |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 memset(&sa, 0, sizeof(sa)); | 179 memset(&sa, 0, sizeof(sa)); |
| 179 sa.sa_handler = SigUSR1Handler; | 180 sa.sa_handler = SigUSR1Handler; |
| 180 sigaction(SIGUSR1, &sa, NULL); | 181 sigaction(SIGUSR1, &sa, NULL); |
| 181 | 182 |
| 182 pause(); | 183 pause(); |
| 183 #endif // defined(OS_ANDROID) | 184 #endif // defined(OS_ANDROID) |
| 184 #endif // defined(OS_POSIX) | 185 #endif // defined(OS_POSIX) |
| 185 } | 186 } |
| 186 | 187 |
| 187 } // namespace content | 188 } // namespace content |
| OLD | NEW |