Skip to content

Commit

Permalink
Implement WebKit::Platform::queryStorageUsageAndQuota
Browse files Browse the repository at this point in the history
We used to have the same method on RenderViewImpl (WebFrameClient),
but are moving the impl to platform layer.

(Corresponding Blink API change is:
https://src.chromium.org/viewvc/blink?revision=154473&view=revision)

BUG=259660
TEST=no behavioral change
NOTRY=true

Review URL: https://chromiumcodereview.appspot.com/19592004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@213043 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
kinuko@chromium.org committed Jul 23, 2013
1 parent 68c550c commit b469e8b
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
14 changes: 14 additions & 0 deletions content/renderer/renderer_webkitplatformsupport_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "content/child/fileapi/webfilesystem_impl.h"
#include "content/child/indexed_db/proxy_webidbfactory_impl.h"
#include "content/child/npapi/npobject_util.h"
#include "content/child/quota_dispatcher.h"
#include "content/child/thread_safe_sender.h"
#include "content/child/webblobregistry_impl.h"
#include "content/child/webmessageportchannel_impl.h"
Expand Down Expand Up @@ -65,6 +66,7 @@
#include "third_party/WebKit/public/web/WebRuntimeFeatures.h"
#include "url/gurl.h"
#include "webkit/common/gpu/webgraphicscontext3d_provider_impl.h"
#include "webkit/common/quota/quota_types.h"
#include "webkit/glue/simple_webmimeregistry_impl.h"
#include "webkit/glue/webfileutilities_impl.h"
#include "webkit/glue/webkit_glue.h"
Expand Down Expand Up @@ -1154,4 +1156,16 @@ void RendererWebKitPlatformSupportImpl::cancelVibration() {
}
#endif // defined(OS_ANDROID)

//------------------------------------------------------------------------------

void RendererWebKitPlatformSupportImpl::queryStorageUsageAndQuota(
const WebKit::WebURL& storage_partition,
WebKit::WebStorageQuotaType type,
WebKit::WebStorageQuotaCallbacks* callbacks) {
ChildThread::current()->quota_dispatcher()->QueryStorageUsageAndQuota(
storage_partition,
static_cast<quota::StorageType>(type),
QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks));
}

} // namespace content
4 changes: 4 additions & 0 deletions content/renderer/renderer_webkitplatformsupport_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ class CONTENT_EXPORT RendererWebKitPlatformSupportImpl
virtual void setDeviceMotionListener(
WebKit::WebDeviceMotionListener* listener) OVERRIDE;
virtual WebKit::WebCrypto* crypto() OVERRIDE;
virtual void queryStorageUsageAndQuota(
const WebKit::WebURL& storage_partition,
WebKit::WebStorageQuotaType,
WebKit::WebStorageQuotaCallbacks*) OVERRIDE;

#if defined(OS_ANDROID)
virtual void vibrate(unsigned int milliseconds);
Expand Down
12 changes: 12 additions & 0 deletions content/worker/worker_webkitplatformsupport_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "content/child/database_util.h"
#include "content/child/fileapi/webfilesystem_impl.h"
#include "content/child/indexed_db/proxy_webidbfactory_impl.h"
#include "content/child/quota_dispatcher.h"
#include "content/child/thread_safe_sender.h"
#include "content/child/webblobregistry_impl.h"
#include "content/child/webmessageportchannel_impl.h"
Expand All @@ -24,6 +25,7 @@
#include "third_party/WebKit/public/platform/WebFileInfo.h"
#include "third_party/WebKit/public/platform/WebString.h"
#include "third_party/WebKit/public/platform/WebURL.h"
#include "webkit/common/quota/quota_types.h"
#include "webkit/glue/webfileutilities_impl.h"
#include "webkit/glue/webkit_glue.h"

Expand Down Expand Up @@ -296,4 +298,14 @@ WebBlobRegistry* WorkerWebKitPlatformSupportImpl::blobRegistry() {
return blob_registry_.get();
}

void WorkerWebKitPlatformSupportImpl::queryStorageUsageAndQuota(
const WebKit::WebURL& storage_partition,
WebKit::WebStorageQuotaType type,
WebKit::WebStorageQuotaCallbacks* callbacks) {
ChildThread::current()->quota_dispatcher()->QueryStorageUsageAndQuota(
storage_partition,
static_cast<quota::StorageType>(type),
QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks));
}

} // namespace content
4 changes: 4 additions & 0 deletions content/worker/worker_webkitplatformsupport_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ class WorkerWebKitPlatformSupportImpl : public WebKitPlatformSupportImpl,
virtual WebKit::WebString mimeTypeFromFile(const WebKit::WebString&);
virtual WebKit::WebString preferredExtensionForMIMEType(
const WebKit::WebString&);
virtual void queryStorageUsageAndQuota(
const WebKit::WebURL& storage_partition,
WebKit::WebStorageQuotaType,
WebKit::WebStorageQuotaCallbacks*) OVERRIDE;

private:

Expand Down

0 comments on commit b469e8b

Please sign in to comment.