Title: [249806] trunk/Source/WebKit
Revision
249806
Author
mcatanz...@igalia.com
Date
2019-09-12 06:52:59 -0700 (Thu, 12 Sep 2019)

Log Message

Fix accidental copies in NetworkLoadChecker.cpp
https://bugs.webkit.org/show_bug.cgi?id=199528

Reviewed by Youenn Fablet.

Coverity noticed that we are copying a ResourceRequest and a ContentExtensionResultOrError
in NetworkLoadChecker::checkRequest by mistake, when the intent was to move them as rvalue
references.

* NetworkProcess/NetworkLoadChecker.cpp:
(WebKit::NetworkLoadChecker::checkRequest):
* NetworkProcess/NetworkLoadChecker.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (249805 => 249806)


--- trunk/Source/WebKit/ChangeLog	2019-09-12 10:59:09 UTC (rev 249805)
+++ trunk/Source/WebKit/ChangeLog	2019-09-12 13:52:59 UTC (rev 249806)
@@ -1,3 +1,18 @@
+2019-09-12  Michael Catanzaro  <mcatanz...@igalia.com>
+
+        Fix accidental copies in NetworkLoadChecker.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=199528
+
+        Reviewed by Youenn Fablet.
+
+        Coverity noticed that we are copying a ResourceRequest and a ContentExtensionResultOrError
+        in NetworkLoadChecker::checkRequest by mistake, when the intent was to move them as rvalue
+        references.
+
+        * NetworkProcess/NetworkLoadChecker.cpp:
+        (WebKit::NetworkLoadChecker::checkRequest):
+        * NetworkProcess/NetworkLoadChecker.h:
+
 2019-09-12  Joseph Pecoraro  <pecor...@apple.com>
 
         Web Inspector: Crashes when intercept response continues with original content

Modified: trunk/Source/WebKit/NetworkProcess/NetworkLoadChecker.cpp (249805 => 249806)


--- trunk/Source/WebKit/NetworkProcess/NetworkLoadChecker.cpp	2019-09-12 10:59:09 UTC (rev 249805)
+++ trunk/Source/WebKit/NetworkProcess/NetworkLoadChecker.cpp	2019-09-12 13:52:59 UTC (rev 249806)
@@ -225,7 +225,7 @@
 {
     ResourceRequest originalRequest = request;
 
-    applyHTTPSUpgradeIfNeeded(WTFMove(request), [this, weakThis = makeWeakPtr(*this), client, handler = WTFMove(handler), originalRequest = WTFMove(originalRequest)](auto request) mutable {
+    applyHTTPSUpgradeIfNeeded(WTFMove(request), [this, weakThis = makeWeakPtr(*this), client, handler = WTFMove(handler), originalRequest = WTFMove(originalRequest)](auto&& request) mutable {
         if (!weakThis)
             return handler({ ResourceError { ResourceError::Type::Cancellation }});
 
@@ -241,7 +241,7 @@
         }
 
 #if ENABLE(CONTENT_EXTENSIONS)
-        this->processContentRuleListsForLoad(WTFMove(request), [this, weakThis = WTFMove(weakThis), handler = WTFMove(handler), originalRequest = WTFMove(originalRequest)](auto result) mutable {
+        this->processContentRuleListsForLoad(WTFMove(request), [this, weakThis = WTFMove(weakThis), handler = WTFMove(handler), originalRequest = WTFMove(originalRequest)](auto&& result) mutable {
             if (!result.has_value()) {
                 ASSERT(result.error().isCancellation());
                 handler(WTFMove(result.error()));

Modified: trunk/Source/WebKit/NetworkProcess/NetworkLoadChecker.h (249805 => 249806)


--- trunk/Source/WebKit/NetworkProcess/NetworkLoadChecker.h	2019-09-12 10:59:09 UTC (rev 249805)
+++ trunk/Source/WebKit/NetworkProcess/NetworkLoadChecker.h	2019-09-12 13:52:59 UTC (rev 249806)
@@ -118,7 +118,7 @@
         const WebCore::ContentRuleListResults& results;
     };
     using ContentExtensionResultOrError = Expected<ContentExtensionResult, WebCore::ResourceError>;
-    using ContentExtensionCallback = CompletionHandler<void(ContentExtensionResultOrError)>;
+    using ContentExtensionCallback = CompletionHandler<void(ContentExtensionResultOrError&&)>;
     void processContentRuleListsForLoad(WebCore::ResourceRequest&&, ContentExtensionCallback&&);
 #endif
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to