namespace WebCore {
-StorageQuotaCallbacksImpl::StorageQuotaCallbacksImpl(PassRefPtr<ScriptPromiseResolver> resolver, ExecutionContext* context)
+StorageQuotaCallbacksImpl::StorageQuotaCallbacksImpl(PassRefPtr<ScriptPromiseResolverWithContext> resolver)
: m_resolver(resolver)
- , m_requestState(context)
{
}
void StorageQuotaCallbacksImpl::didQueryStorageUsageAndQuota(unsigned long long usageInBytes, unsigned long long quotaInBytes)
{
- DOMRequestState::Scope scope(m_requestState);
m_resolver->resolve(StorageInfo::create(usageInBytes, quotaInBytes));
}
void StorageQuotaCallbacksImpl::didGrantStorageQuota(unsigned long long usageInBytes, unsigned long long grantedQuotaInBytes)
{
- DOMRequestState::Scope scope(m_requestState);
m_resolver->resolve(StorageInfo::create(usageInBytes, grantedQuotaInBytes));
}
void StorageQuotaCallbacksImpl::didFail(blink::WebStorageQuotaError error)
{
- DOMRequestState::Scope scope(m_requestState);
m_resolver->reject(DOMError::create(static_cast<ExceptionCode>(error)).get());
}