Changeset 220542 in webkit


Ignore:
Timestamp:
Aug 10, 2017 1:34:40 PM (7 years ago)
Author:
BJ Burg
Message:

WKPreferences should conform to NSCopying
https://bugs.webkit.org/show_bug.cgi?id=175303
<rdar://problem/33764939>

Reviewed by Dan Bernstein.

Source/WebKit:

  • UIProcess/API/Cocoa/WKPreferencesPrivate.h:

Add conformance in the private header, as there is not consensus that this
needs to be API.

  • UIProcess/API/Cocoa/WKPreferences.mm:

(-[WKPreferences copyWithZone:]):
Copy the wrapped WebPreferences instance and return its wrapper.

Tools:

Add unit test to make sure a WKPreference and its copy are
not aliased to each other or affect each other's properties.

  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
  • TestWebKitAPI/Tests/WebKit2Cocoa/Copying.mm: Added.

(TEST):

Location:
trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r220540 r220542  
     12017-08-10  Brian Burg  <bburg@apple.com>
     2
     3        WKPreferences should conform to NSCopying
     4        https://bugs.webkit.org/show_bug.cgi?id=175303
     5        <rdar://problem/33764939>
     6
     7        Reviewed by Dan Bernstein.
     8
     9        * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
     10        Add conformance in the private header, as there is not consensus that this
     11        needs to be API.
     12
     13        * UIProcess/API/Cocoa/WKPreferences.mm:
     14        (-[WKPreferences copyWithZone:]):
     15        Copy the wrapped WebPreferences instance and return its wrapper.
     16
    1172017-08-10  Michael Catanzaro  <mcatanzaro@igalia.com>
    218
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm

    r220309 r220542  
    8989}
    9090
     91- (id)copyWithZone:(NSZone *)zone
     92{
     93    return wrapper(_preferences->copy().leakRef());
     94}
     95
    9196- (CGFloat)minimumFontSize
    9297{
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferencesPrivate.h

    r220309 r220542  
    4848
    4949@class _WKExperimentalFeature;
     50
     51@interface WKPreferences () <NSCopying>
     52@end
    5053
    5154@interface WKPreferences (WKPrivate)
  • trunk/Tools/ChangeLog

    r220538 r220542  
     12017-08-10  Brian Burg  <bburg@apple.com>
     2
     3        WKPreferences should conform to NSCopying
     4        https://bugs.webkit.org/show_bug.cgi?id=175303
     5        <rdar://problem/33764939>
     6
     7        Reviewed by Dan Bernstein.
     8
     9        Add unit test to make sure a WKPreference and its copy are
     10        not aliased to each other or affect each other's properties.
     11
     12        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
     13        * TestWebKitAPI/Tests/WebKit2Cocoa/Copying.mm: Added.
     14        (TEST):
     15
    1162017-08-10  Tim Horton  <timothy_horton@apple.com>
    217
  • trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj

    r220536 r220542  
    524524                9984FACC1CFFAF60008D198C /* WKWebViewTextInput.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9984FACA1CFFAEEE008D198C /* WKWebViewTextInput.mm */; };
    525525                9984FACE1CFFB090008D198C /* editable-body.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 9984FACD1CFFB038008D198C /* editable-body.html */; };
     526                9999108B1F393C96008AD455 /* Copying.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9999108A1F393C8B008AD455 /* Copying.mm */; };
    526527                9B0786A51C5885C300D159E3 /* InjectedBundleMakeAllShadowRootsOpen_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9B0786A41C5885C300D159E3 /* InjectedBundleMakeAllShadowRootsOpen_Bundle.cpp */; };
    527528                9B19CDA01F06DFE3000548DD /* NetworkProcessCrashWithPendingConnection.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9B19CD9E1F06DFE3000548DD /* NetworkProcessCrashWithPendingConnection.mm */; };
     
    14301431                9984FACA1CFFAEEE008D198C /* WKWebViewTextInput.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKWebViewTextInput.mm; sourceTree = "<group>"; };
    14311432                9984FACD1CFFB038008D198C /* editable-body.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "editable-body.html"; sourceTree = "<group>"; };
     1433                9999108A1F393C8B008AD455 /* Copying.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Copying.mm; sourceTree = "<group>"; };
    14321434                9B0786A21C58830F00D159E3 /* InjectedBundleMakeAllShadowRootsOpen.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleMakeAllShadowRootsOpen.cpp; sourceTree = "<group>"; };
    14331435                9B0786A41C5885C300D159E3 /* InjectedBundleMakeAllShadowRootsOpen_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleMakeAllShadowRootsOpen_Bundle.cpp; sourceTree = "<group>"; };
     
    18771879                                A14FC5891B89927100D107EB /* ContentFilteringPlugIn.mm */,
    18781880                                5C2936911D5BF63E00DEAB1E /* CookieAcceptPolicy.mm */,
     1881                                9999108A1F393C8B008AD455 /* Copying.mm */,
    18791882                                2DC4CF761D2D9DD800ECCC94 /* DataDetection.mm */,
    18801883                                CEC16EA41EE863BF00DE479A /* DecidePolicyForNavigationAction.mm */,
     
    33163319                                7CCE7F1B1A411AE600447C4C /* WillLoad.cpp in Sources */,
    33173320                                7CCE7ED71A411A7E00447C4C /* WillPerformClientRedirectToURLCrash.mm in Sources */,
     3321                                9999108B1F393C96008AD455 /* Copying.mm in Sources */,
    33183322                                7CCE7F1C1A411AE600447C4C /* WillSendSubmitEvent.cpp in Sources */,
    33193323                                7CCE7ED81A411A7E00447C4C /* WillSendSubmitEvent.mm in Sources */,
Note: See TracChangeset for help on using the changeset viewer.