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

Unified Diff: content/child/web_url_loader_impl.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: Rebased 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/web_url_loader_impl.cc
diff --git a/content/child/web_url_loader_impl.cc b/content/child/web_url_loader_impl.cc
index 83c9ad5b64db596b8d5e7941f2c8abb3ea6ea493..8ce9b4512fec629cd43fd3adcd44f02d568a53d0 100644
--- a/content/child/web_url_loader_impl.cc
+++ b/content/child/web_url_loader_impl.cc
@@ -16,6 +16,7 @@
#include "base/strings/string_util.h"
#include "base/time/time.h"
#include "components/mime_util/mime_util.h"
+#include "components/scheduler/child/web_task_runner_impl.h"
#include "content/child/child_thread_impl.h"
#include "content/child/ftp_directory_listing_response_delegate.h"
#include "content/child/multipart_response_delegate.h"
@@ -267,6 +268,7 @@ class WebURLLoaderImpl::Context : public base::RefCounted<Context>,
blink::WebThreadedDataReceiver* threaded_data_receiver);
void Start(const WebURLRequest& request,
SyncLoadResponse* sync_load_response);
+ void SetTaskRunner(scoped_refptr<base::SingleThreadTaskRunner> task_runner);
// RequestPeer methods:
void OnUploadProgress(uint64 position, uint64 size) override;
@@ -482,6 +484,7 @@ void WebURLLoaderImpl::Context::Start(const WebURLRequest& request,
GetRequestContextFrameTypeForWebURLRequest(request);
request_info.extra_data = request.extraData();
request_info.report_raw_headers = request.reportRawHeaders();
+ request_info.loading_task_queue = task_runner_;
scoped_refptr<ResourceRequestBody> request_body =
GetRequestBodyForWebURLRequest(request).get();
@@ -496,6 +499,11 @@ void WebURLLoaderImpl::Context::Start(const WebURLRequest& request,
request_info, request_body.get(), this);
}
+void WebURLLoaderImpl::Context::SetTaskRunner(
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
+ task_runner_ = task_runner;
+}
+
void WebURLLoaderImpl::Context::OnUploadProgress(uint64 position, uint64 size) {
if (client_)
client_->didSendData(loader_, position, size);
@@ -1059,4 +1067,11 @@ bool WebURLLoaderImpl::attachThreadedDataReceiver(
return context_->AttachThreadedDataReceiver(threaded_data_receiver);
}
+void WebURLLoaderImpl::setLoadingTaskRunner(
+ blink::WebTaskRunner* loading_task_runner) {
+ scheduler::WebTaskRunnerImpl* web_task_runner_impl =
Sami 2015/09/25 13:31:27 Is this downcast safe? I think anyone could call t
+ static_cast<scheduler::WebTaskRunnerImpl*>(loading_task_runner);
+ context_->SetTaskRunner(web_task_runner_impl->task_runner());
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698