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

Unified Diff: content/child/resource_dispatcher.cc

Issue 1366883002: [Reland] Post loading tasks on the appropriate WebFrameScheduler's queue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added a clone method to WebTaskRunner which lets us solve the lifetime issue. Created 5 years, 3 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
Index: content/child/resource_dispatcher.cc
diff --git a/content/child/resource_dispatcher.cc b/content/child/resource_dispatcher.cc
index aeb1cbebc66081a825d767c136866c04d3bbe4fd..fb00ea865c68669cb6323b54a10604fa94d2b7d3 100644
--- a/content/child/resource_dispatcher.cc
+++ b/content/child/resource_dispatcher.cc
@@ -18,6 +18,7 @@
#include "base/strings/string_util.h"
#include "content/child/request_extra_data.h"
#include "content/child/request_info.h"
+#include "content/child/resource_scheduling_filter.h"
#include "content/child/shared_memory_received_data_factory.h"
#include "content/child/site_isolation_stats_gatherer.h"
#include "content/child/sync_load_response.h"
@@ -33,6 +34,7 @@
#include "net/base/net_util.h"
#include "net/base/request_priority.h"
#include "net/http/http_response_headers.h"
+#include "third_party/WebKit/public/platform/WebTaskRunner.h"
namespace content {
@@ -403,6 +405,9 @@ bool ResourceDispatcher::RemovePendingRequest(int request_id) {
new ResourceHostMsg_ReleaseDownloadedFile(request_id));
}
+ if (resource_scheduling_filter_.get())
+ resource_scheduling_filter_->ClearRequestIdTaskRunner(request_id);
+
return true;
}
@@ -588,6 +593,11 @@ int ResourceDispatcher::StartAsync(const RequestInfo& request_info,
request->url,
request_info.download_to_file);
+ if (resource_scheduling_filter_.get()) {
+ resource_scheduling_filter_->SetRequestIdTaskRunner(
+ request_id, request_info.loading_web_task_runner->clone());
Sami 2015/09/29 11:22:46 |loading_web_task_runner| was optional so should w
alex clarke (OOO till 29th) 2015/09/29 16:10:36 Done.
+ }
+
message_sender_->Send(new ResourceHostMsg_RequestResource(
request_info.routing_id, request_id, *request));
@@ -794,4 +804,9 @@ scoped_ptr<ResourceHostMsg_Request> ResourceDispatcher::CreateRequest(
return request.Pass();
}
+void ResourceDispatcher::SetResourceSchedulingFilter(
+ ResourceSchedulingFilter* resource_scheduling_filter) {
+ resource_scheduling_filter_ = resource_scheduling_filter;
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698