OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 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_COMMON_QUOTA_DISPATCHER_H_ | |
6 #define CONTENT_COMMON_QUOTA_DISPATCHER_H_ | |
7 | |
8 #include <map> | |
9 #include <set> | |
10 | |
11 #include "base/basictypes.h" | |
12 #include "base/id_map.h" | |
13 #include "ipc/ipc_channel.h" | |
14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageQuotaError. h" | |
15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageQuotaType.h " | |
ericu
2011/04/08 03:31:18
Huh. I've not previously hit this problem. I don
kinuko
2011/04/08 09:02:53
I've seen this happening in several files, like in
| |
16 | |
17 class GURL; | |
18 | |
19 namespace IPC { | |
20 class Message; | |
21 } | |
22 | |
23 namespace WebKit { | |
24 class WebStorageQuotaCallbacks; | |
25 } | |
26 | |
27 // Dispatches and sends quota related messages sent to/from a child | |
28 // process from/to the main browser process. There is one instance | |
29 // per child process. Messages are dispatched on the main child thread. | |
30 class QuotaDispatcher : public IPC::Channel::Listener { | |
31 public: | |
32 QuotaDispatcher(); | |
33 ~QuotaDispatcher(); | |
34 | |
35 // IPC::Channel::Listener implementation. | |
36 virtual bool OnMessageReceived(const IPC::Message& msg); | |
37 | |
38 void QueryStorageUsageAndQuota(const GURL& gurl, | |
39 WebKit::WebStorageQuotaType type, | |
40 WebKit::WebStorageQuotaCallbacks* callbacks); | |
41 void RequestStorageQuota(const GURL& gurl, | |
42 WebKit::WebStorageQuotaType type, | |
43 unsigned long long requested_size, | |
44 WebKit::WebStorageQuotaCallbacks* callbacks); | |
45 | |
46 private: | |
47 // Message handlers. | |
48 void DidHandleRequestStorageQuota(int request_id, | |
49 WebKit::WebStorageQuotaError error, | |
50 int64 granted_quota); | |
51 void DidHandleUsageAndQuotaQuery(int request_id, | |
52 WebKit::WebStorageQuotaError error, | |
53 int64 current_usage, | |
54 int64 current_quota); | |
55 | |
56 struct PendingQuotaCallbacks; | |
57 IDMap<PendingQuotaCallbacks, IDMapOwnPointer> pending_quota_callbacks_; | |
58 | |
59 DISALLOW_COPY_AND_ASSIGN(QuotaDispatcher); | |
60 }; | |
61 | |
62 #endif // CONTENT_COMMON_QUOTA_DISPATCHER_H_ | |
OLD | NEW |