Title: [247395] trunk/Source
Revision
247395
Author
you...@apple.com
Date
2019-07-12 13:14:05 -0700 (Fri, 12 Jul 2019)

Log Message

Add release logging for quota checks
https://bugs.webkit.org/show_bug.cgi?id=199697

Reviewed by Alex Christensen.

Source/WebCore:

Log whether a request to extend quota is made and the result of the request.
This logging should happen in the networking process.
No change of behavior.

* platform/Logging.h:
* storage/StorageQuotaManager.cpp:
(WebCore::StorageQuotaManager::askForMoreSpace):
(WebCore::StorageQuotaManager::processPendingRequests):

Source/WebKit:

Log requests made to the page and the result from the application.

* Platform/Logging.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestStorageSpace):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (247394 => 247395)


--- trunk/Source/WebCore/ChangeLog	2019-07-12 20:08:04 UTC (rev 247394)
+++ trunk/Source/WebCore/ChangeLog	2019-07-12 20:14:05 UTC (rev 247395)
@@ -1,5 +1,21 @@
 2019-07-12  Youenn Fablet  <you...@apple.com>
 
+        Add release logging for quota checks
+        https://bugs.webkit.org/show_bug.cgi?id=199697
+
+        Reviewed by Alex Christensen.
+
+        Log whether a request to extend quota is made and the result of the request.
+        This logging should happen in the networking process.
+        No change of behavior.
+
+        * platform/Logging.h:
+        * storage/StorageQuotaManager.cpp:
+        (WebCore::StorageQuotaManager::askForMoreSpace):
+        (WebCore::StorageQuotaManager::processPendingRequests):
+
+2019-07-12  Youenn Fablet  <you...@apple.com>
+
         Stopping a cloned MediaStream video track should not stop any other video track
         https://bugs.webkit.org/show_bug.cgi?id=199635
 

Modified: trunk/Source/WebCore/platform/Logging.h (247394 => 247395)


--- trunk/Source/WebCore/platform/Logging.h	2019-07-12 20:08:04 UTC (rev 247394)
+++ trunk/Source/WebCore/platform/Logging.h	2019-07-12 20:14:05 UTC (rev 247395)
@@ -96,6 +96,7 @@
     M(ServiceWorker) \
     M(SpellingAndGrammar) \
     M(SQLDatabase) \
+    M(Storage) \
     M(StorageAPI) \
     M(SVG) \
     M(TextAutosizing) \

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/ChangeLog (247394 => 247395)


--- trunk/Source/WebKit/ChangeLog	2019-07-12 20:08:04 UTC (rev 247394)
+++ trunk/Source/WebKit/ChangeLog	2019-07-12 20:14:05 UTC (rev 247395)
@@ -1,5 +1,18 @@
 2019-07-12  Youenn Fablet  <you...@apple.com>
 
+        Add release logging for quota checks
+        https://bugs.webkit.org/show_bug.cgi?id=199697
+
+        Reviewed by Alex Christensen.
+
+        Log requests made to the page and the result from the application.
+
+        * Platform/Logging.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::requestStorageSpace):
+
+2019-07-12  Youenn Fablet  <you...@apple.com>
+
         Remove unneeded variable in LocalStorageNamespace::getOrCreateStorageArea
         https://bugs.webkit.org/show_bug.cgi?id=199477
 

Modified: trunk/Source/WebKit/Platform/Logging.h (247394 => 247395)


--- trunk/Source/WebKit/Platform/Logging.h	2019-07-12 20:08:04 UTC (rev 247394)
+++ trunk/Source/WebKit/Platform/Logging.h	2019-07-12 20:14:05 UTC (rev 247395)
@@ -82,6 +82,7 @@
     M(Selection) \
     M(ServiceWorker) \
     M(SessionState) \
+    M(Storage) \
     M(StorageAPI) \
     M(TextInput) \
     M(UIHitTesting) \

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();
         });
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to