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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/child/resource_scheduling_filter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_CHILD_RESOURCE_SCHEDULING_FILTER_H_
6 #define CONTENT_CHILD_RESOURCE_SCHEDULING_FILTER_H_
7
8 #include "base/containers/hash_tables.h"
9 #include "base/memory/weak_ptr.h"
10 #include "base/single_thread_task_runner.h"
11 #include "content/common/content_export.h"
12 #include "ipc/message_filter.h"
13
14 namespace content {
15 class ResourceDispatcher;
16
17 // This filter is used to dispatch resource messages on a specific
18 // SingleThreadTaskRunner to facilitate task scheduling.
19 class CONTENT_EXPORT ResourceSchedulingFilter : public IPC::MessageFilter {
20 public:
21 ResourceSchedulingFilter(const scoped_refptr<base::SingleThreadTaskRunner>&
22 main_thread_task_runner,
23 ResourceDispatcher* resource_dispatcher);
24
25 virtual bool OnMessageReceived(const IPC::Message& message) override;
26
27 virtual bool GetSupportedMessageClasses(
28 std::vector<uint32>* supported_message_classes) const override;
29
30 protected:
31 virtual ~ResourceSchedulingFilter();
32
33 void DispatchMessage(const IPC::Message& message);
34
35 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
36 ResourceDispatcher* resource_dispatcher_; // NOT OWNED
37 base::WeakPtrFactory<ResourceSchedulingFilter> weak_ptr_factory_;
38 };
39
40 } // namespace content
41
42 #endif // CONTENT_CHILD_RESOURCE_SCHEDULING_FILTER_H_
OLDNEW
« 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