Changeset 249806 in webkit


Ignore:
Timestamp:
Sep 12, 2019 6:52:59 AM (5 years ago)
Author:
Michael Catanzaro
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:
Location:
trunk/Source/WebKit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r249805 r249806  
     12019-09-12  Michael Catanzaro  <mcatanzaro@igalia.com>
     2
     3        Fix accidental copies in NetworkLoadChecker.cpp
     4        https://bugs.webkit.org/show_bug.cgi?id=199528
     5
     6        Reviewed by Youenn Fablet.
     7
     8        Coverity noticed that we are copying a ResourceRequest and a ContentExtensionResultOrError
     9        in NetworkLoadChecker::checkRequest by mistake, when the intent was to move them as rvalue
     10        references.
     11
     12        * NetworkProcess/NetworkLoadChecker.cpp:
     13        (WebKit::NetworkLoadChecker::checkRequest):
     14        * NetworkProcess/NetworkLoadChecker.h:
     15
    1162019-09-12  Joseph Pecoraro  <pecoraro@apple.com>
    217
  • trunk/Source/WebKit/NetworkProcess/NetworkLoadChecker.cpp

    r249501 r249806  
    226226    ResourceRequest originalRequest = request;
    227227
    228     applyHTTPSUpgradeIfNeeded(WTFMove(request), [this, weakThis = makeWeakPtr(*this), client, handler = WTFMove(handler), originalRequest = WTFMove(originalRequest)](auto request) mutable {
     228    applyHTTPSUpgradeIfNeeded(WTFMove(request), [this, weakThis = makeWeakPtr(*this), client, handler = WTFMove(handler), originalRequest = WTFMove(originalRequest)](auto&& request) mutable {
    229229        if (!weakThis)
    230230            return handler({ ResourceError { ResourceError::Type::Cancellation }});
     
    242242
    243243#if ENABLE(CONTENT_EXTENSIONS)
    244         this->processContentRuleListsForLoad(WTFMove(request), [this, weakThis = WTFMove(weakThis), handler = WTFMove(handler), originalRequest = WTFMove(originalRequest)](auto result) mutable {
     244        this->processContentRuleListsForLoad(WTFMove(request), [this, weakThis = WTFMove(weakThis), handler = WTFMove(handler), originalRequest = WTFMove(originalRequest)](auto&& result) mutable {
    245245            if (!result.has_value()) {
    246246                ASSERT(result.error().isCancellation());
  • trunk/Source/WebKit/NetworkProcess/NetworkLoadChecker.h

    r249714 r249806  
    119119    };
    120120    using ContentExtensionResultOrError = Expected<ContentExtensionResult, WebCore::ResourceError>;
    121     using ContentExtensionCallback = CompletionHandler<void(ContentExtensionResultOrError)>;
     121    using ContentExtensionCallback = CompletionHandler<void(ContentExtensionResultOrError&&)>;
    122122    void processContentRuleListsForLoad(WebCore::ResourceRequest&&, ContentExtensionCallback&&);
    123123#endif
Note: See TracChangeset for help on using the changeset viewer.