OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_COMMON_QUOTA_DISPATCHER_H_ | 5 #ifndef CONTENT_COMMON_QUOTA_DISPATCHER_H_ |
6 #define CONTENT_COMMON_QUOTA_DISPATCHER_H_ | 6 #define CONTENT_COMMON_QUOTA_DISPATCHER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/id_map.h" | 12 #include "base/id_map.h" |
13 #include "ipc/ipc_listener.h" | 13 #include "ipc/ipc_listener.h" |
14 #include "webkit/quota/quota_types.h" | 14 #include "webkit/quota/quota_types.h" |
15 | 15 |
16 class GURL; | 16 class GURL; |
17 | 17 |
18 namespace IPC { | 18 namespace IPC { |
19 class Message; | 19 class Message; |
20 } | 20 } |
21 | 21 |
22 namespace WebKit { | 22 namespace WebKit { |
23 class WebStorageQuotaCallbacks; | 23 class WebStorageQuotaCallbacks; |
24 } | 24 } |
25 | 25 |
| 26 namespace content { |
| 27 |
26 // Dispatches and sends quota related messages sent to/from a child | 28 // Dispatches and sends quota related messages sent to/from a child |
27 // process from/to the main browser process. There is one instance | 29 // process from/to the main browser process. There is one instance |
28 // per child process. Messages are dispatched on the main child thread. | 30 // per child process. Messages are dispatched on the main child thread. |
29 class QuotaDispatcher : public IPC::Listener { | 31 class QuotaDispatcher : public IPC::Listener { |
30 public: | 32 public: |
31 class Callback { | 33 class Callback { |
32 public: | 34 public: |
33 virtual ~Callback() {} | 35 virtual ~Callback() {} |
34 virtual void DidQueryStorageUsageAndQuota(int64 usage, int64 quota) = 0; | 36 virtual void DidQueryStorageUsageAndQuota(int64 usage, int64 quota) = 0; |
35 virtual void DidGrantStorageQuota(int64 granted_quota) = 0; | 37 virtual void DidGrantStorageQuota(int64 granted_quota) = 0; |
(...skipping 26 matching lines...) Expand all Loading... |
62 int64 current_quota); | 64 int64 current_quota); |
63 void DidGrantStorageQuota(int request_id, | 65 void DidGrantStorageQuota(int request_id, |
64 int64 granted_quota); | 66 int64 granted_quota); |
65 void DidFail(int request_id, quota::QuotaStatusCode error); | 67 void DidFail(int request_id, quota::QuotaStatusCode error); |
66 | 68 |
67 IDMap<Callback, IDMapOwnPointer> pending_quota_callbacks_; | 69 IDMap<Callback, IDMapOwnPointer> pending_quota_callbacks_; |
68 | 70 |
69 DISALLOW_COPY_AND_ASSIGN(QuotaDispatcher); | 71 DISALLOW_COPY_AND_ASSIGN(QuotaDispatcher); |
70 }; | 72 }; |
71 | 73 |
| 74 } // namespace content |
| 75 |
72 #endif // CONTENT_COMMON_QUOTA_DISPATCHER_H_ | 76 #endif // CONTENT_COMMON_QUOTA_DISPATCHER_H_ |
OLD | NEW |