Changeset 211175 in webkit


Ignore:
Timestamp:
Jan 25, 2017 3:50:12 PM (7 years ago)
Author:
Wenson Hsieh
Message:

Introduce an item-provider-based pasteboard wrapper
https://bugs.webkit.org/show_bug.cgi?id=167410

Reviewed by Enrica Casucci.

Source/WebCore:

Introduces WebItemProviderPasteboard, a pasteboard-like object backed by a number of item providers. No new
tests, since there is no behavior change.

  • WebCore.xcodeproj/project.pbxproj:
  • platform/ios/AbstractPasteboard.h: Copied from Source/WebCore/platform/spi/ios/UIKitSPI.h.
  • platform/ios/WebItemProviderPasteboard.h: Copied from Source/WebCore/platform/spi/ios/UIKitSPI.h.
  • platform/ios/WebItemProviderPasteboard.mm: Added.

(isRichTextType):
(isStringType):
(isURLType):
(isColorType):
(isImageType):
(+[WebItemProviderPasteboard sharedInstance]):
(-[WebItemProviderPasteboard init]):
(-[WebItemProviderPasteboard dealloc]):
(-[WebItemProviderPasteboard pasteboardTypes]):
(-[WebItemProviderPasteboard setItemProviders:]):
(-[WebItemProviderPasteboard numberOfItems]):
(-[WebItemProviderPasteboard setItems:]):
(-[WebItemProviderPasteboard dataForPasteboardType:inItemSet:]):
(-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):
(-[WebItemProviderPasteboard changeCount]):
(-[WebItemProviderPasteboard itemProviderAtIndex:]):

  • platform/spi/ios/UIKitSPI.h:

Source/WTF:

Adds an additional feature flag.

  • wtf/FeatureDefines.h:
Location:
trunk/Source
Files:
1 added
5 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r211173 r211175  
     12017-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        Introduce an item-provider-based pasteboard wrapper
     4        https://bugs.webkit.org/show_bug.cgi?id=167410
     5
     6        Reviewed by Enrica Casucci.
     7
     8        Adds an additional feature flag.
     9
     10        * wtf/FeatureDefines.h:
     11
    1122017-01-25  Konstantin Tokarev  <annulen@yandex.ru>
    213
  • trunk/Source/WTF/wtf/FeatureDefines.h

    r211168 r211175  
    784784#endif
    785785
     786#if !defined(ENABLE_DATA_INTERACTION)
     787#define ENABLE_DATA_INTERACTION 0
     788#endif
     789
    786790/* Asserts, invariants for macro definitions */
    787791
  • trunk/Source/WebCore/ChangeLog

    r211173 r211175  
     12017-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        Introduce an item-provider-based pasteboard wrapper
     4        https://bugs.webkit.org/show_bug.cgi?id=167410
     5
     6        Reviewed by Enrica Casucci.
     7
     8        Introduces WebItemProviderPasteboard, a pasteboard-like object backed by a number of item providers. No new
     9        tests, since there is no behavior change.
     10
     11        * WebCore.xcodeproj/project.pbxproj:
     12        * platform/ios/AbstractPasteboard.h: Copied from Source/WebCore/platform/spi/ios/UIKitSPI.h.
     13        * platform/ios/WebItemProviderPasteboard.h: Copied from Source/WebCore/platform/spi/ios/UIKitSPI.h.
     14        * platform/ios/WebItemProviderPasteboard.mm: Added.
     15        (isRichTextType):
     16        (isStringType):
     17        (isURLType):
     18        (isColorType):
     19        (isImageType):
     20        (+[WebItemProviderPasteboard sharedInstance]):
     21        (-[WebItemProviderPasteboard init]):
     22        (-[WebItemProviderPasteboard dealloc]):
     23        (-[WebItemProviderPasteboard pasteboardTypes]):
     24        (-[WebItemProviderPasteboard setItemProviders:]):
     25        (-[WebItemProviderPasteboard numberOfItems]):
     26        (-[WebItemProviderPasteboard setItems:]):
     27        (-[WebItemProviderPasteboard dataForPasteboardType:inItemSet:]):
     28        (-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):
     29        (-[WebItemProviderPasteboard changeCount]):
     30        (-[WebItemProviderPasteboard itemProviderAtIndex:]):
     31        * platform/spi/ios/UIKitSPI.h:
     32
    1332017-01-25  Konstantin Tokarev  <annulen@yandex.ru>
    234
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r211161 r211175  
    65076507                F47A5E3E195B8C8A00483100 /* StyleScrollSnapPoints.h in Headers */ = {isa = PBXBuildFile; fileRef = F47A5E3B195B8C8A00483100 /* StyleScrollSnapPoints.h */; settings = {ATTRIBUTES = (Private, ); }; };
    65086508                F47A5E3F195B8E4800483100 /* StyleScrollSnapPoints.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F47A5E3A195B8C8A00483100 /* StyleScrollSnapPoints.cpp */; };
     6509                F48223101E3869B80066FC79 /* WebItemProviderPasteboard.mm in Sources */ = {isa = PBXBuildFile; fileRef = F482230E1E3869B80066FC79 /* WebItemProviderPasteboard.mm */; };
     6510                F48223111E3869B80066FC79 /* WebItemProviderPasteboard.h in Headers */ = {isa = PBXBuildFile; fileRef = F482230F1E3869B80066FC79 /* WebItemProviderPasteboard.h */; };
     6511                F48223131E386E240066FC79 /* AbstractPasteboard.h in Headers */ = {isa = PBXBuildFile; fileRef = F48223121E386E240066FC79 /* AbstractPasteboard.h */; };
    65096512                F4BFB9851E1DDF9B00862C24 /* DumpEditingHistory.js in Copy Scripts */ = {isa = PBXBuildFile; fileRef = F48389831E1DDF2B0076B7EA /* DumpEditingHistory.js */; };
    65106513                F4BFB9861E1DDF9B00862C24 /* EditingHistoryUtil.js in Copy Scripts */ = {isa = PBXBuildFile; fileRef = F48389841E1DDF2B0076B7EA /* EditingHistoryUtil.js */; };
     
    1455914562                F47A5E3A195B8C8A00483100 /* StyleScrollSnapPoints.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StyleScrollSnapPoints.cpp; sourceTree = "<group>"; };
    1456014563                F47A5E3B195B8C8A00483100 /* StyleScrollSnapPoints.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleScrollSnapPoints.h; sourceTree = "<group>"; };
     14564                F482230E1E3869B80066FC79 /* WebItemProviderPasteboard.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebItemProviderPasteboard.mm; sourceTree = "<group>"; };
     14565                F482230F1E3869B80066FC79 /* WebItemProviderPasteboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebItemProviderPasteboard.h; sourceTree = "<group>"; };
     14566                F48223121E386E240066FC79 /* AbstractPasteboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AbstractPasteboard.h; sourceTree = "<group>"; };
    1456114567                F48389831E1DDF2B0076B7EA /* DumpEditingHistory.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = DumpEditingHistory.js; path = Scripts/DumpEditingHistory.js; sourceTree = "<group>"; };
    1456214568                F48389841E1DDF2B0076B7EA /* EditingHistoryUtil.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = EditingHistoryUtil.js; path = Scripts/EditingHistoryUtil.js; sourceTree = "<group>"; };
     
    1977319779                        isa = PBXGroup;
    1977419780                        children = (
     19781                                F48223121E386E240066FC79 /* AbstractPasteboard.h */,
    1977519782                                A148328B187F506800DA63A6 /* wak */,
    1977619783                                2655414B1489AA2B000DFC5D /* CursorIOS.cpp */,
     
    1983719844                                3FBC4AF1189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.mm */,
    1983819845                                E453903C0EAFD637003695C8 /* WidgetIOS.mm */,
     19846                                F482230E1E3869B80066FC79 /* WebItemProviderPasteboard.mm */,
     19847                                F482230F1E3869B80066FC79 /* WebItemProviderPasteboard.h */,
    1983919848                        );
    1984019849                        path = ios;
     
    2523425243                                CE6DADFA1C591E6A003F6A88 /* ContentSecurityPolicyResponseHeaders.h in Headers */,
    2523525244                                CE799FA01C6A4C160097B518 /* ContentSecurityPolicySource.h in Headers */,
     25245                                F48223131E386E240066FC79 /* AbstractPasteboard.h in Headers */,
    2523625246                                CE799F981C6A46BC0097B518 /* ContentSecurityPolicySourceList.h in Headers */,
    2523725247                                CE799FAC1C6A50660097B518 /* ContentSecurityPolicySourceListDirective.h in Headers */,
     
    2776827778                                BC5EB6A30E81DC4F00B25965 /* StyleBackgroundData.h in Headers */,
    2776927779                                BC5EB67B0E81D3BE00B25965 /* StyleBoxData.h in Headers */,
     27780                                F48223111E3869B80066FC79 /* WebItemProviderPasteboard.h in Headers */,
    2777027781                                8386A96D19F61B2E00E1EC4A /* StyleBuilder.h in Headers */,
    2777127782                                83B9687B19F8AB83004EF7AF /* StyleBuilderConverter.h in Headers */,
     
    2922829239                                977B3862122883E900B81FF8 /* CSSPreloadScanner.cpp in Sources */,
    2922929240                                A80E6D050A1989CA007FB8C5 /* CSSPrimitiveValue.cpp in Sources */,
     29241                                F48223101E3869B80066FC79 /* WebItemProviderPasteboard.mm in Sources */,
    2923029242                                A80E6CF70A1989CA007FB8C5 /* CSSProperty.cpp in Sources */,
    2923129243                                78D02BC5154A18DF00B62D05 /* CSSPropertyAnimation.cpp in Sources */,
  • trunk/Source/WebCore/platform/ios/AbstractPasteboard.h

    r211174 r211175  
    11/*
    2  * Copyright (C) 2015 Apple Inc. All rights reserved.
     2 * Copyright (C) 2017 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #if USE(APPLE_INTERNAL_SDK)
     26#import <Foundation/Foundation.h>
    2727
    28 #import <UIKit/UIApplication_Private.h>
    29 #import <UIKit/UIInterface_Private.h>
    30 #import <UIKit/UIScreen_Private.h>
    31 #import <UIKit/UIViewController_Private.h>
     28@protocol AbstractPasteboard <NSObject>
     29@required
    3230
    33 #else
     31@property (readonly, nonatomic) NSInteger numberOfItems;
    3432
    35 #import <UIKit/UIKit.h>
    36 
    37 @interface UIApplication ()
    38 
    39 - (BOOL)_isClassic;
     33- (NSArray<NSString *> *)pasteboardTypes;
     34- (void)setItems:(NSArray *)items;
     35- (NSArray *)dataForPasteboardType:(NSString *)pasteboardType inItemSet:(NSIndexSet *)itemSet;
     36- (NSArray *)valuesForPasteboardType:(NSString *)pasteboardType inItemSet:(NSIndexSet *)itemSet;
     37- (NSInteger)changeCount;
    4038
    4139@end
    42 
    43 @interface UIColor ()
    44 
    45 + (UIColor *)systemBlueColor;
    46 + (UIColor *)systemGrayColor;
    47 + (UIColor *)systemGreenColor;
    48 + (UIColor *)systemOrangeColor;
    49 + (UIColor *)systemPinkColor;
    50 + (UIColor *)systemRedColor;
    51 + (UIColor *)systemYellowColor;
    52 
    53 @end
    54 
    55 @interface UIScreen ()
    56 
    57 @property (nonatomic, readonly) CGRect _referenceBounds;
    58 
    59 @end
    60 
    61 @interface UIViewController ()
    62 + (UIViewController *)viewControllerForView:(UIView *)view;
    63 @end
    64 
    65 #endif
  • trunk/Source/WebCore/platform/ios/WebItemProviderPasteboard.h

    r211174 r211175  
    11/*
    2  * Copyright (C) 2015 Apple Inc. All rights reserved.
     2 * Copyright (C) 2017 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #if USE(APPLE_INTERNAL_SDK)
     26#import "AbstractPasteboard.h"
    2727
    28 #import <UIKit/UIApplication_Private.h>
    29 #import <UIKit/UIInterface_Private.h>
    30 #import <UIKit/UIScreen_Private.h>
    31 #import <UIKit/UIViewController_Private.h>
     28#if ENABLE(DATA_INTERACTION)
    3229
    33 #else
     30OBJC_CLASS UIItemProvider;
    3431
    35 #import <UIKit/UIKit.h>
     32NS_ASSUME_NONNULL_BEGIN
    3633
    37 @interface UIApplication ()
     34WEBCORE_EXPORT @interface WebItemProviderPasteboard : NSObject<AbstractPasteboard>
    3835
    39 - (BOOL)_isClassic;
     36+ (instancetype)sharedInstance;
     37
     38- (UIItemProvider *)itemProviderAtIndex:(NSInteger)index;
     39
     40@property (copy, nonatomic, nullable) NSArray<UIItemProvider *> *itemProviders;
     41@property (readonly, nonatomic) NSInteger numberOfItems;
     42@property (readonly, nonatomic) NSInteger changeCount;
    4043
    4144@end
    4245
    43 @interface UIColor ()
     46NS_ASSUME_NONNULL_END
    4447
    45 + (UIColor *)systemBlueColor;
    46 + (UIColor *)systemGrayColor;
    47 + (UIColor *)systemGreenColor;
    48 + (UIColor *)systemOrangeColor;
    49 + (UIColor *)systemPinkColor;
    50 + (UIColor *)systemRedColor;
    51 + (UIColor *)systemYellowColor;
    52 
    53 @end
    54 
    55 @interface UIScreen ()
    56 
    57 @property (nonatomic, readonly) CGRect _referenceBounds;
    58 
    59 @end
    60 
    61 @interface UIViewController ()
    62 + (UIViewController *)viewControllerForView:(UIView *)view;
    63 @end
    64 
    65 #endif
     48#endif // ENABLE(DATA_INTERACTION)
  • trunk/Source/WebCore/platform/spi/ios/UIKitSPI.h

    r209414 r211175  
    3030#import <UIKit/UIScreen_Private.h>
    3131#import <UIKit/UIViewController_Private.h>
     32
     33#if ENABLE(DATA_INTERACTION)
     34#import <UIKit/UIItemProvider_Private.h>
     35#endif
    3236
    3337#else
Note: See TracChangeset for help on using the changeset viewer.