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

Unified Diff: content/child/resource_scheduling_filter.h

Issue 648403004: Schedule ResourceDispatch messages via a Filter Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: It should compile now Created 6 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 | « no previous file | 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
new file mode 100644
index 0000000000000000000000000000000000000000..c2bc825f401c9fd7d3e6ec2407b67629317895f9
--- /dev/null
+++ b/content/child/resource_scheduling_filter.h
@@ -0,0 +1,42 @@
+// Copyright (c) 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_RESOURCE_SCHEDULING_FILTER_H_
+#define CONTENT_CHILD_RESOURCE_SCHEDULING_FILTER_H_
+
+#include "base/containers/hash_tables.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 content {
+class ResourceDispatcher;
+
+// This filter is used to dispatch resource messages on a specific
+// SingleThreadTaskRunner to facilitate task scheduling.
+class CONTENT_EXPORT ResourceSchedulingFilter : public IPC::MessageFilter {
+ public:
+ ResourceSchedulingFilter(const scoped_refptr<base::SingleThreadTaskRunner>&
+ main_thread_task_runner,
+ ResourceDispatcher* resource_dispatcher);
+
+ virtual bool OnMessageReceived(const IPC::Message& message) override;
+
+ virtual bool GetSupportedMessageClasses(
+ std::vector<uint32>* supported_message_classes) const override;
+
+ protected:
+ virtual ~ResourceSchedulingFilter();
+
+ void DispatchMessage(const IPC::Message& message);
+
+ scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
+ ResourceDispatcher* resource_dispatcher_; // NOT OWNED
+ base::WeakPtrFactory<ResourceSchedulingFilter> weak_ptr_factory_;
+};
+
+} // namespace content
+
+#endif // CONTENT_CHILD_RESOURCE_SCHEDULING_FILTER_H_
« no previous file with comments | « no previous file | content/child/resource_scheduling_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698