| Index: content/renderer/render_view.cc
|
| diff --git a/content/renderer/render_view.cc b/content/renderer/render_view.cc
|
| index e8a391d03a0ea0000f09cb3c31329cf7f6fe6614..9d08d22610e607108e8d7350fafaddfb08b28c2c 100644
|
| --- a/content/renderer/render_view.cc
|
| +++ b/content/renderer/render_view.cc
|
| @@ -56,6 +56,7 @@
|
| #include "content/common/file_system/webfilesystem_callback_dispatcher.h"
|
| #include "content/common/notification_service.h"
|
| #include "content/common/pepper_messages.h"
|
| +#include "content/common/quota_dispatcher.h"
|
| #include "content/common/renderer_preferences.h"
|
| #include "content/common/view_messages.h"
|
| #include "content/renderer/audio_message_filter.h"
|
| @@ -126,6 +127,7 @@
|
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebSettings.h"
|
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebSize.h"
|
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageNamespace.h"
|
| +#include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageQuotaCallbacks.h"
|
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h"
|
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h"
|
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLError.h"
|
| @@ -236,6 +238,9 @@ using WebKit::WebSettings;
|
| using WebKit::WebSharedWorker;
|
| using WebKit::WebSize;
|
| using WebKit::WebStorageNamespace;
|
| +using WebKit::WebStorageQuotaCallbacks;
|
| +using WebKit::WebStorageQuotaError;
|
| +using WebKit::WebStorageQuotaType;
|
| using WebKit::WebString;
|
| using WebKit::WebTextAffinity;
|
| using WebKit::WebTextDirection;
|
| @@ -3503,6 +3508,37 @@ void RenderView::openFileSystem(
|
| size, create, new WebFileSystemCallbackDispatcher(callbacks));
|
| }
|
|
|
| +void RenderView::queryStorageUsageAndQuota(
|
| + WebFrame* frame,
|
| + WebStorageQuotaType type,
|
| + WebStorageQuotaCallbacks* callbacks) {
|
| + DCHECK(frame);
|
| + WebSecurityOrigin origin = frame->securityOrigin();
|
| + if (origin.isEmpty()) {
|
| + // Uninitialized document?
|
| + callbacks->didFail(WebKit::WebStorageQuotaErrorAbort);
|
| + return;
|
| + }
|
| + ChildThread::current()->quota_dispatcher()->QueryStorageUsageAndQuota(
|
| + GURL(origin.toString()), type, callbacks);
|
| +}
|
| +
|
| +void RenderView::requestStorageQuota(
|
| + WebFrame* frame,
|
| + WebStorageQuotaType type,
|
| + unsigned long long requested_size,
|
| + WebStorageQuotaCallbacks* callbacks) {
|
| + DCHECK(frame);
|
| + WebSecurityOrigin origin = frame->securityOrigin();
|
| + if (origin.isEmpty()) {
|
| + // Uninitialized document?
|
| + callbacks->didFail(WebKit::WebStorageQuotaErrorAbort);
|
| + return;
|
| + }
|
| + ChildThread::current()->quota_dispatcher()->RequestStorageQuota(
|
| + GURL(origin.toString()), type, requested_size, callbacks);
|
| +}
|
| +
|
| // webkit_glue::WebPluginPageDelegate -----------------------------------------
|
|
|
| webkit::npapi::WebPluginDelegate* RenderView::CreatePluginDelegate(
|
|
|