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

Unified Diff: content/browser/webui/url_data_manager_backend.cc

Issue 2476433002: Replace URLDataSource::MessageLoopForRequestPath() with TaskRunnerForRequestPath(). (Closed)
Patch Set: rebase off local branch Created 4 years, 1 month 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/browser/webui/shared_resources_data_source.cc ('k') | content/public/browser/url_data_source.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/webui/url_data_manager_backend.cc
diff --git a/content/browser/webui/url_data_manager_backend.cc b/content/browser/webui/url_data_manager_backend.cc
index 0eb8db377808e99c3d2a3b77a11eeb67986fe341..ed54fa2850a5d453c676e0035b6f1b47eb2c26ae 100644
--- a/content/browser/webui/url_data_manager_backend.cc
+++ b/content/browser/webui/url_data_manager_backend.cc
@@ -711,9 +711,9 @@ bool URLDataManagerBackend::StartRequest(const net::URLRequest* request,
}
// Forward along the request to the data source.
- base::MessageLoop* target_message_loop =
- source->source()->MessageLoopForRequestPath(path);
- if (!target_message_loop) {
+ scoped_refptr<base::SingleThreadTaskRunner> target_runner =
+ source->source()->TaskRunnerForRequestPath(path);
+ if (!target_runner) {
job->MimeTypeAvailable(source->source()->GetMimeType(path));
// Eliminate potentially dangling pointer to avoid future use.
job = nullptr;
@@ -729,13 +729,13 @@ bool URLDataManagerBackend::StartRequest(const net::URLRequest* request,
// is guaranteed because request for mime type is placed in the
// message loop before request for data. And correspondingly their
// replies are put on the IO thread in the same order.
- target_message_loop->task_runner()->PostTask(
+ target_runner->PostTask(
FROM_HERE, base::Bind(&GetMimeTypeOnUI, base::RetainedRef(source), path,
job->AsWeakPtr()));
// The DataSource wants StartDataRequest to be called on a specific thread,
// usually the UI thread, for this path.
- target_message_loop->task_runner()->PostTask(
+ target_runner->PostTask(
FROM_HERE, base::Bind(&URLDataManagerBackend::CallStartRequest,
base::RetainedRef(source), path, child_id,
wc_getter, request_id));
« no previous file with comments | « content/browser/webui/shared_resources_data_source.cc ('k') | content/public/browser/url_data_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698