Bug 163393 - REGRESSION(r206189): logs error statements when API::URLRequest is canceled
Summary: REGRESSION(r206189): logs error statements when API::URLRequest is canceled
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: Other
Hardware: PC Linux
: P2 Normal
Assignee: Michael Catanzaro
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-13 10:18 PDT by Michael Catanzaro
Modified: 2016-10-17 10:51 PDT (History)
5 users (show)

See Also:


Attachments
Patch (1.60 KB, patch)
2016-10-13 10:19 PDT, Michael Catanzaro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Catanzaro 2016-10-13 10:18:25 PDT
r206189 "Add new logging for network resource loading" added a new error in WebLoaderStrategy::loadResource:

RELEASE_LOG_ERROR_IF_ALLOWED(frame, "loadResource: Unable to create SubresourceLoader (frame = %p", &frame);

However, this error statement is hit during normal operation when there is no error, whenever a load is canceled by changing the URL of an API::URLRequest to NULL during a willSendRequestForFrame callback (see InjectedBundlePageResourceLoadClient::willSendRequestForFrame). For example, the error statement is printed once each time Epiphany's adblocker blocks an ad.

Either (a) WebLoaderStrategy::loadResource should never be called when the load has already been canceled, or (b) WebLoaderStrategy::loadResource should not print an error in this case. Not sure which way is correct, but I don't plan to investigate (a) so here is a patch to do (b).
Comment 1 Michael Catanzaro 2016-10-13 10:19:49 PDT
Created attachment 291489 [details]
Patch
Comment 2 Keith Rollin 2016-10-13 10:35:20 PDT
Makes sense to me. Looking deeper, I can see that there are many checks in the creation of a SubresourceLoader that could cause it to return false/null.

Adding Antti, who reviewed the original patch.
Comment 3 WebKit Commit Bot 2016-10-17 10:51:56 PDT
Comment on attachment 291489 [details]
Patch

Clearing flags on attachment: 291489

Committed r207414: <http://trac.webkit.org/changeset/207414>
Comment 4 WebKit Commit Bot 2016-10-17 10:51:59 PDT
All reviewed patches have been landed.  Closing bug.