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

Unified Diff: content/browser/loader/resource_dispatcher_host_impl.h

Issue 2785523002: Reduce/remove usage of BrowserThread in content/browser/loader. (Closed)
Patch Set: Remove DCHECK Created 3 years, 9 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/browser/loader/resource_dispatcher_host_impl.h
diff --git a/content/browser/loader/resource_dispatcher_host_impl.h b/content/browser/loader/resource_dispatcher_host_impl.h
index f039aa13b1b9dc2e80ffd954a75f47e48951749c..cbb6e1192c2271b20a46aea416577db395be41d8 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.h
+++ b/content/browser/loader/resource_dispatcher_host_impl.h
@@ -24,6 +24,7 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/observer_list.h"
+#include "base/single_thread_task_runner.h"
#include "base/time/time.h"
#include "content/browser/loader/global_routing_id.h"
#include "content/browser/loader/resource_loader_delegate.h"
@@ -91,7 +92,8 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl
// Work on moving creation of download handlers out of
// ResourceDispatcherHostImpl.
ResourceDispatcherHostImpl(
- CreateDownloadHandlerIntercept download_handler_intercept);
+ CreateDownloadHandlerIntercept download_handler_intercept,
+ const scoped_refptr<base::SingleThreadTaskRunner>& io_thread_runner);
ResourceDispatcherHostImpl();
~ResourceDispatcherHostImpl() override;
@@ -328,6 +330,14 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl
// methods in this file, which also tear down the loader.
void CancelRequestFromRenderer(GlobalRequestID request_id);
+ scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner() const {
+ return io_thread_task_runner_;
+ }
+
+ scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner() const {
+ return main_thread_task_runner_;
+ }
+
private:
friend class ResourceDispatcherHostTest;
@@ -757,6 +767,12 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl
// Points to the registered download handler intercept.
CreateDownloadHandlerIntercept create_download_handler_intercept_;
+ // Task runner for the main thread.
+ scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
+
+ // Task runner for the IO thead.
+ scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner_;
+
DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostImpl);
};
« no previous file with comments | « content/browser/loader/async_resource_handler_unittest.cc ('k') | content/browser/loader/resource_dispatcher_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698