Bug 166951 - Add IconLoadingDelegate functionality to WKView
Summary: Add IconLoadingDelegate functionality to WKView
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit API (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brady Eidson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-11 16:40 PST by Brady Eidson
Modified: 2017-01-22 17:12 PST (History)
2 users (show)

See Also:


Attachments
Patch (4.31 KB, patch)
2017-01-11 16:44 PST, Brady Eidson
no flags Details | Formatted Diff | Diff
Patch (5.70 KB, patch)
2017-01-11 17:08 PST, Brady Eidson
no flags Details | Formatted Diff | Diff
Patch (6.40 KB, patch)
2017-01-11 20:03 PST, Brady Eidson
no flags Details | Formatted Diff | Diff
Patch (4.39 KB, patch)
2017-01-11 21:38 PST, Brady Eidson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brady Eidson 2017-01-11 16:40:30 PST
Add IconLoadingDelegate functionality to WKView

This is a followup to https://trac.webkit.org/changeset/209640
Comment 1 Brady Eidson 2017-01-11 16:44:43 PST
Created attachment 298630 [details]
Patch
Comment 2 WebKit Commit Bot 2017-01-11 16:47:40 PST
Attachment 298630 [details] did not pass style-queue:


ERROR: Source/WebKit2/UIProcess/API/mac/WKView.mm:872:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebKit2/UIProcess/API/mac/WKView.mm:872:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/API/mac/WKView.mm:875:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebKit2/UIProcess/API/mac/WKView.mm:875:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 4 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Tim Horton 2017-01-11 16:48:50 PST
Comment on attachment 298630 [details]
Patch

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

> Source/WebKit2/UIProcess/API/mac/WKView.mm:877
> +                    completionHandler([loadCompletionHandler = Block_copy(loadCompletionHandler)](API::Data* data, WebKit::CallbackBase::Error error) {

Plz to BlockPtr.
Comment 4 Brady Eidson 2017-01-11 17:08:46 PST
Created attachment 298636 [details]
Patch
Comment 5 Brady Eidson 2017-01-11 17:09:25 PST
Running EWS before landing
Comment 6 WebKit Commit Bot 2017-01-11 17:11:11 PST
Attachment 298636 [details] did not pass style-queue:


ERROR: Source/WebKit2/UIProcess/API/mac/WKView.mm:873:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebKit2/UIProcess/API/mac/WKView.mm:873:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/API/mac/WKView.mm:876:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebKit2/UIProcess/API/mac/WKView.mm:876:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/API/mac/WKView.mm:878:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 5 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 Brady Eidson 2017-01-11 20:03:47 PST
Created attachment 298654 [details]
Patch
Comment 8 WebKit Commit Bot 2017-01-11 20:05:41 PST
Attachment 298654 [details] did not pass style-queue:


ERROR: Source/WebKit2/UIProcess/API/mac/WKView.mm:873:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebKit2/UIProcess/API/mac/WKView.mm:873:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/API/mac/WKView.mm:876:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebKit2/UIProcess/API/mac/WKView.mm:876:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/API/mac/WKView.mm:878:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 5 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 9 Brady Eidson 2017-01-11 21:38:41 PST
Created attachment 298659 [details]
Patch
Comment 10 WebKit Commit Bot 2017-01-11 21:41:06 PST
Attachment 298659 [details] did not pass style-queue:


ERROR: Source/WebKit2/UIProcess/API/mac/WKView.mm:874:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebKit2/UIProcess/API/mac/WKView.mm:874:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/API/mac/WKView.mm:877:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
ERROR: Source/WebKit2/UIProcess/API/mac/WKView.mm:877:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebKit2/UIProcess/API/mac/WKView.mm:879:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 5 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 11 Brady Eidson 2017-01-11 22:18:00 PST
https://trac.webkit.org/changeset/210624
Comment 12 Darin Adler 2017-01-22 17:12:23 PST
Comment on attachment 298659 [details]
Patch

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

> Source/WebKit2/UIProcess/API/mac/WKView.mm:868
> +            return sel_registerName("_shouldLoadIconWithParameters:completionHandler:");

Doesn’t seem good to keep calling sel_registerName every time this function is called. On a related note, why not use @selector instead of an explicit call to set_registerName?

> Source/WebKit2/UIProcess/API/mac/WKView.mm:872
> +        typedef void (^IconLoadCompletionHandler)(NSData*);

In new code, I suggest using instead of typedef. Also, coding style document says we should use a space between NSData and the *.

> Source/WebKit2/UIProcess/API/mac/WKView.mm:875
> +            RetainPtr<_WKLinkIconParameters> parameters = adoptNS([[_WKLinkIconParameters alloc] _initWithLinkIcon:linkIcon]);

This is an example of a place where auto looks much better to me than writing out RetainPtr<xxx>.

> Source/WebKit2/UIProcess/API/mac/WKView.mm:877
> +            [m_wkView performSelector:delegateSelector() withObject:parameters.get() withObject:^void (IconLoadCompletionHandler loadCompletionHandler) {

Is the ".get() needed here?

> Source/WebKit2/UIProcess/API/mac/WKView.mm:890
> +        WKView *m_wkView;

What guarantees this pointer is not used after the WKView has been deallocated?