Bug 175303

Summary: WKPreferences should conform to NSCopying
Product: WebKit Reporter: BJ Burg <bburg>
Component: WebKit APIAssignee: BJ Burg <bburg>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, commit-queue, darin, ggaren, mitz, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
For Landing none

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.