Bug 204437 - [MSVC] error C2039: 'weakPtrFactory': is not a member of 'WebCore::DocumentStorageAccess::requestStorageAccess::<lambda_3f2cfd7704f93d8fe19d5b5f064f8add>'
Summary: [MSVC] error C2039: 'weakPtrFactory': is not a member of 'WebCore::DocumentSt...
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Fujii Hironori
Keywords: InRadar
Depends on:
Reported: 2019-11-20 19:16 PST by Fujii Hironori
Modified: 2019-11-20 22:27 PST (History)
7 users (show)

See Also:

Patch (3.12 KB, patch)
2019-11-20 19:34 PST, Fujii Hironori
no flags Details | Formatted Diff | Diff
WIP patch (1.23 KB, patch)
2019-11-20 20:12 PST, Fujii Hironori
no flags Details | Formatted Diff | Diff
Patch for landing (2.33 KB, patch)
2019-11-20 20:32 PST, 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 2019-11-20 19:16:21 PST
[MSVC] error C2039: 'weakPtrFactory': is not a member of 'WebCore::DocumentStorageAccess::requestStorageAccess::<lambda_3f2cfd7704f93d8fe19d5b5f064f8add>'

WinCairo can't compile since r252723 (Bug 204397).


> FAILED: Source/WebCore/CMakeFiles/WebCore.dir/__/__/WebCore/DerivedSources/unified-sources/UnifiedSource-be65d27a-7.cpp.obj 
> C:\MSVS\VC\Tools\MSVC\14.20.27508\bin\Hostx64\x64\cl.exe  (...) -c WebCore\DerivedSources\unified-sources\UnifiedSource-be65d27a-7.cpp
> C:\WebKit-BuildWorker\wincairo-wkl-release\build\WebKitBuild\Release\WTF\Headers\wtf/WeakPtr.h(252): error C2039: 'weakPtrFactory': is not a member of 'WebCore::DocumentStorageAccess::requestStorageAccess::<lambda_3f2cfd7704f93d8fe19d5b5f064f8add>'
> C:\WebKit-BuildWorker\wincairo-wkl-release\build\Source\WebCore\dom/DocumentStorageAccess.cpp(205): note: see declaration of 'WebCore::DocumentStorageAccess::requestStorageAccess::<lambda_3f2cfd7704f93d8fe19d5b5f064f8add>'
> C:\WebKit-BuildWorker\wincairo-wkl-release\build\Source\WebCore\dom/DocumentStorageAccess.cpp(185): note: see reference to function template instantiation 'WTF::WeakPtr<WebCore::DocumentStorageAccess::requestStorageAccess::<lambda_3f2cfd7704f93d8fe19d5b5f064f8add>> WTF::makeWeakPtr<WebCore::DocumentStorageAccess::requestStorageAccess::<lambda_3f2cfd7704f93d8fe19d5b5f064f8add>>(T &)' being compiled
>         with
>         [
>             T=WebCore::DocumentStorageAccess::requestStorageAccess::<lambda_3f2cfd7704f93d8fe19d5b5f064f8add>
>         ]
Comment 1 Fujii Hironori 2019-11-20 19:16:45 PST
This is a similar issue with r251999.
Comment 2 Fujii Hironori 2019-11-20 19:34:28 PST
Created attachment 384020 [details]
Comment 3 Fujii Hironori 2019-11-20 20:02:16 PST
Comment on attachment 384020 [details]

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

> Source/WebCore/ChangeLog:11
> +        the inner lambda.

It seems that the outer lambda is executed in the main thread. It's safe to dereference the weak ptr in the outer lambda. I don't need to create two weak ptrs. Will fix.
Comment 4 Fujii Hironori 2019-11-20 20:12:23 PST
Created attachment 384023 [details]
WIP patch
Comment 5 Fujii Hironori 2019-11-20 20:19:44 PST
[MSConnect 3128879] C++: 'this' in capture expression of nested lambda resolves to the enclosing closure rather than the enclosing class instance - Developer Community

This captured in nested lambda when used in capture list results in this being an instance of lambda but not of the surrounding class - Developer Community
Comment 6 Fujii Hironori 2019-11-20 20:23:02 PST

> Please try to use /std:c++latest instead of /std:c++17 as it’s about new lambda processor. It also works with /experimental:newLambdaProcessor.
Comment 7 Fujii Hironori 2019-11-20 20:32:22 PST
Created attachment 384024 [details]
Patch for landing
Comment 8 Fujii Hironori 2019-11-20 20:36:04 PST
Committed r252726: <https://trac.webkit.org/changeset/252726>
Comment 9 Radar WebKit Bug Importer 2019-11-20 20:37:24 PST
Comment 10 Ryosuke Niwa 2019-11-20 20:44:08 PST
Oh, thanks for the fix.
Comment 11 Fujii Hironori 2019-11-20 20:51:54 PST
  Bug 187035 – [Win] 'deref': is not a member of 'WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains::<lambda_9d761a6dc12d95db7fa2d6f3f5aa26fa>'
  Bug 184120 – [Win] MSVC can't compile WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent

These were also same.