Modified: trunk/Source/WebCore/storage/StorageQuotaManager.cpp (247394 => 247395)
--- trunk/Source/WebCore/storage/StorageQuotaManager.cpp 2019-07-12 20:08:04 UTC (rev 247394)
+++ trunk/Source/WebCore/storage/StorageQuotaManager.cpp 2019-07-12 20:14:05 UTC (rev 247395)
@@ -26,6 +26,7 @@
#include "config.h"
#include "StorageQuotaManager.h"
+#include "Logging.h"
#include "StorageQuotaUser.h"
namespace WebCore {
@@ -155,10 +156,15 @@
{
ASSERT(shouldAskForMoreSpace(spaceIncrease));
ASSERT(!m_isWaitingForSpaceIncreaseResponse);
+
+ RELEASE_LOG(Storage, "%p - StorageQuotaManager::askForMoreSpace %" PRIu64, this, spaceIncrease);
m_isWaitingForSpaceIncreaseResponse = true;
m_spaceIncreaseRequester(m_quota, spaceUsage(), spaceIncrease, [this, weakThis = makeWeakPtr(*this)](Optional<uint64_t> newQuota) {
if (!weakThis)
return;
+
+ RELEASE_LOG(Storage, "%p - StorageQuotaManager::askForMoreSpace received response %" PRIu64, this, newQuota ? *newQuota : 0);
+
m_isWaitingForSpaceIncreaseResponse = false;
processPendingRequests(newQuota, ShouldDequeueFirstPendingRequest::Yes);
});
@@ -180,8 +186,11 @@
if (shouldDequeueFirstPendingRequest == ShouldDequeueFirstPendingRequest::Yes) {
auto request = m_pendingRequests.takeFirst();
- auto decision = shouldAskForMoreSpace(request.spaceIncrease) ? Decision::Deny : Decision::Grant;
- request.callback(decision);
+ bool shouldAllowRequest = !shouldAskForMoreSpace(request.spaceIncrease);
+
+ RELEASE_LOG(Storage, "%p - StorageQuotaManager::processPendingRequests first request decision is %d", this, shouldAllowRequest);
+
+ request.callback(shouldAllowRequest ? Decision::Grant : Decision::Deny);
}
while (!m_pendingRequests.isEmpty()) {
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (247394 => 247395)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2019-07-12 20:08:04 UTC (rev 247394)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2019-07-12 20:14:05 UTC (rev 247395)
@@ -7302,10 +7302,17 @@
void WebPageProxy::requestStorageSpace(uint64_t frameID, const String& originIdentifier, const String& databaseName, const String& displayName, uint64_t currentQuota, uint64_t currentOriginUsage, uint64_t currentDatabaseUsage, uint64_t expectedUsage, CompletionHandler<void(uint64_t)>&& completionHandler)
{
+ RELEASE_LOG_IF_ALLOWED(Storage, "requestStorageSpace for frame %" PRIu64 ", current quota %" PRIu64 " current usage %" PRIu64 " expected usage %" PRIu64, frameID, currentQuota, currentDatabaseUsage, expectedUsage);
+
StorageRequests::singleton().processOrAppend([this, protectedThis = makeRef(*this), pageURL = currentURL(), frameID, originIdentifier, databaseName, displayName, currentQuota, currentOriginUsage, currentDatabaseUsage, expectedUsage, completionHandler = WTFMove(completionHandler)]() mutable {
- this->makeStorageSpaceRequest(frameID, originIdentifier, databaseName, displayName, currentQuota, currentOriginUsage, currentDatabaseUsage, expectedUsage, [this, protectedThis = WTFMove(protectedThis), pageURL = WTFMove(pageURL), completionHandler = WTFMove(completionHandler), currentQuota](auto quota) mutable {
- if (quota <= currentQuota && this->currentURL() == pageURL)
+ this->makeStorageSpaceRequest(frameID, originIdentifier, databaseName, displayName, currentQuota, currentOriginUsage, currentDatabaseUsage, expectedUsage, [this, protectedThis = WTFMove(protectedThis), frameID, pageURL = WTFMove(pageURL), completionHandler = WTFMove(completionHandler), currentQuota](auto quota) mutable {
+
+ RELEASE_LOG_IF_ALLOWED(Storage, "requestStorageSpace response for frame %" PRIu64 ", quota %" PRIu64, frameID, quota);
+
+ if (quota <= currentQuota && this->currentURL() == pageURL) {
+ RELEASE_LOG_IF_ALLOWED(Storage, "storage space increase denied");
m_isQuotaIncreaseDenied = true;
+ }
completionHandler(quota);
StorageRequests::singleton().processNextIfAny();
});