| Index: content/browser/browser_main_loop.cc
|
| diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
|
| index b58a2cb2267779a56d004a1b0aa6ba3c07f5f733..6f91733ab179b0d29b6081575d96f977ce41c905 100644
|
| --- a/content/browser/browser_main_loop.cc
|
| +++ b/content/browser/browser_main_loop.cc
|
| @@ -55,6 +55,8 @@
|
| #include "base/android/jni_android.h"
|
| #include "content/browser/android/surface_texture_peer_browser_impl.h"
|
| #include "content/browser/device_orientation/data_fetcher_impl_android.h"
|
| +// TODO(epenner): Move thread priorities to base. (crbug.com/170549)
|
| +#include <sys/resource.h>
|
| #endif
|
|
|
| #if defined(OS_WIN)
|
| @@ -634,7 +636,27 @@ void BrowserMainLoop::InitializeMainThread() {
|
| MessageLoop::current()));
|
| }
|
|
|
| +#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
|
| +
|
| void BrowserMainLoop::BrowserThreadsStarted() {
|
| +#if defined(OS_ANDROID)
|
| +// TODO(epenner): Move thread priorities to base. (crbug.com/170549)
|
| + BrowserThread::PostTask(BrowserThread::UI,
|
| + FROM_HERE,
|
| + base::Bind(&SetHighThreadPriority));
|
| + BrowserThread::PostTask(BrowserThread::IO,
|
| + FROM_HERE,
|
| + base::Bind(&SetHighThreadPriority));
|
| +#endif
|
| +
|
| #if !defined(OS_IOS)
|
| HistogramSynchronizer::GetInstance();
|
|
|
|
|