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

Side by Side Diff: content/child/quota_message_filter.h

Issue 20015002: Make Platform::queryStorageUsageAndQuota work from worker threads (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « content/child/quota_dispatcher.cc ('k') | content/child/quota_message_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 2013 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_QUOTA_MESSAGE_FILTER_H_
6 #define CONTENT_CHILD_QUOTA_MESSAGE_FILTER_H_
7
8 #include <map>
9
10 #include "base/synchronization/lock.h"
11 #include "ipc/ipc_channel_proxy.h"
12
13 namespace base {
14 class MessageLoopProxy;
15 }
16
17 namespace content {
18
19 class ThreadSafeSender;
20
21 class QuotaMessageFilter : public IPC::ChannelProxy::MessageFilter {
22 public:
23 explicit QuotaMessageFilter(ThreadSafeSender* thread_safe_sender);
24
25 // IPC::Listener implementation.
26 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
27
28 // Registers { request_id, thread_id } map to the message filter.
29 // This method can be called on any thread.
30 void RegisterRequestID(int request_id, int thread_id);
31
32 protected:
33 virtual ~QuotaMessageFilter();
34
35 private:
36 typedef std::map<int, int> RequestIdToThreadId;
37
38 void DispatchMessage(const IPC::Message& msg);
39
40 scoped_refptr<base::MessageLoopProxy> main_thread_loop_proxy_;
41 scoped_refptr<ThreadSafeSender> thread_safe_sender_;
42
43 base::Lock request_id_map_lock_;
44 RequestIdToThreadId request_id_map_;
45
46 DISALLOW_COPY_AND_ASSIGN(QuotaMessageFilter);
47 };
48
49 } // namespace content
50
51 #endif // CONTENT_CHILD_QUOTA_MESSAGE_FILTER_H_
OLDNEW
« no previous file with comments | « content/child/quota_dispatcher.cc ('k') | content/child/quota_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698