Commit 8f74be2d authored by kinuko@chromium.org's avatar kinuko@chromium.org

2011-04-07 Kinuko Yasuda <kinuko@chromium.org>

        Reviewed by Darin Fisher.

        [Chromium] Add WebKit API to query and request unified offline-storage quota
        https://bugs.webkit.org/show_bug.cgi?id=57849
        Just adding the API, this does not do anything yet.

        The API is based on the public discussion for unified quota API:
        http://lists.w3.org/Archives/Public/public-webapps/2011JanMar/0346.html
        (The detail is not yet fully specified and might be subject to change.)

        * public/WebFrameClient.h:
        (WebKit::WebFrameClient::queryStorageUsageAndQuota): Added.
        (WebKit::WebFrameClient::requestStorageQuota): Added.
        * public/WebStorageQuotaCallbacks.h: Added.
        (WebKit::WebStorageQuotaCallbacks::~WebStorageQuotaCallbacks):
        * public/WebStorageQuotaType.h: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@83258 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 67d4cd87
2011-04-07 Kinuko Yasuda <kinuko@chromium.org>
Reviewed by Darin Fisher.
[Chromium] Add WebKit API to query and request unified offline-storage quota
https://bugs.webkit.org/show_bug.cgi?id=57849
Just adding the API, this does not do anything yet.
The API is based on the public discussion for unified quota API:
http://lists.w3.org/Archives/Public/public-webapps/2011JanMar/0346.html
(The detail is not yet fully specified and might be subject to change.)
* public/WebFrameClient.h:
(WebKit::WebFrameClient::queryStorageUsageAndQuota): Added.
(WebKit::WebFrameClient::requestStorageQuota): Added.
* public/WebStorageQuotaCallbacks.h: Added.
(WebKit::WebStorageQuotaCallbacks::~WebStorageQuotaCallbacks):
* public/WebStorageQuotaType.h: Added.
2011-04-07 Dominic Cooney <dominicc@google.com>
Reviewed by Dimitri Glazkov.
......
......@@ -266,6 +266,8 @@
'public/WebSpeechInputResult.h',
'public/WebStorageArea.h',
'public/WebStorageEventDispatcher.h',
'public/WebStorageQuotaCallbacks.h',
'public/WebStorageQuotaType.h',
'public/WebStorageNamespace.h',
'public/WebString.h',
'public/WebTextAffinity.h',
......
/*
* Copyright (C) 2010 Google Inc. All rights reserved.
* Copyright (C) 2011 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
......@@ -35,6 +35,7 @@
#include "WebFileSystem.h"
#include "WebNavigationPolicy.h"
#include "WebNavigationType.h"
#include "WebStorageQuotaType.h"
#include "WebURLError.h"
namespace WebKit {
......@@ -51,6 +52,7 @@ class WebNode;
class WebPlugin;
class WebSecurityOrigin;
class WebSharedWorker;
class WebStorageQuotaCallbacks;
class WebString;
class WebURL;
class WebURLRequest;
......@@ -362,6 +364,33 @@ public:
WebFrame*, WebFileSystem::Type, long long size,
bool create, WebFileSystemCallbacks*) { }
// Quota ---------------------------------------------------------
// Queries the origin's storage usage and quota information.
// WebStorageQuotaCallbacks::didQueryStorageUsageAndQuota will be called
// with the current usage and quota information for the origin. When
// an error occurs WebStorageQuotaCallbacks::didFail is called with an
// error code.
// The callbacks object is deleted when the callback method is called
// and does not need to be (and should not be) deleted manually.
virtual void queryStorageUsageAndQuota(
WebFrame*, WebStorageQuotaType, WebStorageQuotaCallbacks*) { }
// Requests a new quota size for the origin's storage.
// |newQuotaInBytes| indicates how much storage space (in bytes) the
// caller expects to need.
// WebStorageQuotaCallbacks::didGrantStorageQuota will be called when
// a new quota is granted. WebStorageQuotaCallbacks::didFail
// is called with an error code otherwise.
// Note that the requesting quota size may not always be granted and
// a smaller amount of quota than requested might be returned.
// The callbacks object is deleted when the callback method is called
// and does not need to be (and should not be) deleted manually.
virtual void requestStorageQuota(
WebFrame*, WebStorageQuotaType,
unsigned long long newQuotaInBytes,
WebStorageQuotaCallbacks*) { }
protected:
~WebFrameClient() { }
};
......
/*
* Copyright (C) 2011 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WebStorageQuotaCallbacks_h
#define WebStorageQuotaCallbacks_h
#include "WebStorageQuotaError.h"
namespace WebKit {
class WebStorageQuotaCallbacks {
public:
// Callback for WebFrameClient::queryStorageUsageAndQuota.
virtual void didQueryStorageUsageAndQuota(unsigned long long usageInBytes, unsigned long long quotaInBytes) = 0;
// Callback for WebFrameClient::requestStorageQuota.
// This may return a smaller amount of quota than the requested.
virtual void didGrantStorageQuota(unsigned long long grantedQuotaInBytes) = 0;
virtual void didFail(WebStorageQuotaError) = 0;
protected:
virtual ~WebStorageQuotaCallbacks() { }
};
} // namespace WebKit
#endif // WebStorageQuotaCallbacks_h
/*
* Copyright (C) 2011 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WebStorageQuotaError_h
#define WebStorageQuotaError_h
namespace WebKit {
// The error code used for WebStorageQuota.
enum WebStorageQuotaError {
WebStorageQuotaErrorNotSupported = 9,
WebStorageQuotaErrorAbort = 20,
};
} // namespace WebKit
#endif // WebStorageQuotaError_h
/*
* Copyright (C) 2011 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WebStorageQuotaType_h
#define WebStorageQuotaType_h
namespace WebKit {
enum WebStorageQuotaType {
WebStorageQuotaTypeTemporary,
WebStorageQuotaTypePersistent,
};
} // namespace WebKit
#endif // WebStorageQuotaType_h
......@@ -38,6 +38,7 @@
#include "AsyncFileSystem.h"
#include "DocumentMarker.h"
#include "EditorInsertAction.h"
#include "ExceptionCode.h"
#include "FileError.h"
#include "FileMetadata.h"
#include "FontDescription.h"
......@@ -75,6 +76,7 @@
#include "WebNotificationPresenter.h"
#include "WebScrollbar.h"
#include "WebSettings.h"
#include "WebStorageQuotaError.h"
#include "WebTextAffinity.h"
#include "WebTextCaseSensitivity.h"
#include "WebTextCheckingResult.h"
......@@ -414,6 +416,11 @@ COMPILE_ASSERT_MATCHING_ENUM(WebGeolocationError::ErrorPositionUnavailable, Geol
COMPILE_ASSERT_MATCHING_ENUM(WebTextCheckingResult::ErrorSpelling, DocumentMarker::Spelling);
COMPILE_ASSERT_MATCHING_ENUM(WebTextCheckingResult::ErrorGrammar, DocumentMarker::Grammar);
#if ENABLE(QUOTA)
COMPILE_ASSERT_MATCHING_ENUM(WebStorageQuotaErrorNotSupported, NOT_SUPPORTED_ERR);
COMPILE_ASSERT_MATCHING_ENUM(WebStorageQuotaErrorAbort, ABORT_ERR);
#endif
#if OS(DARWIN)
COMPILE_ASSERT_MATCHING_ENUM(WebThemeEngine::StateDisabled, PlatformBridge::StateDisabled);
COMPILE_ASSERT_MATCHING_ENUM(WebThemeEngine::StateInactive, PlatformBridge::StateInactive);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment