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

Unified Diff: content/browser/loader/resource_message_filter.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
« no previous file with comments | « content/browser/loader/resource_loader.cc ('k') | content/browser/loader/resource_message_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/loader/resource_message_filter.h
diff --git a/content/browser/loader/resource_message_filter.h b/content/browser/loader/resource_message_filter.h
index 45c4e2b74b90fe0d5bec4cb23dc0e1e568a1fcca..da440131a26d3d5176345e7de29b6d73139de7f9 100644
--- a/content/browser/loader/resource_message_filter.h
+++ b/content/browser/loader/resource_message_filter.h
@@ -12,11 +12,11 @@
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/sequenced_task_runner_helpers.h"
+#include "base/single_thread_task_runner.h"
#include "content/common/content_export.h"
#include "content/common/url_loader_factory.mojom.h"
#include "content/public/browser/browser_associated_interface.h"
#include "content/public/browser/browser_message_filter.h"
-#include "content/public/browser/browser_thread.h"
#include "content/public/common/resource_type.h"
namespace storage {
@@ -53,12 +53,14 @@ class CONTENT_EXPORT ResourceMessageFilter
// |service_worker_context| may be nullptr in unittests.
// InitializeForTest() needs to be manually called for unittests where
// OnFilterAdded() would not otherwise be called.
- ResourceMessageFilter(int child_id,
- ChromeAppCacheService* appcache_service,
- ChromeBlobStorageContext* blob_storage_context,
- storage::FileSystemContext* file_system_context,
- ServiceWorkerContextWrapper* service_worker_context,
- const GetContextsCallback& get_contexts_callback);
+ ResourceMessageFilter(
+ int child_id,
+ ChromeAppCacheService* appcache_service,
+ ChromeBlobStorageContext* blob_storage_context,
+ storage::FileSystemContext* file_system_context,
+ ServiceWorkerContextWrapper* service_worker_context,
+ const GetContextsCallback& get_contexts_callback,
+ const scoped_refptr<base::SingleThreadTaskRunner>& io_thread_runner);
// BrowserMessageFilter implementation.
void OnFilterAdded(IPC::Channel* channel) override;
@@ -89,7 +91,6 @@ class CONTENT_EXPORT ResourceMessageFilter
~ResourceMessageFilter() override;
private:
- friend struct BrowserThread::DeleteOnThread<BrowserThread::IO>;
friend class base::DeleteHelper<ResourceMessageFilter>;
// Initializes the weak pointer of this filter in |requester_info_|.
@@ -98,6 +99,9 @@ class CONTENT_EXPORT ResourceMessageFilter
bool is_channel_closed_;
scoped_refptr<ResourceRequesterInfo> requester_info_;
+ // Task runner for the IO thead.
+ scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner_;
+
// This must come last to make sure weak pointers are invalidated first.
base::WeakPtrFactory<ResourceMessageFilter> weak_ptr_factory_;
« no previous file with comments | « content/browser/loader/resource_loader.cc ('k') | content/browser/loader/resource_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698