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..d5ed0a19439ee79a36a05b6cb517d8efa99056cc 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,15 @@ 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>& main_thread_runner, |
+ const scoped_refptr<base::SingleThreadTaskRunner>& io_thread_runner); |
// BrowserMessageFilter implementation. |
void OnFilterAdded(IPC::Channel* channel) override; |
@@ -89,7 +92,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 +100,12 @@ class CONTENT_EXPORT ResourceMessageFilter |
bool is_channel_closed_; |
scoped_refptr<ResourceRequesterInfo> requester_info_; |
+ // 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_; |
+ |
// This must come last to make sure weak pointers are invalidated first. |
base::WeakPtrFactory<ResourceMessageFilter> weak_ptr_factory_; |