Index: content/common/quota_dispatcher.h |
diff --git a/content/common/quota_dispatcher.h b/content/common/quota_dispatcher.h |
index 06b456ed74d395d4da14c4dee681c25cb3a216cd..439eab6a18f336c8a96164849062395762bd42ca 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_types.h" |
class GURL; |
@@ -29,6 +28,13 @@ class WebStorageQuotaCallbacks; |
// 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 +42,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); |
+ |
+ // Creates a new Callback instance for WebStorageQuotaCallbacks. |
+ static Callback* CreateWebStorageQuotaCallbacksWrapper( |
+ WebKit::WebStorageQuotaCallbacks* callbacks); |
private: |
// Message handlers. |
@@ -51,10 +61,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); |
}; |