| Index: content/common/child_process.cc
|
| diff --git a/content/common/child_process.cc b/content/common/child_process.cc
|
| index f0dfdc5db41736bcf83c05e2650c5a9c7d3b40d1..6e5d9a45d5f6ae4e6dd58e86d34793c93b862079 100644
|
| --- a/content/common/child_process.cc
|
| +++ b/content/common/child_process.cc
|
| @@ -18,6 +18,8 @@
|
|
|
| #if defined(OS_ANDROID)
|
| #include "base/debug/debugger.h"
|
| +// TODO(epenner): Move thread priorities to base. (crbug.com/170549)
|
| +#include <sys/resource.h>
|
| #endif
|
|
|
| #if defined(OS_POSIX) && !defined(OS_ANDROID)
|
| @@ -28,6 +30,16 @@ namespace content {
|
|
|
| ChildProcess* ChildProcess::child_process_;
|
|
|
| +#if defined(OS_ANDROID)
|
| +// TODO(epenner): Move thread priorities to base. (crbug.com/170549)
|
| +namespace {
|
| +void SetHighThreadPriority() {
|
| + int nice_value = -6; // High priority.
|
| + setpriority(PRIO_PROCESS, base::PlatformThread::CurrentId(), nice_value);
|
| +}
|
| +}
|
| +#endif
|
| +
|
| ChildProcess::ChildProcess()
|
| : ref_count_(0),
|
| shutdown_event_(true, false),
|
| @@ -40,6 +52,12 @@ ChildProcess::ChildProcess()
|
| // We can't recover from failing to start the IO thread.
|
| CHECK(io_thread_.StartWithOptions(
|
| base::Thread::Options(MessageLoop::TYPE_IO, 0)));
|
| +
|
| +#if defined(OS_ANDROID)
|
| + // TODO(epenner): Move thread priorities to base. (crbug.com/170549)
|
| + io_thread_.message_loop()->PostTask(FROM_HERE,
|
| + base::Bind(&SetHighThreadPriority));
|
| +#endif
|
| }
|
|
|
| ChildProcess::~ChildProcess() {
|
|
|