RESOLVED WONTFIX 174945
Add SPI for returning a modified request in decidePolicyForNavigationAction's decisionHandler
https://bugs.webkit.org/show_bug.cgi?id=174945
Summary Add SPI for returning a modified request in decidePolicyForNavigationAction's...
Alex Christensen
Reported 2017-07-28 11:18:26 PDT
Add SPI for returning a modified request in decidePolicyForNavigationAction's decisionHandler
Attachments
Patch (77.34 KB, patch)
2017-07-28 11:20 PDT, Alex Christensen
no flags
Patch (79.56 KB, patch)
2017-07-28 13:25 PDT, Alex Christensen
achristensen: review-
buildbot: commit-queue-
Archive of layout-test-results from ews115 for mac-elcapitan (1.25 MB, application/zip)
2017-07-28 14:40 PDT, Build Bot
no flags
Alex Christensen
Comment 1 2017-07-28 11:20:02 PDT
Geoffrey Garen
Comment 2 2017-07-28 11:41:04 PDT
/Volumes/Data/EWS/WebKit/Source/WebCore/loader/PolicyChecker.cpp:130:48: error: too few arguments to function call, expected 2, have 1 continueAfterNavigationPolicy(PolicyUse);
Alex Christensen
Comment 3 2017-07-28 13:25:47 PDT
Build Bot
Comment 4 2017-07-28 14:40:30 PDT
Comment on attachment 316673 [details] Patch Attachment 316673 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/4204404 Number of test failures exceeded the failure limit.
Build Bot
Comment 5 2017-07-28 14:40:31 PDT
Created attachment 316674 [details] Archive of layout-test-results from ews115 for mac-elcapitan The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews115 Port: mac-elcapitan Platform: Mac OS X 10.11.6
Darin Adler
Comment 6 2017-07-30 10:16:13 PDT
Comment on attachment 316673 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=316673&action=review I did not review the concept but I did review the copying of ResourceRequest objects. > Source/WebCore/loader/PolicyCallback.h:56 > + void setRequest(ResourceRequest& newRequest) { m_request = newRequest; } I think this should either take a ResourceRequest&& and use WTFMove, or it should take a const ResourceRequest& and always copy. Taking a non-const reference and copying does not seem right. > Source/WebCore/loader/PolicyChecker.cpp:151 > + continueAfterNavigationPolicy(action, newRequest); I think that WTFMove here would avoid copying the ResourceRequest. > Source/WebCore/loader/PolicyChecker.cpp:222 > + callback.setRequest(*newRequest); I think that WTFMove here would allow us to avoid copying the entire ResourceRequest. > Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:834 > + newRequest = navigationDecision.newRequest; Using WTFMove here we could avoid copying the ResourceRequest. > Source/WebKit/WebProcess/WebPage/WebFrame.cpp:256 > + function(action, newRequest); Adding WTFMove here would avoid copying the ResourceRequest.
Alex Christensen
Comment 7 2017-07-31 14:20:26 PDT
Comment on attachment 316673 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=316673&action=review >> Source/WebCore/loader/PolicyCallback.h:56 >> + void setRequest(ResourceRequest& newRequest) { m_request = newRequest; } > > I think this should either take a ResourceRequest&& and use WTFMove, or it should take a const ResourceRequest& and always copy. Taking a non-const reference and copying does not seem right. I think PolicyCallback should be removed and replaced by WTF::Function and lambdas, but not in this patch.
Alex Christensen
Comment 8 2017-12-11 17:32:11 PST
We're not needing this any more
Note You need to log in before you can comment on or make changes to this bug.