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

Unified Diff: content/child/resource_scheduling_filter.h

Issue 1402103002: Revert of Revert "Post loading tasks on the appropriate WebFrameScheduler's queue." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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/child/resource_dispatcher.cc ('k') | content/child/resource_scheduling_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/resource_scheduling_filter.h
diff --git a/content/child/resource_scheduling_filter.h b/content/child/resource_scheduling_filter.h
index 7ea73c90724d57e238e1950a225f3a90d1a207f4..fd24559229a0f2ea5933bc7c7083aefe39692bdb 100644
--- a/content/child/resource_scheduling_filter.h
+++ b/content/child/resource_scheduling_filter.h
@@ -5,11 +5,18 @@
#ifndef CONTENT_CHILD_RESOURCE_SCHEDULING_FILTER_H_
#define CONTENT_CHILD_RESOURCE_SCHEDULING_FILTER_H_
+#include <map>
+
#include "base/containers/hash_tables.h"
+#include "base/containers/scoped_ptr_map.h"
#include "base/memory/weak_ptr.h"
#include "base/single_thread_task_runner.h"
#include "content/common/content_export.h"
#include "ipc/message_filter.h"
+
+namespace blink {
+class WebTaskRunner;
+}
namespace content {
class ResourceDispatcher;
@@ -28,10 +35,24 @@
bool GetSupportedMessageClasses(
std::vector<uint32>* supported_message_classes) const override;
- protected:
+ // Sets the task runner associated with request messages with |id|.
+ void SetRequestIdTaskRunner(
+ int id, scoped_ptr<blink::WebTaskRunner> web_task_runner);
+
+ // Removes the task runner associated with |id|.
+ void ClearRequestIdTaskRunner(int id);
+
+ void DispatchMessage(const IPC::Message& message);
+
+ private:
~ResourceSchedulingFilter() override;
- void DispatchMessage(const IPC::Message& message);
+ typedef base::ScopedPtrMap<int, scoped_ptr<blink::WebTaskRunner>>
+ RequestIdToTaskRunnerMap;
+
+ // This lock guards |request_id_to_task_runner_map_|
+ base::Lock request_id_to_task_runner_map_lock_;
+ RequestIdToTaskRunnerMap request_id_to_task_runner_map_;
scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
ResourceDispatcher* resource_dispatcher_; // NOT OWNED
« no previous file with comments | « content/child/resource_dispatcher.cc ('k') | content/child/resource_scheduling_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698