⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 184047 in webkit


Ignore:
Timestamp:
May 10, 2015, 11:29:59 AM (11 years ago)
Author:
Darin Adler
Message:

[Cocoa] Don't soft link DataDetectorsCore
https://bugs.webkit.org/show_bug.cgi?id=144837

Reviewed by Dan Bernstein.

Source/WebCore:

Linking this in the normal way should slightly speed up the web process
startup time. We don't need to soft link it: It's present in the
OS X base system and there is no reference cycle with WebKit.

  • Configurations/WebCore.xcconfig: Added PrivateFrameworks to

FRAMEWORK_SEARCH_PATHS for Mac and added DataDetectorsCore to
OTHER_LDFLAGS_PLATFORM for Mac. We may want to do this later for iOS too.

  • WebCore.xcodeproj/project.pbxproj: Added DataDetectorsCoreSPI.h.
  • editing/mac/DataDetection.mm:

(WebCore::DataDetection::detectItemAroundHitTestResult): Removed check to see
if DataDetectorsCore is available.

  • page/mac/ServicesOverlayController.h: Simplified a forward declaration to

only declare what we actually use.

  • page/mac/ServicesOverlayController.mm: Moved SOFT_LINK from here to the

DataDetectorsSPI.h header.

  • platform/spi/cocoa/DataDetectorsCoreSPI.h: Added. This is the low level

DataDetectorsCore framework, which has no reference cycle with WebKit, and
which we can link to normally. Moved the content here from DataDetectorsSPI.h,
added a USE(APPLE_INTERNAL_SDK) path that uses the system headers, and fixed
the incorrect return type on DDScannerScanQuery, which was detected when
using the system headers in conjunction with this file.

  • platform/spi/mac/DataDetectorsSPI.h: Removed the content of this file that

was actually about DataDetectorsCore. Also added a USE(APPLE_INTERNAL_SDK)
path that uses the system headers and moved a few stray DataDetectors SPI
definitions from elsewhere into this header.

Source/WebKit2:

  • Platform/mac/MenuUtilities.mm: Use DataDetectorsSPI.h instead of doing it here.
  • WebProcess/WebPage/mac/WebPageMac.mm: Removed unneeded include of unused header,

DataDetectorsSPI.h.

Location:
trunk/Source
Files:
1 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r184046 r184047  
     12015-05-10  Darin Adler  <darin@apple.com>
     2
     3        [Cocoa] Don't soft link DataDetectorsCore
     4        https://bugs.webkit.org/show_bug.cgi?id=144837
     5
     6        Reviewed by Dan Bernstein.
     7
     8        Linking this in the normal way should slightly speed up the web process
     9        startup time. We don't need to soft link it: It's present in the
     10        OS X base system and there is no reference cycle with WebKit.
     11
     12        * Configurations/WebCore.xcconfig: Added PrivateFrameworks to
     13        FRAMEWORK_SEARCH_PATHS for Mac and added DataDetectorsCore to
     14        OTHER_LDFLAGS_PLATFORM for Mac. We may want to do this later for iOS too.
     15
     16        * WebCore.xcodeproj/project.pbxproj: Added DataDetectorsCoreSPI.h.
     17
     18        * editing/mac/DataDetection.mm:
     19        (WebCore::DataDetection::detectItemAroundHitTestResult): Removed check to see
     20        if DataDetectorsCore is available.
     21
     22        * page/mac/ServicesOverlayController.h: Simplified a forward declaration to
     23        only declare what we actually use.
     24        * page/mac/ServicesOverlayController.mm: Moved SOFT_LINK from here to the
     25        DataDetectorsSPI.h header.
     26
     27        * platform/spi/cocoa/DataDetectorsCoreSPI.h: Added. This is the low level
     28        DataDetectorsCore framework, which has no reference cycle with WebKit, and
     29        which we can link to normally. Moved the content here from DataDetectorsSPI.h,
     30        added a USE(APPLE_INTERNAL_SDK) path that uses the system headers, and fixed
     31        the incorrect return type on DDScannerScanQuery, which was detected when
     32        using the system headers in conjunction with this file.
     33
     34        * platform/spi/mac/DataDetectorsSPI.h: Removed the content of this file that
     35        was actually about DataDetectorsCore. Also added a USE(APPLE_INTERNAL_SDK)
     36        path that uses the system headers and moved a few stray DataDetectors SPI
     37        definitions from elsewhere into this header.
     38
    1392015-05-10  Chris Fleizach  <cfleizach@apple.com>
    240
  • trunk/Source/WebCore/Configurations/WebCore.xcconfig

    r183929 r184047  
    3131FRAMEWORK_SEARCH_PATHS_ios_Release = $(FRAMEWORK_SEARCH_PATHS_ios_Debug);
    3232FRAMEWORK_SEARCH_PATHS_ios_Production = $(PRODUCTION_FRAMEWORKS_DIR);
    33 FRAMEWORK_SEARCH_PATHS[sdk=macosx*] = $(STAGED_FRAMEWORKS_SEARCH_PATH) $(FRAMEWORK_SEARCH_PATHS);
     33FRAMEWORK_SEARCH_PATHS[sdk=macosx*] = $(STAGED_FRAMEWORKS_SEARCH_PATH) $(FRAMEWORK_SEARCH_PATHS) $(SDKROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks;
    3434
    3535OTHER_CFLAGS = $(inherited) -iframework $(SDKROOT)$(SYSTEM_LIBRARY_DIR)/Frameworks/Carbon.framework/Frameworks -iframework $(SDKROOT)$(SYSTEM_LIBRARY_DIR)/Frameworks/ApplicationServices.framework/Frameworks -iframework $(SDKROOT)$(SYSTEM_LIBRARY_DIR)/Frameworks/CoreServices.framework/Frameworks -iframework $(SDKROOT)$(SYSTEM_LIBRARY_DIR)/Frameworks/Quartz.framework/Frameworks -iframework $(SDKROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks;
     
    5858OTHER_LDFLAGS_PLATFORM[sdk=iphoneos*] = $(OTHER_LDFLAGS_BASE_ios) -framework IOSurface;
    5959OTHER_LDFLAGS_PLATFORM[sdk=iphonesimulator*] = $(OTHER_LDFLAGS_BASE_ios);
    60 OTHER_LDFLAGS_PLATFORM[sdk=macosx*] = $(OTHER_LDFLAGS_BASE) -sub_library libobjc -umbrella WebKit -allowable_client WebCoreTestSupport -allowable_client WebKit2 -allowable_client WebKitLegacy -framework ApplicationServices -framework AudioUnit -framework Carbon -framework Cocoa -framework IOSurface -framework OpenGL;
     60OTHER_LDFLAGS_PLATFORM[sdk=macosx*] = $(OTHER_LDFLAGS_BASE) -sub_library libobjc -umbrella WebKit -allowable_client WebCoreTestSupport -allowable_client WebKit2 -allowable_client WebKitLegacy -framework ApplicationServices -framework AudioUnit -framework Carbon -framework Cocoa -framework DataDetectorsCore -framework IOSurface -framework OpenGL;
    6161
    6262SECTORDER_FLAGS = $(SECTORDER_FLAGS_$(CONFIGURATION));
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r184042 r184047  
    33813381                935C477009AC4D7300A6AAB4 /* KeyEventMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 935C476E09AC4D7300A6AAB4 /* KeyEventMac.mm */; };
    33823382                935C477509AC4D8E00A6AAB4 /* GapRects.h in Headers */ = {isa = PBXBuildFile; fileRef = 935C477409AC4D8D00A6AAB4 /* GapRects.h */; settings = {ATTRIBUTES = (Private, ); }; };
     3383                935E2B4E1AFF06CA00976F9F /* DataDetectorsCoreSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 935E2B4D1AFF06CA00976F9F /* DataDetectorsCoreSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
    33833384                935F45420F7C3B5F00D7C1FB /* JSLazyEventListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 935F45400F7C3B5F00D7C1FB /* JSLazyEventListener.cpp */; };
    33843385                935F45430F7C3B5F00D7C1FB /* JSLazyEventListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 935F45410F7C3B5F00D7C1FB /* JSLazyEventListener.h */; };
     
    1065010651                935C476E09AC4D7300A6AAB4 /* KeyEventMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KeyEventMac.mm; sourceTree = "<group>"; };
    1065110652                935C477409AC4D8D00A6AAB4 /* GapRects.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GapRects.h; sourceTree = "<group>"; };
     10653                935E2B4D1AFF06CA00976F9F /* DataDetectorsCoreSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataDetectorsCoreSPI.h; sourceTree = "<group>"; };
    1065210654                935F45400F7C3B5F00D7C1FB /* JSLazyEventListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSLazyEventListener.cpp; sourceTree = "<group>"; };
    1065310655                935F45410F7C3B5F00D7C1FB /* JSLazyEventListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSLazyEventListener.h; sourceTree = "<group>"; };
     
    1653716539                                CD4097FF1A8C855F004C65E9 /* CFNSURLConnectionSPI.h */,
    1653816540                                1C5E980F1A02CEFA002DB55F /* CoreTextSPI.h */,
     16541                                935E2B4D1AFF06CA00976F9F /* DataDetectorsCoreSPI.h */,
    1653916542                                CE12524A1A16C79B00864480 /* DispatchSPI.h */,
    1654016543                                CE1252441A16C22500864480 /* DynamicLinkerSPI.h */,
     
    2422924232                                E47E276516036ED200EE2AFB /* DocumentStyleSheetCollection.h in Headers */,
    2423024233                                0B90561A0F2578BF0095FF6A /* DocumentThreadableLoader.h in Headers */,
     24234                                935E2B4E1AFF06CA00976F9F /* DataDetectorsCoreSPI.h in Headers */,
    2423124235                                86D982F7125C154000AD9E3D /* DocumentTiming.h in Headers */,
    2423224236                                A8185F3909765766005826D9 /* DocumentType.h in Headers */,
  • trunk/Source/WebCore/editing/mac/DataDetection.mm

    r183286 r184047  
    4444RetainPtr<DDActionContext> DataDetection::detectItemAroundHitTestResult(const HitTestResult& hitTestResult, FloatRect& detectedDataBoundingBox, RefPtr<Range>& detectedDataRange)
    4545{
    46     if (!DataDetectorsLibrary() || !DataDetectorsCoreLibrary())
     46    if (!DataDetectorsLibrary())
    4747        return nullptr;
    4848
  • trunk/Source/WebCore/page/mac/ServicesOverlayController.h

    r182068 r184047  
    3535#include <wtf/RefCounted.h>
    3636
    37 typedef struct __DDHighlight DDHighlight, *DDHighlightRef;
     37typedef struct __DDHighlight *DDHighlightRef;
    3838
    3939namespace WebCore {
  • trunk/Source/WebCore/page/mac/ServicesOverlayController.mm

    r182088 r184047  
    5454const float highlightFadeAnimationDuration = 0.3;
    5555
    56 // FIXME: Move more of this to DataDetectorsSPI.h.
    57 SOFT_LINK(DataDetectors, DDHighlightCreateWithRectsInVisibleRectWithStyleAndDirection, DDHighlightRef, (CFAllocatorRef allocator, CGRect* rects, CFIndex count, CGRect globalVisibleRect, DDHighlightStyle style, Boolean withArrow, NSWritingDirection writingDirection, Boolean endsWithEOL, Boolean flipped), (allocator, rects, count, globalVisibleRect, style, withArrow, writingDirection, endsWithEOL, flipped))
    58 SOFT_LINK(DataDetectors, DDHighlightGetLayerWithContext, CGLayerRef, (DDHighlightRef highlight, CGContextRef context), (highlight, context))
    59 SOFT_LINK(DataDetectors, DDHighlightGetBoundingRect, CGRect, (DDHighlightRef highlight), (highlight))
    60 SOFT_LINK(DataDetectors, DDHighlightPointIsOnHighlight, Boolean, (DDHighlightRef highlight, CGPoint point, Boolean* onButton), (highlight, point, onButton))
    61 
    6256namespace WebCore {
    6357
  • trunk/Source/WebCore/platform/spi/mac/DataDetectorsSPI.h

    r177303 r184047  
    11/*
    2  * Copyright (C) 2014 Apple Inc. All rights reserved.
     2 * Copyright (C) 2014-2015 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #import "SoftLinking.h"
    27 #import <objc/runtime.h>
     26#import <WebCore/DataDetectorsCoreSPI.h>
     27#import <WebCore/SoftLinking.h>
    2828
    29 // FIXME: This header should include various DataDetectors SPI headers if using the internal SDK.
     29#if USE(APPLE_INTERNAL_SDK)
    3030
    31 typedef struct __DDScanner DDScanner, *DDScannerRef;
    32 typedef struct __DDScanQuery *DDScanQueryRef;
    33 typedef struct __DDResult *DDResultRef;
    34 typedef struct __DDHighlight DDHighlight, *DDHighlightRef;
     31// Can't include DDAction.h because as of this writing it is a private header that includes a non-private header with an "" include.
     32#import <DataDetectors/DDActionContext.h>
     33#import <DataDetectors/DDActionsManager.h>
     34#import <DataDetectors/DDHighlightDrawing.h>
    3535
    36 typedef enum {
    37     DDScannerTypeStandard = 0,
    38 } DDScannerType;
    39 
    40 enum {
    41     DDScannerOptionStopAtFirstMatch = 1,
    42 };
    43 typedef CFIndex DDScannerOptions;
    44 
    45 enum {
    46     DDScannerCopyResultsOptionsNone = 0,
    47     DDScannerCopyResultsOptionsNoOverlap = 1 << 0,
    48 };
    49 typedef CFIndex DDScannerCopyResultsOptions;
    50 
    51 SOFT_LINK_PRIVATE_FRAMEWORK_OPTIONAL(DataDetectors)
    52 SOFT_LINK_PRIVATE_FRAMEWORK_OPTIONAL(DataDetectorsCore)
    53 
    54 extern "C" {
    55 
    56 SOFT_LINK(DataDetectorsCore, DDScannerCreate, DDScannerRef, (DDScannerType type, DDScannerOptions options, CFErrorRef* errorRef), (type, options, errorRef))
    57 SOFT_LINK(DataDetectorsCore, DDScanQueryCreateFromString, DDScanQueryRef, (CFAllocatorRef allocator, CFStringRef string, CFRange range), (allocator, string, range))
    58 SOFT_LINK(DataDetectorsCore, DDScannerScanQuery, DDScanQueryRef, (DDScannerRef scanner, DDScanQueryRef query), (scanner, query))
    59 SOFT_LINK(DataDetectorsCore, DDScannerCopyResultsWithOptions, CFArrayRef, (DDScannerRef scanner, DDScannerCopyResultsOptions options), (scanner, options))
    60 SOFT_LINK(DataDetectorsCore, DDResultGetRange, CFRange, (DDResultRef result), (result))
    61 SOFT_LINK(DataDetectorsCore, DDResultGetType, CFStringRef, (DDResultRef result), (result))
    62 
    63 }
    64 
    65 #if PLATFORM(MAC)
    66 SOFT_LINK_CLASS(DataDetectors, DDActionContext)
     36#else // !USE(APPLE_INTERNAL_SDK)
    6737
    6838@interface DDActionContext : NSObject <NSCopying, NSSecureCoding>
     
    7545
    7646- (DDActionContext *)contextForView:(NSView *)view altMode:(BOOL)altMode interactionStartedHandler:(void (^)(void))interactionStartedHandler interactionChangedHandler:(void (^)(void))interactionChangedHandler interactionStoppedHandler:(void (^)(void))interactionStoppedHandler;
     47
     48@end
     49
     50@interface DDActionsManager : NSObject
     51
     52+ (DDActionsManager *)sharedManager;
     53- (NSArray *)menuItemsForResult:(DDResultRef)result actionContext:(DDActionContext *)context;
     54- (NSArray *)menuItemsForTargetURL:(NSString *)targetURL actionContext:(DDActionContext *)context;
     55- (void)requestBubbleClosureUnanchorOnFailure:(BOOL)unanchorOnFailure;
     56
     57+ (BOOL)shouldUseActionsWithContext:(DDActionContext *)context;
     58+ (void)didUseActions;
     59
     60- (BOOL)hasActionsForResult:(DDResultRef)result actionContext:(DDActionContext *)actionContext;
     61
     62- (NSArray *)menuItemsForValue:(NSString *)value type:(CFStringRef)type service:(NSString *)service context:(DDActionContext *)context;
    7763
    7864@end
     
    8975
    9076enum {
    91     DDHighlightStyleButtonShowAlways  = (1 << 24),
     77    DDHighlightStyleButtonShowAlways = (1 << 24),
    9278};
    9379
     80#endif // !USE(APPLE_INTERNAL_SDK)
     81
     82typedef struct __DDHighlight *DDHighlightRef;
    9483typedef NSUInteger DDHighlightStyle;
    95 #endif
    9684
     85@interface DDAction : NSObject
     86
     87@property (readonly) NSString *actionUTI;
     88
     89@end
     90
     91SOFT_LINK_PRIVATE_FRAMEWORK_OPTIONAL(DataDetectors)
     92
     93SOFT_LINK_CLASS(DataDetectors, DDAction)
     94SOFT_LINK_CLASS(DataDetectors, DDActionContext)
    9795SOFT_LINK_CLASS(DataDetectors, DDActionsManager)
    9896
    99 @interface DDActionsManager : NSObject
     97SOFT_LINK_CONSTANT(DataDetectors, DDBinderPhoneNumberKey, CFStringRef)
    10098
    101 + (DDActionsManager *)sharedManager;
    102 - (NSArray *)menuItemsForResult:(DDResultRef)result actionContext:(DDActionContext *)context;
    103 - (NSArray *)menuItemsForTargetURL:(NSString *)targetURL actionContext:(DDActionContext *)context;
    104 - (void)requestBubbleClosureUnanchorOnFailure:(BOOL)unanchorOnFailure;
    105 
    106 + (BOOL)shouldUseActionsWithContext:(DDActionContext *)context;
    107 + (void)didUseActions;
    108 
    109 - (BOOL)hasActionsForResult:(DDResultRef)result actionContext:(DDActionContext *)actionContext;
    110 
    111 @end
     99SOFT_LINK(DataDetectors, DDHighlightCreateWithRectsInVisibleRectWithStyleAndDirection, DDHighlightRef, (CFAllocatorRef allocator, CGRect* rects, CFIndex count, CGRect globalVisibleRect, DDHighlightStyle style, Boolean withArrow, NSWritingDirection writingDirection, Boolean endsWithEOL, Boolean flipped), (allocator, rects, count, globalVisibleRect, style, withArrow, writingDirection, endsWithEOL, flipped))
     100SOFT_LINK(DataDetectors, DDHighlightGetLayerWithContext, CGLayerRef, (DDHighlightRef highlight, CGContextRef context), (highlight, context))
     101SOFT_LINK(DataDetectors, DDHighlightGetBoundingRect, CGRect, (DDHighlightRef highlight), (highlight))
     102SOFT_LINK(DataDetectors, DDHighlightPointIsOnHighlight, Boolean, (DDHighlightRef highlight, CGPoint point, Boolean* onButton), (highlight, point, onButton))
  • trunk/Source/WebKit2/ChangeLog

    r184043 r184047  
     12015-05-10  Darin Adler  <darin@apple.com>
     2
     3        [Cocoa] Don't soft link DataDetectorsCore
     4        https://bugs.webkit.org/show_bug.cgi?id=144837
     5
     6        Reviewed by Dan Bernstein.
     7
     8        * Platform/mac/MenuUtilities.mm: Use DataDetectorsSPI.h instead of doing it here.
     9
     10        * WebProcess/WebPage/mac/WebPageMac.mm: Removed unneeded include of unused header,
     11        DataDetectorsSPI.h.
     12
    1132015-05-09  Dan Bernstein  <mitz@apple.com>
    214
  • trunk/Source/WebKit2/Platform/mac/MenuUtilities.mm

    r176914 r184047  
    3333
    3434#if ENABLE(TELEPHONE_NUMBER_DETECTION) && PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
    35 
    3635#import <WebCore/TUCallSPI.h>
    37 
    38 SOFT_LINK_PRIVATE_FRAMEWORK(DataDetectors)
    39 SOFT_LINK_CLASS(DataDetectors, DDAction)
    40 SOFT_LINK_CLASS(DataDetectors, DDActionsManager)
    41 SOFT_LINK_CONSTANT(DataDetectors, DDBinderPhoneNumberKey, CFStringRef)
    42 
    43 @interface DDAction : NSObject
    44 @property (readonly) NSString *actionUTI;
    45 @end
    46 
    47 typedef void* DDActionContext;
    48 
    49 @interface DDActionsManager : NSObject
    50 + (DDActionsManager *)sharedManager;
    51 - (NSArray *)menuItemsForValue:(NSString *)value type:(CFStringRef)type service:(NSString *)service context:(DDActionContext *)context;
    52 @end
    5336#endif
    5437
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm

    r183976 r184047  
    5959#import <WebCore/BackForwardController.h>
    6060#import <WebCore/DataDetection.h>
    61 #import <WebCore/DataDetectorsSPI.h>
    6261#import <WebCore/DictionaryLookup.h>
    6362#import <WebCore/EventHandler.h>
Note: See TracChangeset for help on using the changeset viewer.