Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1661)

Unified Diff: content/renderer/render_view.cc

Issue 6811022: Add IPC plumbing code for Quota API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments reflected Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_view.h ('k') | ipc/ipc_message_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view.cc
diff --git a/content/renderer/render_view.cc b/content/renderer/render_view.cc
index c916155854ccd8c03d80939b3cc9d1bfb5f72c7b..123a053522a6922aea7d5c223adf1ec397a2e333 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"
@@ -125,6 +126,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"
@@ -235,6 +237,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;
@@ -3552,6 +3557,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(
« no previous file with comments | « content/renderer/render_view.h ('k') | ipc/ipc_message_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698