[Win] MSVC can't compile WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPers...
authorHironori.Fujii@sony.com <Hironori.Fujii@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Apr 2018 17:44:48 +0000 (17:44 +0000)
committerHironori.Fujii@sony.com <Hironori.Fujii@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Apr 2018 17:44:48 +0000 (17:44 +0000)
https://bugs.webkit.org/show_bug.cgi?id=184120

Reviewed by Alex Christensen.

It seems that MSVC can't compile the code using `this` in a
generalized lambda capture in another lambda.

In this case, there is no need to copy `protectedThis` for the
inner lambda. Move `protectedThis` of the outer lambda to the
inner as well as `callback`.

* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
Moved `protectedThis` from the outer lambda to the inner.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230162 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp

index e701137..1f865ac 100644 (file)
@@ -1,3 +1,21 @@
+2018-04-02  Fujii Hironori  <Hironori.Fujii@sony.com>
+
+        [Win] MSVC can't compile WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent
+        https://bugs.webkit.org/show_bug.cgi?id=184120
+
+        Reviewed by Alex Christensen.
+
+        It seems that MSVC can't compile the code using `this` in a
+        generalized lambda capture in another lambda.
+
+        In this case, there is no need to copy `protectedThis` for the
+        inner lambda. Move `protectedThis` of the outer lambda to the
+        inner as well as `callback`.
+
+        * UIProcess/WebResourceLoadStatisticsStore.cpp:
+        (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
+        Moved `protectedThis` from the outer lambda to the inner.
+
 2018-04-02  Dan Bernstein  <mitz@apple.com>
 
         Build fix after r230121
index f6a0789..7fa8910 100644 (file)
@@ -821,7 +821,7 @@ void WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent(ShouldGr
         m_persistentStorage.clear();
         
         if (shouldGrandfather == ShouldGrandfather::Yes)
-            grandfatherExistingWebsiteData([protectedThis = makeRef(*this), callback = WTFMove(callback)]() {
+            grandfatherExistingWebsiteData([protectedThis = WTFMove(protectedThis), callback = WTFMove(callback)]() {
                 callback();
             });
         else {