Bug 184120 - [Win] MSVC can't compile WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent
Summary: [Win] MSVC can't compile WebResourceLoadStatisticsStore::scheduleClearInMemor...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Fujii Hironori
URL:
Keywords: InRadar
Depends on:
Blocks: 174003
  Show dependency treegraph
 
Reported: 2018-03-28 17:46 PDT by Fujii Hironori
Modified: 2018-04-02 10:45 PDT (History)
6 users (show)

See Also:


Attachments
WIP patch (801 bytes, patch)
2018-03-28 17:58 PDT, Fujii Hironori
no flags Details | Formatted Diff | Diff
Patch (1.84 KB, patch)
2018-03-28 19:04 PDT, Fujii Hironori
no flags Details | Formatted Diff | Diff
Patch (1.97 KB, patch)
2018-03-29 18:32 PDT, Fujii Hironori
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fujii Hironori 2018-03-28 17:46:36 PDT
[Win] MSVC can't compile WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent

>WebResourceLoadStatisticsStore.cpp
>c:\webkit\gb\webkitbuild\debug\derivedsources\forwardingheaders\wtf\ref.h(61): error C2039: 'deref': is not a member of 'WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent::<lambda_2ce8022c49d1b38b3e0a628b677d335e>'
>c:\webkit\gb\source\webkit\uiprocess\webresourceloadstatisticsstore.cpp(830): note: see declaration of 'WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent::<lambda_2ce8022c49d1b38b3e0a628b677d335e>'
>c:\webkit\gb\webkitbuild\debug\derivedsources\forwardingheaders\wtf\ref.h(55): note: while compiling class template member function 'WTF::Ref<WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent::<lambda_2ce8022c49d1b38b3e0a628b677d335e>,WTF::DumbPtrTraits<T>>::~Ref(void)'
>        with
>        [
>            T=WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent::<lambda_2ce8022c49d1b38b3e0a628b677d335e>
>        ]
>c:\webkit\gb\source\webkit\uiprocess\webresourceloadstatisticsstore.cpp(826): note: see reference to function template instantiation 'WTF::Ref<WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent::<lambda_2ce8022c49d1b38b3e0a628b677d335e>,WTF::DumbPtrTraits<T>>::~Ref(void)' being compiled
>        with
>        [
>            T=WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent::<lambda_2ce8022c49d1b38b3e0a628b677d335e>
>        ]
>c:\webkit\gb\source\webkit\uiprocess\webresourceloadstatisticsstore.cpp(824): note: see reference to class template instantiation 'WTF::Ref<WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent::<lambda_2ce8022c49d1b38b3e0a628b677d335e>,WTF::DumbPtrTraits<T>>' being compiled
>        with
>        [
>            T=WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent::<lambda_2ce8022c49d1b38b3e0a628b677d335e>
>        ]
Comment 1 Fujii Hironori 2018-03-28 17:58:06 PDT
Created attachment 336740 [details]
WIP patch
Comment 2 Fujii Hironori 2018-03-28 18:30:09 PDT
I created a reproducer and reported to MS.

https://godbolt.org/g/kZq5Fn
https://msdn.microsoft.com/library/mt748084.aspx
Comment 3 Fujii Hironori 2018-03-28 19:04:15 PDT
Created attachment 336745 [details]
Patch
Comment 4 Alex Christensen 2018-03-29 10:31:18 PDT
Comment on attachment 336745 [details]
Patch

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

> Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp:824
> -            grandfatherExistingWebsiteData([protectedThis = makeRef(*this), callback = WTFMove(callback)]() {
> +            grandfatherExistingWebsiteData([protectedThis = protectedThis.copyRef(), callback = WTFMove(callback)]() {

protectedThis = WTFMove(protectedThis)
There's no need to unnecessarily increment and decrement the ref count twice in this case.
Comment 5 Fujii Hironori 2018-03-29 18:32:33 PDT
Created attachment 336828 [details]
Patch
Comment 6 Fujii Hironori 2018-04-01 18:57:14 PDT
Thank you for the review, Alex. I addressed the review feedback. Could you review again?
Comment 7 WebKit Commit Bot 2018-04-02 10:44:53 PDT
Comment on attachment 336828 [details]
Patch

Clearing flags on attachment: 336828

Committed r230162: <https://trac.webkit.org/changeset/230162>
Comment 8 WebKit Commit Bot 2018-04-02 10:44:54 PDT
All reviewed patches have been landed.  Closing bug.
Comment 9 Radar WebKit Bug Importer 2018-04-02 10:45:44 PDT
<rdar://problem/39110400>