| Index: content/common/quota_dispatcher.h
|
| diff --git a/content/common/quota_dispatcher.h b/content/common/quota_dispatcher.h
|
| index 06b456ed74d395d4da14c4dee681c25cb3a216cd..e10aa1860f3699c47eec0c02fea84c9b2f0164c0 100644
|
| --- a/content/common/quota_dispatcher.h
|
| +++ b/content/common/quota_dispatcher.h
|
| @@ -11,8 +11,7 @@
|
| #include "base/basictypes.h"
|
| #include "base/id_map.h"
|
| #include "ipc/ipc_channel.h"
|
| -#include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageQuotaError.h"
|
| -#include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageQuotaType.h"
|
| +#include "webkit/quota/quota_client.h"
|
|
|
| class GURL;
|
|
|
| @@ -20,15 +19,18 @@ namespace IPC {
|
| class Message;
|
| }
|
|
|
| -namespace WebKit {
|
| -class WebStorageQuotaCallbacks;
|
| -}
|
| -
|
| // Dispatches and sends quota related messages sent to/from a child
|
| // process from/to the main browser process. There is one instance
|
| // per child process. Messages are dispatched on the main child thread.
|
| class QuotaDispatcher : public IPC::Channel::Listener {
|
| public:
|
| + class Callback {
|
| + public:
|
| + virtual void DidQueryStorageUsageAndQuota(int64 usage, int64 quota) = 0;
|
| + virtual void DidGrantStorageQuota(int64 granted_quota) = 0;
|
| + virtual void DidFail(quota::QuotaStatusCode status) = 0;
|
| + };
|
| +
|
| QuotaDispatcher();
|
| virtual ~QuotaDispatcher();
|
|
|
| @@ -36,13 +38,17 @@ class QuotaDispatcher : public IPC::Channel::Listener {
|
| virtual bool OnMessageReceived(const IPC::Message& msg);
|
|
|
| void QueryStorageUsageAndQuota(const GURL& gurl,
|
| - WebKit::WebStorageQuotaType type,
|
| - WebKit::WebStorageQuotaCallbacks* callbacks);
|
| + quota::StorageType type,
|
| + Callback* callback);
|
| void RequestStorageQuota(int render_view_id,
|
| const GURL& gurl,
|
| - WebKit::WebStorageQuotaType type,
|
| - unsigned long long requested_size,
|
| - WebKit::WebStorageQuotaCallbacks* callbacks);
|
| + quota::StorageType type,
|
| + int64 requested_size,
|
| + Callback* callback);
|
| + void NotifyStorageModified(quota::QuotaClient::ID client_id,
|
| + const GURL& origin,
|
| + quota::StorageType type,
|
| + int64 delta);
|
|
|
| private:
|
| // Message handlers.
|
| @@ -51,10 +57,9 @@ class QuotaDispatcher : public IPC::Channel::Listener {
|
| int64 current_quota);
|
| void DidGrantStorageQuota(int request_id,
|
| int64 granted_quota);
|
| - void DidFail(int request_id,
|
| - WebKit::WebStorageQuotaError error);
|
| + void DidFail(int request_id, quota::QuotaStatusCode error);
|
|
|
| - IDMap<WebKit::WebStorageQuotaCallbacks> pending_quota_callbacks_;
|
| + IDMap<Callback, IDMapOwnPointer> pending_quota_callbacks_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(QuotaDispatcher);
|
| };
|
|
|