Bug 163393

Summary: REGRESSION(r206189): logs error statements when API::URLRequest is canceled
Product: WebKit Reporter: Michael Catanzaro <mcatanzaro>
Component: WebKit2Assignee: Michael Catanzaro <mcatanzaro>
Status: RESOLVED FIXED    
Severity: Normal CC: bugs-noreply, commit-queue, koivisto, krollin, mcatanzaro
Priority: P2    
Version: Other   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
Patch none

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.