Bug 194913

Summary: [MSVC] Fix compilation errors with lambdas in ResourceLoadStatistics
Product: WebKit Reporter: Don Olmstead <don.olmstead>
Component: WebKit Misc.Assignee: Don Olmstead <don.olmstead>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, bfulgham, commit-queue, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 194267    
Attachments:
Description Flags
Patch none

Description Don Olmstead 2019-02-21 12:32:39 PST
There are issues compiling ResourceLoadStatisticsMemoryStore in MSVC around nested lambdas.

This is true even in MSVS 2019 Preview 3
Comment 1 Don Olmstead 2019-02-21 12:40:38 PST
Created attachment 362628 [details]
Patch
Comment 2 Brent Fulgham 2019-02-21 16:23:10 PST
Comment on attachment 362628 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=362628&action=review

EWS seems happy, so this change looks good.

> Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:369
> +        RunLoop::main().dispatch([this, weakThis = WTFMove(weakThis)]() {

Interesting that MSVC doesn't like this. This actually seems like better code anyway.

> Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:33
> +#include "NetworkProcess.h"

I wonder if this was missing because of the vagaries of our Unified Sources behavior.
Comment 3 Don Olmstead 2019-02-21 16:41:43 PST
(In reply to Brent Fulgham from comment #2)
> Comment on attachment 362628 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=362628&action=review
> 
> EWS seems happy, so this change looks good.
> 
> > Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp:369
> > +        RunLoop::main().dispatch([this, weakThis = WTFMove(weakThis)]() {
> 
> Interesting that MSVC doesn't like this. This actually seems like better
> code anyway.

There are a bunch of bugs around lambdas in MSVC. Supposedly they were fixed but this was built with latest preview release of 2019 so 🤷

> > Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:33
> > +#include "NetworkProcess.h"
> 
> I wonder if this was missing because of the vagaries of our Unified Sources
> behavior.

Most likely. I really hate Unified Sources. This https://bugs.webkit.org/show_bug.cgi?id=193073 needs to get fixed first.
Comment 4 WebKit Commit Bot 2019-02-21 17:05:13 PST
Comment on attachment 362628 [details]
Patch

Clearing flags on attachment: 362628

Committed r241924: <https://trac.webkit.org/changeset/241924>
Comment 5 WebKit Commit Bot 2019-02-21 17:05:14 PST
All reviewed patches have been landed.  Closing bug.
Comment 6 Radar WebKit Bug Importer 2019-02-21 17:36:45 PST
<rdar://problem/48297768>