Changeset 241924 in webkit


Ignore:
Timestamp:
Feb 21, 2019 5:05:08 PM (5 years ago)
Author:
don.olmstead@sony.com
Message:

[MSVC] Fix compilation errors with lambdas in ResourceLoadStatistics
https://bugs.webkit.org/show_bug.cgi?id=194913

Reviewed by Brent Fulgham.

MSVC has problems with the scoping of this within a nested lambda. To work around the
behavior the enclosing lambda's wrapping of this is used within the nested lambda.

  • NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:

(WebKit::ResourceLoadStatisticsMemoryStore::processStatisticsAndDataRecords):

  • NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:

(WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted):

Location:
trunk/Source/WebKit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r241919 r241924  
     12019-02-21  Don Olmstead  <don.olmstead@sony.com>
     2
     3        [MSVC] Fix compilation errors with lambdas in ResourceLoadStatistics
     4        https://bugs.webkit.org/show_bug.cgi?id=194913
     5
     6        Reviewed by Brent Fulgham.
     7
     8        MSVC has problems with the scoping of `this` within a nested lambda. To work around the
     9        behavior the enclosing lambda's wrapping of `this` is used within the nested lambda.
     10
     11        * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:
     12        (WebKit::ResourceLoadStatisticsMemoryStore::processStatisticsAndDataRecords):
     13        * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
     14        (WebKit::WebResourceLoadStatisticsStore::requestStorageAccessGranted):
     15
    1162019-02-21  Chris Dumez  <cdumez@apple.com>
    217
  • trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp

    r240586 r241924  
    355355    }
    356356
    357     removeDataRecords([this, weakThis = makeWeakPtr(*this)] {
     357    removeDataRecords([this, weakThis = makeWeakPtr(*this)]() mutable {
    358358        ASSERT(!RunLoop::isMain());
    359359        if (!weakThis)
     
    367367            return;
    368368
    369         RunLoop::main().dispatch([this, weakThis = makeWeakPtr(*this)] {
     369        RunLoop::main().dispatch([this, weakThis = WTFMove(weakThis)]() {
    370370            ASSERT(RunLoop::isMain());
    371371            if (!weakThis)
  • trunk/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp

    r241574 r241924  
    3131#include "APIDictionary.h"
    3232#include "Logging.h"
     33#include "NetworkProcess.h"
    3334#include "NetworkSession.h"
    3435#include "ResourceLoadStatisticsMemoryStore.h"
     
    306307            auto subFramePrimaryDomain = ResourceLoadStatistics::primaryDomain(subFrameHost);
    307308            auto topFramePrimaryDomain = ResourceLoadStatistics::primaryDomain(topFrameHost);
    308             CompletionHandler<void(bool)> requestConfirmationCompletionHandler = [this, protectedThis = makeRef(*this), subFrameHost = WTFMove(subFrameHost), topFrameHost = WTFMove(topFrameHost), frameID, pageID, completionHandler = WTFMove(completionHandler)] (bool userDidGrantAccess) mutable {
     309            CompletionHandler<void(bool)> requestConfirmationCompletionHandler = [this, protectedThis = protectedThis.copyRef(), subFrameHost = WTFMove(subFrameHost), topFrameHost = WTFMove(topFrameHost), frameID, pageID, completionHandler = WTFMove(completionHandler)] (bool userDidGrantAccess) mutable {
    309310                if (userDidGrantAccess)
    310311                    grantStorageAccess(WTFMove(subFrameHost), WTFMove(topFrameHost), frameID, pageID, userDidGrantAccess, WTFMove(completionHandler));
Note: See TracChangeset for help on using the changeset viewer.