Bug 145417

Summary: Add a "should open urls externally" flag to DocumentLoader
Product: WebKit Reporter: Brady Eidson <beidson>
Component: WebCore Misc.Assignee: Brady Eidson <beidson>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, ggaren, japhet, mitz
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 145280    
Attachments:
Description Flags
Patch v1
ggaren: review+
Patch for EWS/Landing commit-queue: commit-queue-

Description Brady Eidson 2015-05-27 15:44:44 PDT
Add a "should open urls externally" flag to DocumentLoader.

The flag will optionally be set by the WebKit client in a loading API
The flag will propagate down to the DocumentLoader via FrameLoadRequest.
The flag will bubble back out to WebKit navigation delegate API for policy decisions.

As far as WebCore/WebKit is concerned, this patch will not introduce any behavior change.

As discussed in blocked bug https://bugs.webkit.org/show_bug.cgi?id=145280, the followup patch will make more extensive changes to WebCore and will be testable.
Comment 1 Brady Eidson 2015-05-27 16:05:31 PDT
Created attachment 253810 [details]
Patch v1
Comment 2 WebKit Commit Bot 2015-05-27 16:08:02 PDT
Attachment 253810 [details] did not pass style-queue:


ERROR: Source/WebCore/loader/DocumentLoader.h:181:  The parameter name "action" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:78:  Alphabetical sorting problem.  [build/include_order] [4]
ERROR: Source/WebKit2/UIProcess/WebPageProxy.h:355:  The parameter name "openURLsExternallyPolicy" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/WebKit2/UIProcess/API/Cocoa/WKBrowsingContextController.mm:48:  Alphabetical sorting problem.  [build/include_order] [4]
Total errors found: 4 in 24 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Geoffrey Garen 2015-05-27 16:18:37 PDT
Comment on attachment 253810 [details]
Patch v1

View in context: https://bugs.webkit.org/attachment.cgi?id=253810&action=review

I'm a bit concerned that we have three phrases for the same thing:
_web_isUserInitiated
OpenURLsExternallyPolicy
shouldOpenURLsExternally

Can we get this down to one phrase?

> Source/WebCore/loader/DocumentLoader.cpp:1560
> +        m_triggeringAction.setOpenURLsExternallyPolicy(m_openURLsExternallyPolicy);

When I first read "shouldOpenURLsExternally", it struck me as saying "all URLs should open externally", which wasn't your intent. 

shouldOpenExternalURLs?
Comment 4 Brady Eidson 2015-05-27 16:25:08 PDT
(In reply to comment #3)
> Comment on attachment 253810 [details]
> Patch v1
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=253810&action=review
> 
> I'm a bit concerned that we have three phrases for the same thing:
> _web_isUserInitiated
> OpenURLsExternallyPolicy
> shouldOpenURLsExternally
> 
> Can we get this down to one phrase?

Maybe.

> When I first read "shouldOpenURLsExternally", it struck me as saying "all
> URLs should open externally", which wasn't your intent. 
> 
> shouldOpenExternalURLs?

ShouldOpenExternalURLsPolicy for internal use, shouldOpenExternalURLs for the API layer?
Comment 5 Brady Eidson 2015-05-27 16:54:00 PDT
Created attachment 253818 [details]
Patch for EWS/Landing
Comment 6 WebKit Commit Bot 2015-05-27 19:15:18 PDT
Comment on attachment 253818 [details]
Patch for EWS/Landing

Rejecting attachment 253818 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.appspot.com', '--bot-id=webkit-cq-01', 'apply-attachment', '--no-update', '--non-interactive', 253818, '--port=mac']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

Last 500 characters of output:
ubmit
    return self.open(self.click(*args, **kwds))
  File "/Volumes/Data/EWS/WebKit/Tools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_mechanize.py", line 203, in open
    return self._mech_open(url, data, timeout=timeout)
  File "/Volumes/Data/EWS/WebKit/Tools/Scripts/webkitpy/thirdparty/autoinstalled/mechanize/_mechanize.py", line 255, in _mech_open
    raise response
webkitpy.thirdparty.autoinstalled.mechanize._response.httperror_seek_wrapper: HTTP Error 500: Internal Server Error

Full output: http://webkit-queues.appspot.com/results/5598173376544768
Comment 7 Brady Eidson 2015-05-27 20:53:20 PDT
(In reply to comment #6)
> Comment on attachment 253818 [details]
> Patch for EWS/Landing
> 
> Rejecting attachment 253818 [details] from commit-queue.
> 
> Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch',
> '--status-host=webkit-queues.appspot.com', '--bot-id=webkit-cq-01',
> 'apply-attachment', '--no-update', '--non-interactive', 253818,
> '--port=mac']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit
> 
> Last 500 characters of output:
> ubmit
>     return self.open(self.click(*args, **kwds))
>   File
> "/Volumes/Data/EWS/WebKit/Tools/Scripts/webkitpy/thirdparty/autoinstalled/
> mechanize/_mechanize.py", line 203, in open
>     return self._mech_open(url, data, timeout=timeout)
>   File
> "/Volumes/Data/EWS/WebKit/Tools/Scripts/webkitpy/thirdparty/autoinstalled/
> mechanize/_mechanize.py", line 255, in _mech_open
>     raise response
> webkitpy.thirdparty.autoinstalled.mechanize._response.httperror_seek_wrapper:
> HTTP Error 500: Internal Server Error
> 
> Full output: http://webkit-queues.appspot.com/results/5598173376544768


This clearly looks like bogusness on the bot side.
Comment 8 Brady Eidson 2015-05-27 21:53:18 PDT
http://trac.webkit.org/changeset/184941