Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Unified Diff: content/browser/browser_main_loop.cc

Issue 11880014: cc: Set ui/gpu/cc/ipc/upload/raster thread priorities. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Address feedback (use static). Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/raster_worker_pool.cc ('k') | content/common/child_process.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « cc/raster_worker_pool.cc ('k') | content/common/child_process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698