Bug 178840 - Move WKWebViewConfiguration validation to WKWebView construction
Summary: Move WKWebViewConfiguration validation to WKWebView construction
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-10-25 18:12 PDT by Alex Christensen
Modified: 2017-11-15 12:43 PST (History)
3 users (show)

See Also:


Attachments
Patch (12.53 KB, patch)
2017-10-25 18:15 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (12.82 KB, patch)
2017-10-26 12:00 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (12.65 KB, patch)
2017-10-26 12:33 PDT, Alex Christensen
thorton: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Christensen 2017-10-25 18:12:22 PDT
Move WKWebViewConfiguration validation to WKWebView construction
Comment 1 Alex Christensen 2017-10-25 18:15:38 PDT
Created attachment 324935 [details]
Patch
Comment 2 Anders Carlsson 2017-10-26 08:03:38 PDT
Comment on attachment 324935 [details]
Patch

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

> Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:484
> +    if (![_configuration processPool])
> +        [NSException raise:NSInvalidArgumentException format:@"configuration.processPool is nil"];
> +    
> +    if (![_configuration preferences])
> +        [NSException raise:NSInvalidArgumentException format:@"configuration.preferences is nil"];
> +    
> +    if (![_configuration userContentController])
> +        [NSException raise:NSInvalidArgumentException format:@"configuration.userContentController is nil"];
> +    
> +    if (![_configuration websiteDataStore])
> +        [NSException raise:NSInvalidArgumentException format:@"configuration.websiteDataStore is nil"];
> +    
> +    if (![_configuration _visitedLinkStore])
> +        [NSException raise:NSInvalidArgumentException format:@"configuration._visitedLinkStore is nil"];
> +    
> +#if PLATFORM(IOS)
> +    if (![_configuration _contentProviderRegistry])
> +        [NSException raise:NSInvalidArgumentException format:@"configuration._contentProviderRegistry is nil"];
> +#endif

I still think you should put this in a separate method.
Comment 3 Alex Christensen 2017-10-26 12:00:34 PDT
Created attachment 325037 [details]
Patch
Comment 4 Alex Christensen 2017-10-26 12:33:38 PDT
Created attachment 325041 [details]
Patch
Comment 5 Tim Horton 2017-10-26 16:38:46 PDT
Comment on attachment 325041 [details]
Patch

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

> Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:450
> +- (void)_validateConfiguration:(WKWebViewConfiguration *)configuration

maybe this can just be a free function?

> Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewConfiguration.mm:52
> +        [configuration setProcessPool: nil];

No spaces after colons!
Comment 6 Alex Christensen 2017-10-26 17:00:13 PDT
http://trac.webkit.org/r224071
Comment 7 Radar WebKit Bug Importer 2017-11-15 12:43:59 PST
<rdar://problem/35568043>