| Index: content/common/quota_dispatcher.cc
|
| diff --git a/content/common/quota_dispatcher.cc b/content/common/quota_dispatcher.cc
|
| index 905edc7897afdf218ffd763e0d50fe213071ccf8..9ab5f43b811522dcba5bdf88caaaea170fbca36a 100644
|
| --- a/content/common/quota_dispatcher.cc
|
| +++ b/content/common/quota_dispatcher.cc
|
| @@ -7,19 +7,18 @@
|
| #include "content/common/child_thread.h"
|
| #include "content/common/quota_messages.h"
|
| #include "googleurl/src/gurl.h"
|
| -#include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageQuotaCallbacks.h"
|
|
|
| -using WebKit::WebStorageQuotaCallbacks;
|
| -using WebKit::WebStorageQuotaError;
|
| -using WebKit::WebStorageQuotaType;
|
| +using quota::QuotaClient;
|
| +using quota::QuotaStatusCode;
|
| +using quota::StorageType;
|
|
|
| QuotaDispatcher::QuotaDispatcher() {
|
| }
|
|
|
| QuotaDispatcher::~QuotaDispatcher() {
|
| - IDMap<WebStorageQuotaCallbacks>::iterator iter(&pending_quota_callbacks_);
|
| + IDMap<Callback, IDMapOwnPointer>::iterator iter(&pending_quota_callbacks_);
|
| while (!iter.IsAtEnd()) {
|
| - iter.GetCurrentValue()->didFail(WebKit::WebStorageQuotaErrorAbort);
|
| + iter.GetCurrentValue()->DidFail(quota::kQuotaErrorAbort);
|
| iter.Advance();
|
| }
|
| }
|
| @@ -39,10 +38,10 @@ bool QuotaDispatcher::OnMessageReceived(const IPC::Message& msg) {
|
|
|
| void QuotaDispatcher::QueryStorageUsageAndQuota(
|
| const GURL& origin_url,
|
| - WebStorageQuotaType type,
|
| - WebStorageQuotaCallbacks* callbacks) {
|
| - DCHECK(callbacks);
|
| - int request_id = pending_quota_callbacks_.Add(callbacks);
|
| + StorageType type,
|
| + Callback* callback) {
|
| + DCHECK(callback);
|
| + int request_id = pending_quota_callbacks_.Add(callback);
|
| ChildThread::current()->Send(new QuotaHostMsg_QueryStorageUsageAndQuota(
|
| request_id, origin_url, type));
|
| }
|
| @@ -50,22 +49,28 @@ void QuotaDispatcher::QueryStorageUsageAndQuota(
|
| void QuotaDispatcher::RequestStorageQuota(
|
| int render_view_id,
|
| const GURL& origin_url,
|
| - WebStorageQuotaType type,
|
| - unsigned long long requested_size,
|
| - WebStorageQuotaCallbacks* callbacks) {
|
| - DCHECK(callbacks);
|
| - int request_id = pending_quota_callbacks_.Add(callbacks);
|
| + StorageType type,
|
| + int64 requested_size,
|
| + Callback* callback) {
|
| + DCHECK(callback);
|
| + int request_id = pending_quota_callbacks_.Add(callback);
|
| ChildThread::current()->Send(new QuotaHostMsg_RequestStorageQuota(
|
| render_view_id, request_id, origin_url, type, requested_size));
|
| }
|
|
|
| +void QuotaDispatcher::NotifyStorageModified(
|
| + QuotaClient::ID client_id, const GURL& origin_url,
|
| + StorageType type, int64 delta) {
|
| + ChildThread::current()->Send(new QuotaHostMsg_NotifyStorageModified(
|
| + client_id, origin_url, type, delta));
|
| +}
|
| +
|
| void QuotaDispatcher::DidGrantStorageQuota(
|
| int request_id,
|
| int64 granted_quota) {
|
| - WebStorageQuotaCallbacks* callbacks = pending_quota_callbacks_.Lookup(
|
| - request_id);
|
| - DCHECK(callbacks);
|
| - callbacks->didGrantStorageQuota(granted_quota);
|
| + Callback* callback = pending_quota_callbacks_.Lookup(request_id);
|
| + DCHECK(callback);
|
| + callback->DidGrantStorageQuota(granted_quota);
|
| pending_quota_callbacks_.Remove(request_id);
|
| }
|
|
|
| @@ -73,19 +78,17 @@ void QuotaDispatcher::DidQueryStorageUsageAndQuota(
|
| int request_id,
|
| int64 current_usage,
|
| int64 current_quota) {
|
| - WebStorageQuotaCallbacks* callbacks = pending_quota_callbacks_.Lookup(
|
| - request_id);
|
| - DCHECK(callbacks);
|
| - callbacks->didQueryStorageUsageAndQuota(current_usage, current_quota);
|
| + Callback* callback = pending_quota_callbacks_.Lookup(request_id);
|
| + DCHECK(callback);
|
| + callback->DidQueryStorageUsageAndQuota(current_usage, current_quota);
|
| pending_quota_callbacks_.Remove(request_id);
|
| }
|
|
|
| void QuotaDispatcher::DidFail(
|
| int request_id,
|
| - WebStorageQuotaError error) {
|
| - WebStorageQuotaCallbacks* callbacks = pending_quota_callbacks_.Lookup(
|
| - request_id);
|
| - DCHECK(callbacks);
|
| - callbacks->didFail(error);
|
| + QuotaStatusCode error) {
|
| + Callback* callback = pending_quota_callbacks_.Lookup(request_id);
|
| + DCHECK(callback);
|
| + callback->DidFail(error);
|
| pending_quota_callbacks_.Remove(request_id);
|
| }
|
|
|