Make maximumParallelReadCount static to fix lambda capture error in WebKit::NetworkCa...
authorwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Feb 2018 19:47:57 +0000 (19:47 +0000)
committerwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Feb 2018 19:47:57 +0000 (19:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=182797
<rdar://problem/37540594>

Reviewed by Tim Horton.

This capture was added in r228455 and causes a build failure when
run with -Wunused-lambda-capture. Xcode also warns about it.

* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::traverse):

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

Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.cpp

index 828df5d..698be28 100644 (file)
@@ -1,3 +1,17 @@
+2018-02-14  John Wilander  <wilander@apple.com>
+
+        Make maximumParallelReadCount static to fix lambda capture error in WebKit::NetworkCache::Storage::traverse()
+        https://bugs.webkit.org/show_bug.cgi?id=182797
+        <rdar://problem/37540594>
+
+        Reviewed by Tim Horton.
+
+        This capture was added in r228455 and causes a build failure when
+        run with -Wunused-lambda-capture. Xcode also warns about it.
+
+        * NetworkProcess/cache/NetworkCacheStorage.cpp:
+        (WebKit::NetworkCache::Storage::traverse):
+
 2018-02-14  Ryosuke Niwa  <rniwa@webkit.org>
 
         EventDispatcher::wheelEvent uses a wrong enum values in switch
index aabced0..842b182 100644 (file)
@@ -907,8 +907,8 @@ void Storage::traverse(const String& type, TraverseFlags flags, TraverseHandler&
                 traverseOperation.activeCondition.notifyOne();
             });
 
-            const unsigned maximumParallelReadCount = 5;
-            traverseOperation.activeCondition.wait(lock, [&traverseOperation, maximumParallelReadCount] {
+            static const unsigned maximumParallelReadCount = 5;
+            traverseOperation.activeCondition.wait(lock, [&traverseOperation] {
                 return traverseOperation.activeCount <= maximumParallelReadCount;
             });
         });