Title: [184047] trunk/Source
Revision
184047
Author
da...@apple.com
Date
2015-05-10 11:29:59 -0700 (Sun, 10 May 2015)

Log 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.

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (184046 => 184047)


--- trunk/Source/WebCore/ChangeLog	2015-05-10 14:52:50 UTC (rev 184046)
+++ trunk/Source/WebCore/ChangeLog	2015-05-10 18:29:59 UTC (rev 184047)
@@ -1,3 +1,41 @@
+2015-05-10  Darin Adler  <da...@apple.com>
+
+        [Cocoa] Don't soft link DataDetectorsCore
+        https://bugs.webkit.org/show_bug.cgi?id=144837
+
+        Reviewed by Dan Bernstein.
+
+        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.
+
 2015-05-10  Chris Fleizach  <cfleiz...@apple.com>
 
         AX: Don't expose elements as data tables just because they use display: table

Modified: trunk/Source/WebCore/Configurations/WebCore.xcconfig (184046 => 184047)


--- trunk/Source/WebCore/Configurations/WebCore.xcconfig	2015-05-10 14:52:50 UTC (rev 184046)
+++ trunk/Source/WebCore/Configurations/WebCore.xcconfig	2015-05-10 18:29:59 UTC (rev 184047)
@@ -30,7 +30,7 @@
 FRAMEWORK_SEARCH_PATHS_ios_Debug = $(BUILT_PRODUCTS_DIR) $(PRODUCTION_FRAMEWORKS_DIR);
 FRAMEWORK_SEARCH_PATHS_ios_Release = $(FRAMEWORK_SEARCH_PATHS_ios_Debug);
 FRAMEWORK_SEARCH_PATHS_ios_Production = $(PRODUCTION_FRAMEWORKS_DIR);
-FRAMEWORK_SEARCH_PATHS[sdk=macosx*] = $(STAGED_FRAMEWORKS_SEARCH_PATH) $(FRAMEWORK_SEARCH_PATHS);
+FRAMEWORK_SEARCH_PATHS[sdk=macosx*] = $(STAGED_FRAMEWORKS_SEARCH_PATH) $(FRAMEWORK_SEARCH_PATHS) $(SDKROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks;
 
 OTHER_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;
 OTHER_CPLUSPLUSFLAGS = $(OTHER_CFLAGS);
@@ -57,7 +57,7 @@
 OTHER_LDFLAGS_BASE_ios = $(OTHER_LDFLAGS_BASE) -framework CFNetwork -framework CoreGraphics -framework CoreText -framework Foundation -framework GraphicsServices -framework ImageIO -framework OpenGLES -lMobileGestalt;
 OTHER_LDFLAGS_PLATFORM[sdk=iphoneos*] = $(OTHER_LDFLAGS_BASE_ios) -framework IOSurface;
 OTHER_LDFLAGS_PLATFORM[sdk=iphonesimulator*] = $(OTHER_LDFLAGS_BASE_ios);
-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;
+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 DataDetectorsCore -framework IOSurface -framework OpenGL;
 
 SECTORDER_FLAGS = $(SECTORDER_FLAGS_$(CONFIGURATION));
 SECTORDER_FLAGS_Production[sdk=iphoneos*] = -Wl,-order_file,$(SDKROOT)/AppleInternal/OrderFiles/WebCore.order;

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (184046 => 184047)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2015-05-10 14:52:50 UTC (rev 184046)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2015-05-10 18:29:59 UTC (rev 184047)
@@ -3380,6 +3380,7 @@
 		935C476B09AC4D4F00A6AAB4 /* PlatformWheelEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 935C476A09AC4D4F00A6AAB4 /* PlatformWheelEvent.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		935C477009AC4D7300A6AAB4 /* KeyEventMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 935C476E09AC4D7300A6AAB4 /* KeyEventMac.mm */; };
 		935C477509AC4D8E00A6AAB4 /* GapRects.h in Headers */ = {isa = PBXBuildFile; fileRef = 935C477409AC4D8D00A6AAB4 /* GapRects.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		935E2B4E1AFF06CA00976F9F /* DataDetectorsCoreSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 935E2B4D1AFF06CA00976F9F /* DataDetectorsCoreSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		935F45420F7C3B5F00D7C1FB /* JSLazyEventListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 935F45400F7C3B5F00D7C1FB /* JSLazyEventListener.cpp */; };
 		935F45430F7C3B5F00D7C1FB /* JSLazyEventListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 935F45410F7C3B5F00D7C1FB /* JSLazyEventListener.h */; };
 		935FBC4509BA00B900E230B1 /* EventListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 935FBC4409BA00B900E230B1 /* EventListener.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -10649,6 +10650,7 @@
 		935C476A09AC4D4F00A6AAB4 /* PlatformWheelEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformWheelEvent.h; sourceTree = "<group>"; };
 		935C476E09AC4D7300A6AAB4 /* KeyEventMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KeyEventMac.mm; sourceTree = "<group>"; };
 		935C477409AC4D8D00A6AAB4 /* GapRects.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GapRects.h; sourceTree = "<group>"; };
+		935E2B4D1AFF06CA00976F9F /* DataDetectorsCoreSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataDetectorsCoreSPI.h; sourceTree = "<group>"; };
 		935F45400F7C3B5F00D7C1FB /* JSLazyEventListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSLazyEventListener.cpp; sourceTree = "<group>"; };
 		935F45410F7C3B5F00D7C1FB /* JSLazyEventListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSLazyEventListener.h; sourceTree = "<group>"; };
 		935FBC4409BA00B900E230B1 /* EventListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventListener.h; sourceTree = "<group>"; };
@@ -16536,6 +16538,7 @@
 				07F0B9791AC5DB3300E535D9 /* AVKitSPI.h */,
 				CD4097FF1A8C855F004C65E9 /* CFNSURLConnectionSPI.h */,
 				1C5E980F1A02CEFA002DB55F /* CoreTextSPI.h */,
+				935E2B4D1AFF06CA00976F9F /* DataDetectorsCoreSPI.h */,
 				CE12524A1A16C79B00864480 /* DispatchSPI.h */,
 				CE1252441A16C22500864480 /* DynamicLinkerSPI.h */,
 				CE12524C1A1A77DE00864480 /* IOPMLibSPI.h */,
@@ -24228,6 +24231,7 @@
 				AD6E71AD1668899D00320C13 /* DocumentSharedObjectPool.h in Headers */,
 				E47E276516036ED200EE2AFB /* DocumentStyleSheetCollection.h in Headers */,
 				0B90561A0F2578BF0095FF6A /* DocumentThreadableLoader.h in Headers */,
+				935E2B4E1AFF06CA00976F9F /* DataDetectorsCoreSPI.h in Headers */,
 				86D982F7125C154000AD9E3D /* DocumentTiming.h in Headers */,
 				A8185F3909765766005826D9 /* DocumentType.h in Headers */,
 				973889A1116EA9DC00ADF313 /* DocumentWriter.h in Headers */,

Modified: trunk/Source/WebCore/editing/mac/DataDetection.mm (184046 => 184047)


--- trunk/Source/WebCore/editing/mac/DataDetection.mm	2015-05-10 14:52:50 UTC (rev 184046)
+++ trunk/Source/WebCore/editing/mac/DataDetection.mm	2015-05-10 18:29:59 UTC (rev 184047)
@@ -43,7 +43,7 @@
 
 RetainPtr<DDActionContext> DataDetection::detectItemAroundHitTestResult(const HitTestResult& hitTestResult, FloatRect& detectedDataBoundingBox, RefPtr<Range>& detectedDataRange)
 {
-    if (!DataDetectorsLibrary() || !DataDetectorsCoreLibrary())
+    if (!DataDetectorsLibrary())
         return nullptr;
 
     Node* node = hitTestResult.innerNonSharedNode();

Modified: trunk/Source/WebCore/page/mac/ServicesOverlayController.h (184046 => 184047)


--- trunk/Source/WebCore/page/mac/ServicesOverlayController.h	2015-05-10 14:52:50 UTC (rev 184046)
+++ trunk/Source/WebCore/page/mac/ServicesOverlayController.h	2015-05-10 18:29:59 UTC (rev 184047)
@@ -34,7 +34,7 @@
 #include "Timer.h"
 #include <wtf/RefCounted.h>
 
-typedef struct __DDHighlight DDHighlight, *DDHighlightRef;
+typedef struct __DDHighlight *DDHighlightRef;
 
 namespace WebCore {
 class LayoutRect;

Modified: trunk/Source/WebCore/page/mac/ServicesOverlayController.mm (184046 => 184047)


--- trunk/Source/WebCore/page/mac/ServicesOverlayController.mm	2015-05-10 14:52:50 UTC (rev 184046)
+++ trunk/Source/WebCore/page/mac/ServicesOverlayController.mm	2015-05-10 18:29:59 UTC (rev 184047)
@@ -53,12 +53,6 @@
 
 const float highlightFadeAnimationDuration = 0.3;
 
-// FIXME: Move more of this to DataDetectorsSPI.h.
-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))
-SOFT_LINK(DataDetectors, DDHighlightGetLayerWithContext, CGLayerRef, (DDHighlightRef highlight, CGContextRef context), (highlight, context))
-SOFT_LINK(DataDetectors, DDHighlightGetBoundingRect, CGRect, (DDHighlightRef highlight), (highlight))
-SOFT_LINK(DataDetectors, DDHighlightPointIsOnHighlight, Boolean, (DDHighlightRef highlight, CGPoint point, Boolean* onButton), (highlight, point, onButton))
-
 namespace WebCore {
 
 PassRefPtr<ServicesOverlayController::Highlight> ServicesOverlayController::Highlight::createForSelection(ServicesOverlayController& controller, RetainPtr<DDHighlightRef> ddHighlight, PassRefPtr<Range> range)

Added: trunk/Source/WebCore/platform/spi/cocoa/DataDetectorsCoreSPI.h (0 => 184047)


--- trunk/Source/WebCore/platform/spi/cocoa/DataDetectorsCoreSPI.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/spi/cocoa/DataDetectorsCoreSPI.h	2015-05-10 18:29:59 UTC (rev 184047)
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2014-2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#if USE(APPLE_INTERNAL_SDK)
+
+#import <DataDetectorsCore/DataDetectorsCore.h>
+
+#else // !USE(APPLE_INTERNAL_SDK)
+
+typedef enum {
+    DDScannerTypeStandard = 0,
+    DDScannerType1 = 1,
+    DDScannerType2 = 2,
+} DDScannerType;
+
+enum {
+    DDScannerCopyResultsOptionsNone = 0,
+    DDScannerCopyResultsOptionsNoOverlap = 1 << 0,
+};
+
+#endif // !USE(APPLE_INTERNAL_SDK)
+
+typedef struct __DDResult *DDResultRef;
+typedef struct __DDScanQuery *DDScanQueryRef;
+typedef struct __DDScanner *DDScannerRef;
+
+typedef CFIndex DDScannerCopyResultsOptions;
+typedef CFIndex DDScannerOptions;
+
+extern "C" {
+
+DDScannerRef DDScannerCreate(DDScannerType, DDScannerOptions, CFErrorRef*);
+DDScanQueryRef DDScanQueryCreateFromString(CFAllocatorRef, CFStringRef, CFRange);
+Boolean DDScannerScanQuery(DDScannerRef, DDScanQueryRef);
+CFArrayRef DDScannerCopyResultsWithOptions(DDScannerRef, DDScannerCopyResultsOptions);
+CFRange DDResultGetRange(DDResultRef);
+
+}

Modified: trunk/Source/WebCore/platform/spi/mac/DataDetectorsSPI.h (184046 => 184047)


--- trunk/Source/WebCore/platform/spi/mac/DataDetectorsSPI.h	2015-05-10 14:52:50 UTC (rev 184046)
+++ trunk/Source/WebCore/platform/spi/mac/DataDetectorsSPI.h	2015-05-10 18:29:59 UTC (rev 184047)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014-2015 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -23,48 +23,18 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#import "SoftLinking.h"
-#import <objc/runtime.h>
+#import <WebCore/DataDetectorsCoreSPI.h>
+#import <WebCore/SoftLinking.h>
 
-// FIXME: This header should include various DataDetectors SPI headers if using the internal SDK.
+#if USE(APPLE_INTERNAL_SDK)
 
-typedef struct __DDScanner DDScanner, *DDScannerRef;
-typedef struct __DDScanQuery *DDScanQueryRef;
-typedef struct __DDResult *DDResultRef;
-typedef struct __DDHighlight DDHighlight, *DDHighlightRef;
+// Can't include DDAction.h because as of this writing it is a private header that includes a non-private header with an "" include.
+#import <DataDetectors/DDActionContext.h>
+#import <DataDetectors/DDActionsManager.h>
+#import <DataDetectors/DDHighlightDrawing.h>
 
-typedef enum {
-    DDScannerTypeStandard = 0,
-} DDScannerType;
+#else // !USE(APPLE_INTERNAL_SDK)
 
-enum {
-    DDScannerOptionStopAtFirstMatch = 1,
-};
-typedef CFIndex DDScannerOptions;
-
-enum {
-    DDScannerCopyResultsOptionsNone = 0,
-    DDScannerCopyResultsOptionsNoOverlap = 1 << 0,
-};
-typedef CFIndex DDScannerCopyResultsOptions;
-
-SOFT_LINK_PRIVATE_FRAMEWORK_OPTIONAL(DataDetectors)
-SOFT_LINK_PRIVATE_FRAMEWORK_OPTIONAL(DataDetectorsCore)
-
-extern "C" {
-
-SOFT_LINK(DataDetectorsCore, DDScannerCreate, DDScannerRef, (DDScannerType type, DDScannerOptions options, CFErrorRef* errorRef), (type, options, errorRef))
-SOFT_LINK(DataDetectorsCore, DDScanQueryCreateFromString, DDScanQueryRef, (CFAllocatorRef allocator, CFStringRef string, CFRange range), (allocator, string, range))
-SOFT_LINK(DataDetectorsCore, DDScannerScanQuery, DDScanQueryRef, (DDScannerRef scanner, DDScanQueryRef query), (scanner, query))
-SOFT_LINK(DataDetectorsCore, DDScannerCopyResultsWithOptions, CFArrayRef, (DDScannerRef scanner, DDScannerCopyResultsOptions options), (scanner, options))
-SOFT_LINK(DataDetectorsCore, DDResultGetRange, CFRange, (DDResultRef result), (result))
-SOFT_LINK(DataDetectorsCore, DDResultGetType, CFStringRef, (DDResultRef result), (result))
-
-}
-
-#if PLATFORM(MAC)
-SOFT_LINK_CLASS(DataDetectors, DDActionContext)
-
 @interface DDActionContext : NSObject <NSCopying, NSSecureCoding>
 
 @property NSRect highlightFrame;
@@ -77,6 +47,22 @@
 
 @end
 
+@interface DDActionsManager : NSObject
+
++ (DDActionsManager *)sharedManager;
+- (NSArray *)menuItemsForResult:(DDResultRef)result actionContext:(DDActionContext *)context;
+- (NSArray *)menuItemsForTargetURL:(NSString *)targetURL actionContext:(DDActionContext *)context;
+- (void)requestBubbleClosureUnanchorOnFailure:(BOOL)unanchorOnFailure;
+
++ (BOOL)shouldUseActionsWithContext:(DDActionContext *)context;
++ (void)didUseActions;
+
+- (BOOL)hasActionsForResult:(DDResultRef)result actionContext:(DDActionContext *)actionContext;
+
+- (NSArray *)menuItemsForValue:(NSString *)value type:(CFStringRef)type service:(NSString *)service context:(DDActionContext *)context;
+
+@end
+
 enum {
     DDHighlightStyleBubbleNone = 0,
     DDHighlightStyleBubbleStandard = 1
@@ -88,24 +74,29 @@
 };
 
 enum {
-    DDHighlightStyleButtonShowAlways  = (1 << 24),
+    DDHighlightStyleButtonShowAlways = (1 << 24),
 };
 
+#endif // !USE(APPLE_INTERNAL_SDK)
+
+typedef struct __DDHighlight *DDHighlightRef;
 typedef NSUInteger DDHighlightStyle;
-#endif
 
-SOFT_LINK_CLASS(DataDetectors, DDActionsManager)
+@interface DDAction : NSObject
 
-@interface DDActionsManager : NSObject
+@property (readonly) NSString *actionUTI;
 
-+ (DDActionsManager *)sharedManager;
-- (NSArray *)menuItemsForResult:(DDResultRef)result actionContext:(DDActionContext *)context;
-- (NSArray *)menuItemsForTargetURL:(NSString *)targetURL actionContext:(DDActionContext *)context;
-- (void)requestBubbleClosureUnanchorOnFailure:(BOOL)unanchorOnFailure;
+@end
 
-+ (BOOL)shouldUseActionsWithContext:(DDActionContext *)context;
-+ (void)didUseActions;
+SOFT_LINK_PRIVATE_FRAMEWORK_OPTIONAL(DataDetectors)
 
-- (BOOL)hasActionsForResult:(DDResultRef)result actionContext:(DDActionContext *)actionContext;
+SOFT_LINK_CLASS(DataDetectors, DDAction)
+SOFT_LINK_CLASS(DataDetectors, DDActionContext)
+SOFT_LINK_CLASS(DataDetectors, DDActionsManager)
 
-@end
+SOFT_LINK_CONSTANT(DataDetectors, DDBinderPhoneNumberKey, CFStringRef)
+
+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))
+SOFT_LINK(DataDetectors, DDHighlightGetLayerWithContext, CGLayerRef, (DDHighlightRef highlight, CGContextRef context), (highlight, context))
+SOFT_LINK(DataDetectors, DDHighlightGetBoundingRect, CGRect, (DDHighlightRef highlight), (highlight))
+SOFT_LINK(DataDetectors, DDHighlightPointIsOnHighlight, Boolean, (DDHighlightRef highlight, CGPoint point, Boolean* onButton), (highlight, point, onButton))

Modified: trunk/Source/WebKit2/ChangeLog (184046 => 184047)


--- trunk/Source/WebKit2/ChangeLog	2015-05-10 14:52:50 UTC (rev 184046)
+++ trunk/Source/WebKit2/ChangeLog	2015-05-10 18:29:59 UTC (rev 184047)
@@ -1,3 +1,15 @@
+2015-05-10  Darin Adler  <da...@apple.com>
+
+        [Cocoa] Don't soft link DataDetectorsCore
+        https://bugs.webkit.org/show_bug.cgi?id=144837
+
+        Reviewed by Dan Bernstein.
+
+        * 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.
+
 2015-05-09  Dan Bernstein  <m...@apple.com>
 
         Deployment-target __NSi_ and __NSd_ definitions in WKFoundation.h are redundant

Modified: trunk/Source/WebKit2/Platform/mac/MenuUtilities.mm (184046 => 184047)


--- trunk/Source/WebKit2/Platform/mac/MenuUtilities.mm	2015-05-10 14:52:50 UTC (rev 184046)
+++ trunk/Source/WebKit2/Platform/mac/MenuUtilities.mm	2015-05-10 18:29:59 UTC (rev 184047)
@@ -32,24 +32,7 @@
 #import <objc/runtime.h>
 
 #if ENABLE(TELEPHONE_NUMBER_DETECTION) && PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
-
 #import <WebCore/TUCallSPI.h>
-
-SOFT_LINK_PRIVATE_FRAMEWORK(DataDetectors)
-SOFT_LINK_CLASS(DataDetectors, DDAction)
-SOFT_LINK_CLASS(DataDetectors, DDActionsManager)
-SOFT_LINK_CONSTANT(DataDetectors, DDBinderPhoneNumberKey, CFStringRef)
-
-@interface DDAction : NSObject
-@property (readonly) NSString *actionUTI;
-@end
-
-typedef void* DDActionContext;
-
-@interface DDActionsManager : NSObject
-+ (DDActionsManager *)sharedManager;
-- (NSArray *)menuItemsForValue:(NSString *)value type:(CFStringRef)type service:(NSString *)service context:(DDActionContext *)context;
-@end
 #endif
 
 namespace WebKit {

Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm (184046 => 184047)


--- trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm	2015-05-10 14:52:50 UTC (rev 184046)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm	2015-05-10 18:29:59 UTC (rev 184047)
@@ -58,7 +58,6 @@
 #import <WebCore/AXObjectCache.h>
 #import <WebCore/BackForwardController.h>
 #import <WebCore/DataDetection.h>
-#import <WebCore/DataDetectorsSPI.h>
 #import <WebCore/DictionaryLookup.h>
 #import <WebCore/EventHandler.h>
 #import <WebCore/FocusController.h>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to