Bug 175303 - WKPreferences should conform to NSCopying
Summary: WKPreferences should conform to NSCopying
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: BJ Burg
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-08-07 16:29 PDT by BJ Burg
Modified: 2017-08-10 13:34 PDT (History)
7 users (show)

See Also:


Attachments
Patch (14.63 KB, patch)
2017-08-08 14:49 PDT, BJ Burg
no flags Details | Formatted Diff | Diff
Patch (10.27 KB, patch)
2017-08-09 12:46 PDT, BJ Burg
no flags Details | Formatted Diff | Diff
Patch (10.39 KB, patch)
2017-08-09 15:07 PDT, BJ Burg
no flags Details | Formatted Diff | Diff
For Landing (10.50 KB, patch)
2017-08-10 12:51 PDT, BJ Burg
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description BJ Burg 2017-08-07 16:29:31 PDT
I need to copy a shared WKPreferences (that is itself far away from a default WKPreferences) and tweak it for particular web views. This seems like the obvious thing to do.
Comment 1 Radar WebKit Bug Importer 2017-08-07 16:30:43 PDT
<rdar://problem/33764939>
Comment 2 BJ Burg 2017-08-08 14:49:34 PDT
Created attachment 317621 [details]
Patch
Comment 3 mitz 2017-08-08 14:58:12 PDT
Comment on attachment 317621 [details]
Patch

Not sure it’s a good idea to make this copyable, much less so publicly, but if we go ahead with this, I suggest that we implement this by making the underlying C++ object copyable. We shouldn’t have to maintain this extra logic in the Objective-C wrapper.
Comment 4 Tim Horton 2017-08-08 15:01:32 PDT
Comment on attachment 317621 [details]
Patch

Yep, agree. Plus then you could probably use the macros to generate the list instead of doing it manually?
Comment 5 BJ Burg 2017-08-09 12:46:30 PDT
Created attachment 317730 [details]
Patch
Comment 6 BJ Burg 2017-08-09 15:07:07 PDT
Created attachment 317751 [details]
Patch
Comment 7 mitz 2017-08-10 08:14:09 PDT
Comment on attachment 317751 [details]
Patch

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

> Tools/TestWebKitAPI/Tests/WebKit2Cocoa/Copying.mm:48
> +    RetainPtr<WKPreferences> b = adoptNS([a.get() copy]);

Is it necessary to write .get() here?
Comment 8 BJ Burg 2017-08-10 12:50:26 PDT
Comment on attachment 317751 [details]
Patch

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

>> Tools/TestWebKitAPI/Tests/WebKit2Cocoa/Copying.mm:48
>> +    RetainPtr<WKPreferences> b = adoptNS([a.get() copy]);
> 
> Is it necessary to write .get() here?

Apparently not! I forgot about that cast operator. Fixed it.
Comment 9 BJ Burg 2017-08-10 12:51:13 PDT
Created attachment 317836 [details]
For Landing
Comment 10 WebKit Commit Bot 2017-08-10 13:34:43 PDT
Comment on attachment 317836 [details]
For Landing

Clearing flags on attachment: 317836

Committed r220542: <http://trac.webkit.org/changeset/220542>
Comment 11 WebKit Commit Bot 2017-08-10 13:34:45 PDT
All reviewed patches have been landed.  Closing bug.