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

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 base feedback. Rebase. 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/renderer/gpu/compositor_thread.h ('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..864968eb0cec0281e915023e45f3a0e9367b1994 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;
@@ -90,6 +95,10 @@ CompositorThread::CompositorThread(IPC::Listener* main_listener)
thread_.message_loop()->message_loop_proxy(),
base::Bind(&CompositorThread::HandleInputEvent,
base::Unretained(this)));
+ thread_.message_loop()->PostTask(FROM_HERE,
+ base::Bind(&CompositorThread::InitOnThread,
darin (slow to review) 2013/01/23 21:52:43 nit: bind a static function since you don't need a
+ // thread_ out-lives 'this'
+ base::Unretained(this)));
}
CompositorThread::~CompositorThread() {
@@ -166,4 +175,12 @@ void CompositorThread::HandleInputEvent(
it->second->input_handler()->handleInputEvent(*input_event);
}
+void CompositorThread::InitOnThread() {
+#if defined(OS_ANDROID)
+ // TODO(epenner): Move thread priorities to base. (crbug.com/170549)
+ int nice_value = -6; // High priority.
+ setpriority(PRIO_PROCESS, base::PlatformThread::CurrentId(), nice_value);
+#endif
+}
+
} // namespace content
« no previous file with comments | « content/renderer/gpu/compositor_thread.h ('k') | ui/gl/async_pixel_transfer_delegate_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698