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

Unified Diff: content/renderer/gpu/compositor_thread.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 | « content/gpu/gpu_child_thread.cc ('k') | ui/gl/async_pixel_transfer_delegate_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/gpu/compositor_thread.cc
diff --git a/content/renderer/gpu/compositor_thread.cc b/content/renderer/gpu/compositor_thread.cc
index 815d1c221b155cab71ddea083fc165e5350bb124..cde2e933d8ac22a16ab1c6cfd57d1dec98168c2d 100644
--- a/content/renderer/gpu/compositor_thread.cc
+++ b/content/renderer/gpu/compositor_thread.cc
@@ -12,6 +12,11 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositorInputHandler.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
+#if defined(OS_ANDROID)
+// TODO(epenner): Move thread priorities to base. (crbug.com/170549)
+#include <sys/resource.h>
+#endif
+
using WebKit::WebCompositorInputHandler;
using WebKit::WebInputEvent;
@@ -83,6 +88,16 @@ class CompositorThread::InputHandlerWrapper
//------------------------------------------------------------------------------
+#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
+
CompositorThread::CompositorThread(IPC::Listener* main_listener)
: thread_("Compositor") {
filter_ =
@@ -90,6 +105,11 @@ CompositorThread::CompositorThread(IPC::Listener* main_listener)
thread_.message_loop()->message_loop_proxy(),
base::Bind(&CompositorThread::HandleInputEvent,
base::Unretained(this)));
+#if defined(OS_ANDROID)
+// TODO(epenner): Move thread priorities to base. (crbug.com/170549)
+ thread_.message_loop()->PostTask(FROM_HERE,
+ base::Bind(&SetHighThreadPriority));
+#endif
}
CompositorThread::~CompositorThread() {
« no previous file with comments | « content/gpu/gpu_child_thread.cc ('k') | ui/gl/async_pixel_transfer_delegate_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698