Commit 0a6dd69f authored by kinuko@chromium.org's avatar kinuko@chromium.org

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

        Not reviewed; another build fix attempt.

        * src/StorageInfoChromium.cpp:
        (WebCore::StorageInfo::queryUsageAndQuota):
        (WebCore::StorageInfo::requestQuota):
        * src/WebStorageQuotaCallbacksImpl.cpp:
        (WebKit::WebStorageQuotaCallbacksImpl::WebStorageQuotaCallbacksImpl):
        * src/WebStorageQuotaCallbacksImpl.h:


git-svn-id: svn://svn.chromium.org/blink/trunk@84250 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 87cbb564
2011-04-19 Kinuko Yasuda <kinuko@chromium.org>
Not reviewed; another build fix attempt.
* src/StorageInfoChromium.cpp:
(WebCore::StorageInfo::queryUsageAndQuota):
(WebCore::StorageInfo::requestQuota):
* src/WebStorageQuotaCallbacksImpl.cpp:
(WebKit::WebStorageQuotaCallbacksImpl::WebStorageQuotaCallbacksImpl):
* src/WebStorageQuotaCallbacksImpl.h:
2011-04-19 Kinuko Yasuda <kinuko@chromium.org>
Reviewed by David Levin.
......
......@@ -69,7 +69,7 @@ void StorageInfo::queryUsageAndQuota(ScriptExecutionContext* context, int storag
if (context->isDocument()) {
Document* document = static_cast<Document*>(context);
WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame());
webFrame->client()->queryStorageUsageAndQuota(webFrame, static_cast<WebStorageQuotaType>(storageType), WebStorageQuotaCallbacksImpl::createForUsageCallback(successCallback, errorCallback));
webFrame->client()->queryStorageUsageAndQuota(webFrame, static_cast<WebStorageQuotaType>(storageType), new WebStorageQuotaCallbacksImpl(successCallback, errorCallback));
} else if (errorCallback) {
// FIXME: calling this on worker is not yet supported.
fireStorageInfoErrorCallback(errorCallback, NOT_SUPPORTED_ERR);
......@@ -87,7 +87,7 @@ void StorageInfo::requestQuota(ScriptExecutionContext* context, int storageType,
if (context->isDocument()) {
Document* document = static_cast<Document*>(context);
WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame());
webFrame->client()->requestStorageQuota(webFrame, static_cast<WebStorageQuotaType>(storageType), newQuotaInBytes, WebStorageQuotaCallbacksImpl::createForQuotaCallback(successCallback, errorCallback));
webFrame->client()->requestStorageQuota(webFrame, static_cast<WebStorageQuotaType>(storageType), newQuotaInBytes, new WebStorageQuotaCallbacksImpl(successCallback, errorCallback));
} else if (errorCallback) {
// FIXME: calling this on worker is not yet supported.
fireStorageInfoErrorCallback(errorCallback, NOT_SUPPORTED_ERR);
......
......@@ -42,16 +42,16 @@ using namespace WebCore;
namespace WebKit {
WebStorageQuotaCallbacksImpl* WebStorageQuotaCallbacksImpl::createForUsageCallback(PassRefPtr<WebCore::StorageInfoUsageCallback> usageCallback, PassRefPtr<WebCore::StorageInfoErrorCallback> errorCallback)
WebStorageQuotaCallbacksImpl::WebStorageQuotaCallbacksImpl(PassRefPtr<WebCore::StorageInfoUsageCallback> usageCallback, PassRefPtr<WebCore::StorageInfoErrorCallback> errorCallback)
: m_usageCallback(usageCallback)
, m_errorCallback(errorCallback)
{
// This class is self-destructed; returning a leaked pointer.
return adoptPtr(new WebStorageQuotaCallbacksImpl(usageCallback, errorCallback)).leakPtr();
}
WebStorageQuotaCallbacksImpl* WebStorageQuotaCallbacksImpl::createForQuotaCallback(PassRefPtr<WebCore::StorageInfoQuotaCallback> quotaCallback, PassRefPtr<WebCore::StorageInfoErrorCallback> errorCallback)
WebStorageQuotaCallbacksImpl::WebStorageQuotaCallbacksImpl(PassRefPtr<WebCore::StorageInfoQuotaCallback> quotaCallback, PassRefPtr<WebCore::StorageInfoErrorCallback> errorCallback)
: m_quotaCallback(quotaCallback)
, m_errorCallback(errorCallback)
{
// This class is self-destructed; returning a leaked pointer.
return adoptPtr(new WebStorageQuotaCallbacksImpl(quotaCallback, errorCallback)).leakPtr();
}
WebStorageQuotaCallbacksImpl::~WebStorageQuotaCallbacksImpl()
......@@ -82,18 +82,6 @@ void WebStorageQuotaCallbacksImpl::didFail(WebStorageQuotaError error)
delete this;
}
WebStorageQuotaCallbacksImpl::WebStorageQuotaCallbacksImpl(PassRefPtr<WebCore::StorageInfoUsageCallback> usageCallback, PassRefPtr<WebCore::StorageInfoErrorCallback> errorCallback)
: m_usageCallback(usageCallback)
, m_errorCallback(errorCallback)
{
}
WebStorageQuotaCallbacksImpl::WebStorageQuotaCallbacksImpl(PassRefPtr<WebCore::StorageInfoQuotaCallback> quotaCallback, PassRefPtr<WebCore::StorageInfoErrorCallback> errorCallback)
: m_quotaCallback(quotaCallback)
, m_errorCallback(errorCallback)
{
}
} // namespace WebKit
#endif // ENABLE(QUOTA)
......@@ -46,9 +46,9 @@ namespace WebKit {
class WebStorageQuotaCallbacksImpl : public WebStorageQuotaCallbacks {
public:
// The following create methods return a leaked ptr (the class is self-destructed).
static WebStorageQuotaCallbacksImpl* createForUsageCallback(PassRefPtr<WebCore::StorageInfoUsageCallback>, PassRefPtr<WebCore::StorageInfoErrorCallback>);
static WebStorageQuotaCallbacksImpl* createForQuotaCallback(PassRefPtr<WebCore::StorageInfoQuotaCallback>, PassRefPtr<WebCore::StorageInfoErrorCallback>);
// The class is self-destructed and thus we have bare constructors.
WebStorageQuotaCallbacksImpl(PassRefPtr<WebCore::StorageInfoUsageCallback>, PassRefPtr<WebCore::StorageInfoErrorCallback>);
WebStorageQuotaCallbacksImpl(PassRefPtr<WebCore::StorageInfoQuotaCallback>, PassRefPtr<WebCore::StorageInfoErrorCallback>);
virtual ~WebStorageQuotaCallbacksImpl();
......@@ -57,9 +57,6 @@ public:
virtual void didFail(WebStorageQuotaError);
private:
WebStorageQuotaCallbacksImpl(PassRefPtr<WebCore::StorageInfoUsageCallback>, PassRefPtr<WebCore::StorageInfoErrorCallback>);
WebStorageQuotaCallbacksImpl(PassRefPtr<WebCore::StorageInfoQuotaCallback>, PassRefPtr<WebCore::StorageInfoErrorCallback>);
RefPtr<WebCore::StorageInfoUsageCallback> m_usageCallback;
RefPtr<WebCore::StorageInfoQuotaCallback> m_quotaCallback;
RefPtr<WebCore::StorageInfoErrorCallback> m_errorCallback;
......
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