Changeset 247395 in webkit


Ignore:
Timestamp:
Jul 12, 2019 1:14:05 PM (5 years ago)
Author:
youenn@apple.com
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):

Location:
trunk/Source
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r247391 r247395  
     12019-07-12  Youenn Fablet  <youenn@apple.com>
     2
     3        Add release logging for quota checks
     4        https://bugs.webkit.org/show_bug.cgi?id=199697
     5
     6        Reviewed by Alex Christensen.
     7
     8        Log whether a request to extend quota is made and the result of the request.
     9        This logging should happen in the networking process.
     10        No change of behavior.
     11
     12        * platform/Logging.h:
     13        * storage/StorageQuotaManager.cpp:
     14        (WebCore::StorageQuotaManager::askForMoreSpace):
     15        (WebCore::StorageQuotaManager::processPendingRequests):
     16
    1172019-07-12  Youenn Fablet  <youenn@apple.com>
    218
  • trunk/Source/WebCore/platform/Logging.h

    r245373 r247395  
    9797    M(SpellingAndGrammar) \
    9898    M(SQLDatabase) \
     99    M(Storage) \
    99100    M(StorageAPI) \
    100101    M(SVG) \
  • trunk/Source/WebCore/storage/StorageQuotaManager.cpp

    r244112 r247395  
    2727#include "StorageQuotaManager.h"
    2828
     29#include "Logging.h"
    2930#include "StorageQuotaUser.h"
    3031
     
    156157    ASSERT(shouldAskForMoreSpace(spaceIncrease));
    157158    ASSERT(!m_isWaitingForSpaceIncreaseResponse);
     159
     160    RELEASE_LOG(Storage, "%p - StorageQuotaManager::askForMoreSpace %" PRIu64, this, spaceIncrease);
    158161    m_isWaitingForSpaceIncreaseResponse = true;
    159162    m_spaceIncreaseRequester(m_quota, spaceUsage(), spaceIncrease, [this, weakThis = makeWeakPtr(*this)](Optional<uint64_t> newQuota) {
    160163        if (!weakThis)
    161164            return;
     165
     166        RELEASE_LOG(Storage, "%p - StorageQuotaManager::askForMoreSpace received response %" PRIu64, this, newQuota ? *newQuota : 0);
     167
    162168        m_isWaitingForSpaceIncreaseResponse = false;
    163169        processPendingRequests(newQuota, ShouldDequeueFirstPendingRequest::Yes);
     
    181187    if (shouldDequeueFirstPendingRequest == ShouldDequeueFirstPendingRequest::Yes) {
    182188        auto request = m_pendingRequests.takeFirst();
    183         auto decision = shouldAskForMoreSpace(request.spaceIncrease) ? Decision::Deny : Decision::Grant;
    184         request.callback(decision);
     189        bool shouldAllowRequest = !shouldAskForMoreSpace(request.spaceIncrease);
     190
     191        RELEASE_LOG(Storage, "%p - StorageQuotaManager::processPendingRequests first request decision is %d", this, shouldAllowRequest);
     192
     193        request.callback(shouldAllowRequest ? Decision::Grant : Decision::Deny);
    185194    }
    186195
  • trunk/Source/WebKit/ChangeLog

    r247394 r247395  
     12019-07-12  Youenn Fablet  <youenn@apple.com>
     2
     3        Add release logging for quota checks
     4        https://bugs.webkit.org/show_bug.cgi?id=199697
     5
     6        Reviewed by Alex Christensen.
     7
     8        Log requests made to the page and the result from the application.
     9
     10        * Platform/Logging.h:
     11        * UIProcess/WebPageProxy.cpp:
     12        (WebKit::WebPageProxy::requestStorageSpace):
     13
    1142019-07-12  Youenn Fablet  <youenn@apple.com>
    215
  • trunk/Source/WebKit/Platform/Logging.h

    r246561 r247395  
    8383    M(ServiceWorker) \
    8484    M(SessionState) \
     85    M(Storage) \
    8586    M(StorageAPI) \
    8687    M(TextInput) \
  • trunk/Source/WebKit/UIProcess/WebPageProxy.cpp

    r247272 r247395  
    73037303void 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)
    73047304{
     7305    RELEASE_LOG_IF_ALLOWED(Storage, "requestStorageSpace for frame %" PRIu64 ", current quota %" PRIu64 " current usage %" PRIu64 " expected usage %" PRIu64, frameID, currentQuota, currentDatabaseUsage, expectedUsage);
     7306
    73057307    StorageRequests::singleton().processOrAppend([this, protectedThis = makeRef(*this), pageURL = currentURL(), frameID, originIdentifier, databaseName, displayName, currentQuota, currentOriginUsage, currentDatabaseUsage, expectedUsage, completionHandler = WTFMove(completionHandler)]() mutable {
    7306         this->makeStorageSpaceRequest(frameID, originIdentifier, databaseName, displayName, currentQuota, currentOriginUsage, currentDatabaseUsage, expectedUsage, [this, protectedThis = WTFMove(protectedThis), pageURL = WTFMove(pageURL), completionHandler = WTFMove(completionHandler), currentQuota](auto quota) mutable {
    7307             if (quota <= currentQuota && this->currentURL() == pageURL)
     7308        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 {
     7309
     7310            RELEASE_LOG_IF_ALLOWED(Storage, "requestStorageSpace response for frame %" PRIu64 ", quota %" PRIu64, frameID, quota);
     7311
     7312            if (quota <= currentQuota && this->currentURL() == pageURL) {
     7313                RELEASE_LOG_IF_ALLOWED(Storage, "storage space increase denied");
    73087314                m_isQuotaIncreaseDenied =  true;
     7315            }
    73097316            completionHandler(quota);
    73107317            StorageRequests::singleton().processNextIfAny();
Note: See TracChangeset for help on using the changeset viewer.