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

Unified Diff: content/child/high_priority_resource_filter.h

Issue 281073002: NOT FOR REVIEW: Adding prioritized incoming task queue to renderers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Prioritize input events Created 6 years, 7 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 | « base/message_loop/message_loop.cc ('k') | content/child/high_priority_resource_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/high_priority_resource_filter.h
diff --git a/content/child/high_priority_resource_filter.h b/content/child/high_priority_resource_filter.h
new file mode 100644
index 0000000000000000000000000000000000000000..db3d6bb986d03c8459613670581c2faa6708f3c1
--- /dev/null
+++ b/content/child/high_priority_resource_filter.h
@@ -0,0 +1,49 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_CHILD_HIGH_PRIORITY_RESOURCE_FILTER_H_
+#define CONTENT_CHILD_HIGH_PRIORITY_RESOURCE_FILTER_H_
+
+#include <set>
+
+#include "base/memory/ref_counted.h"
+#include "base/synchronization/lock.h"
+#include "ipc/message_filter.h"
+#include "webkit/common/resource_type.h"
+
+namespace base {
+class HighPriorityTaskRunner;
+}
+
+namespace content {
+class ResourceDispatcher;
+
+class HighPriorityResourceFilter : public IPC::MessageFilter {
+ public:
+ HighPriorityResourceFilter(
+ ResourceDispatcher* resource_dispatcher,
+ scoped_refptr<base::HighPriorityTaskRunner> runner);
+
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+
+ void AddPendingRequest(int request_id, ResourceType::Type resource_type);
+ void RemovePendingRequest(int request_id);
+
+ private:
+ virtual ~HighPriorityResourceFilter();
+
+ bool IsHighPriorityResourceResonse(const IPC::Message& message);
+
+ ResourceDispatcher* resource_dispatcher_;
+ scoped_refptr<base::HighPriorityTaskRunner> runner_;
+
+ std::set<int> request_ids_;
+ base::Lock request_ids_lock_;
+
+ DISALLOW_COPY_AND_ASSIGN(HighPriorityResourceFilter);
+};
+
+} // namespace content
+
+#endif // CONTENT_CHILD_HIGH_PRIORITY_RESOURCE_FILTER_H_
« no previous file with comments | « base/message_loop/message_loop.cc ('k') | content/child/high_priority_resource_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698