summaryrefslogtreecommitdiffstats
path: root/content/renderer
diff options
context:
space:
mode:
authorkinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-13 04:10:40 +0000
committerkinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-13 04:10:40 +0000
commit10e5cf1c02a7f30b7cd0b3ef3fef4ecb8faa75a0 (patch)
tree0bd741bb4d609f04bb8947ff5cd237a0098e01f8 /content/renderer
parent831de724f3aed4700bb20750e2434b4159f485da (diff)
downloadchromium_src-10e5cf1c02a7f30b7cd0b3ef3fef4ecb8faa75a0.zip
chromium_src-10e5cf1c02a7f30b7cd0b3ef3fef4ecb8faa75a0.tar.gz
chromium_src-10e5cf1c02a7f30b7cd0b3ef3fef4ecb8faa75a0.tar.bz2
Add IPC plumbing code for Quota API
BUG=61676 TEST=No new tests; just IPC plumbing (manually tested) Review URL: http://codereview.chromium.org/6811022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81364 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer')
-rw-r--r--content/renderer/render_view.cc36
-rw-r--r--content/renderer/render_view.h11
2 files changed, 47 insertions, 0 deletions
diff --git a/content/renderer/render_view.cc b/content/renderer/render_view.cc
index 83d6756..08cd94c 100644
--- a/content/renderer/render_view.cc
+++ b/content/renderer/render_view.cc
@@ -54,6 +54,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"
@@ -121,6 +122,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"
@@ -229,6 +231,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;
@@ -3265,6 +3270,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(
diff --git a/content/renderer/render_view.h b/content/renderer/render_view.h
index 747ac35..25cb05a 100644
--- a/content/renderer/render_view.h
+++ b/content/renderer/render_view.h
@@ -577,6 +577,17 @@ class RenderView : public RenderWidget,
bool create,
WebKit::WebFileSystemCallbacks* callbacks);
+ virtual void queryStorageUsageAndQuota(
+ WebKit::WebFrame* frame,
+ WebKit::WebStorageQuotaType type,
+ WebKit::WebStorageQuotaCallbacks* callbacks);
+
+ virtual void requestStorageQuota(
+ WebKit::WebFrame* frame,
+ WebKit::WebStorageQuotaType type,
+ unsigned long long requested_size,
+ WebKit::WebStorageQuotaCallbacks* callbacks);
+
// WebKit::WebPageSerializerClient implementation ----------------------------
virtual void didSerializeDataForFrame(const WebKit::WebURL& frame_url,