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

Unified Diff: content/renderer/render_thread_impl.cc

Issue 281073002: NOT FOR REVIEW: Adding prioritized incoming task queue to renderers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Prioritize input events Created 6 years, 7 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/render_thread_impl.h ('k') | content/renderer/renderer_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_thread_impl.cc
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index e4ea63fd7b158c8c4c99be3523549abdfeb637a9..3efccda9f11a4c7528b3829a90e023c04884ba1b 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -16,6 +16,7 @@
#include "base/logging.h"
#include "base/memory/discardable_memory.h"
#include "base/memory/shared_memory.h"
+#include "base/message_loop/high_priority_task_runner.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram.h"
#include "base/metrics/stats_table.h"
@@ -33,6 +34,7 @@
#include "content/child/appcache/appcache_frontend_impl.h"
#include "content/child/child_histogram_message_filter.h"
#include "content/child/db_message_filter.h"
+#include "content/child/high_priority_resource_filter.h"
#include "content/child/indexed_db/indexed_db_dispatcher.h"
#include "content/child/indexed_db/indexed_db_message_filter.h"
#include "content/child/npapi/npobject_util.h"
@@ -561,6 +563,11 @@ void RenderThreadImpl::Shutdown() {
input_event_filter_ = NULL;
}
+ if (high_priority_resource_filter_.get()) {
+ RemoveFilter(high_priority_resource_filter_.get());
+ high_priority_resource_filter_ = NULL;
+ }
+
// Ramp down IDB before we ramp down WebKit (and V8), since IDB classes might
// hold pointers to V8 objects (e.g., via pending requests).
main_thread_indexed_db_dispatcher_.reset();
@@ -761,6 +768,10 @@ void RenderThreadImpl::EnsureWebKitInitialized() {
if (!input_handler_manager_client) {
input_event_filter_ =
new InputEventFilter(this, compositor_message_loop_proxy_);
+ if (high_priority_task_runner_.get()) {
+ input_event_filter_->SetHighPriorityTaskRunner(
+ high_priority_task_runner_);
+ }
AddFilter(input_event_filter_.get());
input_handler_manager_client = input_event_filter_.get();
}
@@ -1072,6 +1083,20 @@ media::AudioHardwareConfig* RenderThreadImpl::GetAudioHardwareConfig() {
return audio_hardware_config_.get();
}
+void RenderThreadImpl::UseHighPriorityTaskRunner(
+ scoped_refptr<base::HighPriorityTaskRunner> high_priority_task_runner) {
+ DCHECK(!high_priority_resource_filter_.get());
+ DCHECK(channel());
+
+ high_priority_task_runner_ = high_priority_task_runner;
+ high_priority_resource_filter_ = new HighPriorityResourceFilter(
+ resource_dispatcher(), high_priority_task_runner);
+ resource_dispatcher()->set_high_priority_resource_filter(
+ high_priority_resource_filter_.get());
+
+ channel()->AddFilter(high_priority_resource_filter_.get());
+}
+
base::WaitableEvent* RenderThreadImpl::GetShutdownEvent() {
return ChildProcess::current()->GetShutDownEvent();
}
« no previous file with comments | « content/renderer/render_thread_impl.h ('k') | content/renderer/renderer_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698