Changeset 231465 in webkit


Ignore:
Timestamp:
May 7, 2018 4:57:22 PM (6 years ago)
Author:
achristensen@apple.com
Message:

WebResourceLoadStatisticsStore::requestStorageAccess should call its completion handler on the main thread
https://bugs.webkit.org/show_bug.cgi?id=185403

Reviewed by Brent Fulgham.

  • UIProcess/WebResourceLoadStatisticsStore.cpp:

(WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r231458 r231465  
     12018-05-07  Alex Christensen  <achristensen@webkit.org>
     2
     3        WebResourceLoadStatisticsStore::requestStorageAccess should call its completion handler on the main thread
     4        https://bugs.webkit.org/show_bug.cgi?id=185403
     5
     6        Reviewed by Brent Fulgham.
     7
     8        * UIProcess/WebResourceLoadStatisticsStore.cpp:
     9        (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
     10
    1112018-05-07  Chris Dumez  <cdumez@apple.com>
    212
  • trunk/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp

    r230162 r231465  
    372372        auto& subFrameStatistic = ensureResourceStatisticsForPrimaryDomain(subFramePrimaryDomain);
    373373        if (shouldBlockCookies(subFrameStatistic)) {
    374             callback(false);
     374            callOnMainThread([callback = WTFMove(callback)] {
     375                callback(false);
     376            });
    375377            return;
    376378        }
    377379       
    378380        if (!shouldPartitionCookies(subFrameStatistic)) {
    379             callback(true);
     381            callOnMainThread([callback = WTFMove(callback)] {
     382                callback(true);
     383            });
    380384            return;
    381385        }
     
    383387        subFrameStatistic.timesAccessedAsFirstPartyDueToStorageAccessAPI++;
    384388
    385         m_grantStorageAccessHandler(subFramePrimaryDomain, topFramePrimaryDomain, frameID, pageID, WTFMove(callback));
     389        m_grantStorageAccessHandler(subFramePrimaryDomain, topFramePrimaryDomain, frameID, pageID, [callback = WTFMove(callback)] (bool value) mutable {
     390            callOnMainThread([value, callback = WTFMove(callback)] {
     391                callback(value);
     392            });
     393        });
    386394    });
    387395}
Note: See TracChangeset for help on using the changeset viewer.