Changeset 202889 in webkit
- Timestamp:
- Jul 6, 2016, 8:03:42 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 26 edited
- 3 copied
- 1 moved
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/WebCore.xcodeproj/project.pbxproj (modified) (4 diffs)
-
Source/WebCore/editing/cocoa/DataDetection.h (modified) (2 diffs)
-
Source/WebCore/editing/cocoa/DataDetection.mm (modified) (5 diffs)
-
Source/WebCore/loader/FrameLoader.cpp (modified) (1 diff)
-
Source/WebCore/loader/FrameLoaderClient.h (modified) (2 diffs)
-
Source/WebCore/platform/spi/ios/DataDetectorsUISPI.h (moved) (moved from trunk/Source/WebKit2/Platform/spi/ios/DataDetectorsUISPI.h ) (2 diffs)
-
Source/WebKit2/CMakeLists.txt (modified) (1 diff)
-
Source/WebKit2/ChangeLog (modified) (1 diff)
-
Source/WebKit2/Shared/Cocoa/LoadParametersCocoa.mm (copied) (copied from trunk/Source/WebKit2/UIProcess/Cocoa/WebPageProxyCocoa.mm ) (2 diffs)
-
Source/WebKit2/Shared/LoadParameters.cpp (added)
-
Source/WebKit2/Shared/LoadParameters.h (copied) (copied from trunk/Source/WebKit2/UIProcess/Cocoa/WebPageProxyCocoa.mm ) (2 diffs)
-
Source/WebKit2/Shared/mac/ArgumentCodersMac.h (modified) (2 diffs)
-
Source/WebKit2/Shared/mac/ArgumentCodersMac.mm (modified) (5 diffs)
-
Source/WebKit2/UIProcess/API/APIUIClient.h (modified) (1 diff)
-
Source/WebKit2/UIProcess/Cocoa/UIDelegate.h (modified) (2 diffs)
-
Source/WebKit2/UIProcess/Cocoa/UIDelegate.mm (modified) (2 diffs)
-
Source/WebKit2/UIProcess/Cocoa/WebPageProxyCocoa.mm (modified) (2 diffs)
-
Source/WebKit2/UIProcess/WebPageProxy.cpp (modified) (9 diffs)
-
Source/WebKit2/UIProcess/WebPageProxy.h (modified) (2 diffs)
-
Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.h (modified) (1 diff)
-
Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm (modified) (2 diffs)
-
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (modified) (15 diffs)
-
Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (modified) (2 diffs)
-
Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h (modified) (1 diff)
-
Source/WebKit2/WebProcess/WebPage/Cocoa/WebPageCocoa.mm (copied) (copied from trunk/Source/WebKit2/UIProcess/Cocoa/WebPageProxyCocoa.mm ) (2 diffs)
-
Source/WebKit2/WebProcess/WebPage/WebPage.cpp (modified) (4 diffs)
-
Source/WebKit2/WebProcess/WebPage/WebPage.h (modified) (5 diffs)
-
Source/WebKit2/WebProcess/WebPage/WebPage.messages.in (modified) (1 diff)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (modified) (4 diffs)
-
Tools/TestWebKitAPI/Tests/WebKit2Cocoa/DataDetection.mm (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r202888 r202889 1 2016-07-06 Tim Horton <timothy_horton@apple.com> 2 3 Email from June 1st containing text 'Today @ 7:10PM' is linkified, but shouldn't be 4 https://bugs.webkit.org/show_bug.cgi?id=159498 5 <rdar://problem/26719903> 6 7 Reviewed by Sam Weinig. 8 9 New API test: WebKit2.DataDetectionReferenceDate 10 11 * editing/cocoa/DataDetection.h: 12 * editing/cocoa/DataDetection.mm: 13 (WebCore::DataDetection::detectContentInRange): 14 Extract the reference date from the DataDetectors context dictionary if it exists, 15 and pass it along to DataDetectors. 16 17 * loader/FrameLoader.cpp: 18 (WebCore::FrameLoader::checkLoadCompleteForThisFrame): 19 * loader/FrameLoaderClient.h: 20 Plumb the DataDetectors context dictionary through from WebPage. 21 1 22 2016-07-06 Chris Dumez <cdumez@apple.com> 2 23 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r202873 r202889 1245 1245 2D9F0E1314FF1CBF00BA0FF7 /* linearSRGB.icc in Resources */ = {isa = PBXBuildFile; fileRef = 2D9F0E1214FF1CBF00BA0FF7 /* linearSRGB.icc */; }; 1246 1246 2DB9C4AA1B3231F40070F27F /* NSEventSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DB9C4A91B3231F40070F27F /* NSEventSPI.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1247 2DC4CF791D2DD98900ECCC94 /* DataDetectorsUISPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DC4CF781D2DD98900ECCC94 /* DataDetectorsUISPI.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1247 1248 2DCB837919F99BBA00A7FBE4 /* NSSharingServicePickerSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DCB837719F99BBA00A7FBE4 /* NSSharingServicePickerSPI.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1248 1249 2DCB837A19F99BBA00A7FBE4 /* NSSharingServiceSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DCB837819F99BBA00A7FBE4 /* NSSharingServiceSPI.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 8813 8814 2DAAE32D19DCAF6000E002D2 /* MockPageOverlayClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MockPageOverlayClient.h; sourceTree = "<group>"; }; 8814 8815 2DB9C4A91B3231F40070F27F /* NSEventSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSEventSPI.h; sourceTree = "<group>"; }; 8816 2DC4CF781D2DD98900ECCC94 /* DataDetectorsUISPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataDetectorsUISPI.h; sourceTree = "<group>"; }; 8815 8817 2DCB837719F99BBA00A7FBE4 /* NSSharingServicePickerSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSSharingServicePickerSPI.h; sourceTree = "<group>"; }; 8816 8818 2DCB837819F99BBA00A7FBE4 /* NSSharingServiceSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSSharingServiceSPI.h; sourceTree = "<group>"; }; … … 20172 20174 children = ( 20173 20175 CE1252421A16C01A00864480 /* CoreUISPI.h */, 20176 2DC4CF781D2DD98900ECCC94 /* DataDetectorsUISPI.h */, 20174 20177 CEC337AE1A46086D009B8523 /* GraphicsServicesSPI.h */, 20175 20178 7C4C96E21AD44ABF00365A50 /* LaunchServicesSPI.h */, … … 26923 26926 E44614380CD689C500FADA75 /* JSHTMLAudioElement.h in Headers */, 26924 26927 A80E7B110A19D606007FB8C5 /* JSHTMLBaseElement.h in Headers */, 26928 2DC4CF791D2DD98900ECCC94 /* DataDetectorsUISPI.h in Headers */, 26925 26929 1AE2AA230A1CDAB400B42B25 /* JSHTMLBodyElement.h in Headers */, 26926 26930 1AE2AA250A1CDAB400B42B25 /* JSHTMLBRElement.h in Headers */, -
trunk/Source/WebCore/editing/cocoa/DataDetection.h
r200874 r202889 33 33 OBJC_CLASS DDActionContext; 34 34 OBJC_CLASS NSArray; 35 OBJC_CLASS NSDictionary; 35 36 36 37 namespace WebCore { … … 58 59 WEBCORE_EXPORT static RetainPtr<DDActionContext> detectItemAroundHitTestResult(const HitTestResult&, FloatRect& detectedDataBoundingBox, RefPtr<Range>& detectedDataRange); 59 60 #endif 60 WEBCORE_EXPORT static NSArray *detectContentInRange(RefPtr<Range>& contextRange, DataDetectorTypes );61 WEBCORE_EXPORT static NSArray *detectContentInRange(RefPtr<Range>& contextRange, DataDetectorTypes, NSDictionary *context); 61 62 #if PLATFORM(IOS) 62 63 WEBCORE_EXPORT static bool isDataDetectorLink(Element&); -
trunk/Source/WebCore/editing/cocoa/DataDetection.mm
r202472 r202889 30 30 #import "CSSStyleDeclaration.h" 31 31 #import "DataDetectorsSPI.h" 32 #import "DataDetectorsUISPI.h" 32 33 #import "ElementAncestorIterator.h" 33 34 #import "ElementTraversal.h" … … 430 431 } 431 432 432 NSArray *DataDetection::detectContentInRange(RefPtr<Range>& contextRange, DataDetectorTypes types )433 NSArray *DataDetection::detectContentInRange(RefPtr<Range>& contextRange, DataDetectorTypes types, NSDictionary *context) 433 434 { 434 435 RetainPtr<DDScannerRef> scanner = adoptCF(softLink_DataDetectorsCore_DDScannerCreate(DDScannerTypeStandard, 0, nullptr)); … … 444 445 if (!softLink_DataDetectorsCore_DDScannerScanQuery(scanner.get(), scanQuery.get())) 445 446 return nil; 446 447 447 448 RetainPtr<CFArrayRef> scannerResults = adoptCF(softLink_DataDetectorsCore_DDScannerCopyResultsWithOptions(scanner.get(), get_DataDetectorsCore_DDScannerCopyResultsOptionsForPassiveUse() | DDScannerCopyResultsOptionsCoalesceSignatures)); 448 449 if (!scannerResults) 449 450 return nil; 450 451 451 452 CFIndex resultCount = CFArrayGetCount(scannerResults.get()); 452 453 if (!resultCount) 453 454 return nil; 454 455 455 456 Vector<RetainPtr<DDResultRef>> allResults; 456 457 Vector<RetainPtr<NSIndexPath>> indexPaths; … … 520 521 521 522 auto tz = adoptCF(CFTimeZoneCopyDefault()); 522 NSDate *referenceDate = [ NSDate date];523 NSDate *referenceDate = [context objectForKey:getkDataDetectorsReferenceDateKey()] ?: [NSDate date]; 523 524 Text* lastTextNodeToUpdate = nullptr; 524 525 String lastNodeContent; … … 653 654 654 655 #else 655 NSArray *DataDetection::detectContentInRange(RefPtr<Range>&, DataDetectorTypes )656 NSArray *DataDetection::detectContentInRange(RefPtr<Range>&, DataDetectorTypes, NSDictionary *) 656 657 { 657 658 return nil; -
trunk/Source/WebCore/loader/FrameLoader.cpp
r202278 r202889 2311 2311 if (auto* documentElement = document->documentElement()) { 2312 2312 RefPtr<Range> documentRange = makeRange(firstPositionInNode(documentElement), lastPositionInNode(documentElement)); 2313 m_frame.setDataDetectionResults(DataDetection::detectContentInRange(documentRange, m_frame.settings().dataDetectorTypes() ));2313 m_frame.setDataDetectionResults(DataDetection::detectContentInRange(documentRange, m_frame.settings().dataDetectorTypes(), m_client.dataDetectionContext())); 2314 2314 if (m_frame.isMainFrame()) 2315 2315 m_client.dispatchDidFinishDataDetection(m_frame.dataDetectionResults()); -
trunk/Source/WebCore/loader/FrameLoaderClient.h
r202410 r202889 55 55 OBJC_CLASS NSArray; 56 56 OBJC_CLASS NSCachedURLResponse; 57 OBJC_CLASS NSDictionary; 57 58 OBJC_CLASS NSView; 58 59 #endif … … 293 294 virtual RemoteAXObjectRef accessibilityRemoteObject() = 0; 294 295 virtual NSCachedURLResponse* willCacheResponse(DocumentLoader*, unsigned long identifier, NSCachedURLResponse*) const = 0; 296 virtual NSDictionary *dataDetectionContext() { return nullptr; } 295 297 #endif 296 298 #if PLATFORM(WIN) && USE(CFNETWORK) -
trunk/Source/WebCore/platform/spi/ios/DataDetectorsUISPI.h
r202888 r202889 23 23 * THE POSSIBILITY OF SUCH DAMAGE. 24 24 */ 25 26 #if PLATFORM(IOS) 25 27 26 28 #import <UIKit/UIKit.h> … … 66 68 SOFT_LINK_CONSTANT(DataDetectorsUI, kDataDetectorsLeadingText, const NSString *) 67 69 SOFT_LINK_CONSTANT(DataDetectorsUI, kDataDetectorsTrailingText, const NSString *) 70 SOFT_LINK_CONSTANT(DataDetectorsUI, kDataDetectorsReferenceDateKey, const NSString *) 71 72 #endif -
trunk/Source/WebKit2/CMakeLists.txt
r202852 r202889 240 240 Shared/FontInfo.cpp 241 241 Shared/LayerTreeContext.cpp 242 Shared/LoadParameters.cpp 242 243 Shared/NavigationActionData.cpp 243 244 Shared/PlatformPopupMenuData.cpp -
trunk/Source/WebKit2/ChangeLog
r202888 r202889 1 2016-07-06 Tim Horton <timothy_horton@apple.com> 2 3 Email from June 1st containing text 'Today @ 7:10PM' is linkified, but shouldn't be 4 https://bugs.webkit.org/show_bug.cgi?id=159498 5 <rdar://problem/26719903> 6 7 Reviewed by Sam Weinig. 8 9 * Shared/Cocoa/LoadParametersCocoa.mm: Added. 10 (WebKit::LoadParameters::platformEncode): 11 (WebKit::LoadParameters::platformDecode): 12 * Shared/LoadParameters.cpp: Added. 13 (WebKit::LoadParameters::encode): 14 (WebKit::LoadParameters::decode): 15 * Shared/LoadParameters.h: Added. 16 Add a struct that knows how to encode all of the different parameters 17 to all of the Load* messages, including the platform-specific DataDetectors parameters. 18 19 * Shared/mac/ArgumentCodersMac.h: 20 * Shared/mac/ArgumentCodersMac.mm: 21 (IPC::typeFromObject): 22 (IPC::encode): 23 (IPC::decode): 24 Add NSURL coders that defer to the CFURL coders. 25 26 * UIProcess/API/APIUIClient.h: 27 (API::UIClient::dataDetectionContext): 28 * UIProcess/Cocoa/UIDelegate.h: 29 * UIProcess/Cocoa/UIDelegate.mm: 30 (WebKit::UIDelegate::setDelegate): 31 (WebKit::UIDelegate::UIClient::dataDetectionContext): 32 Add APIUIClient methods to retrieve the DataDetectors context dictionary. 33 34 * UIProcess/Cocoa/WebPageProxyCocoa.mm: 35 (WebKit::WebPageProxy::addPlatformLoadParameters): 36 Add the DataDetectors context dictionary to the given LoadParameters. 37 38 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: 39 (WebKit::WebFrameLoaderClient::dataDetectionContext): 40 * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 41 * WebProcess/WebPage/WebPage.h: 42 (WebKit::WebPage::dataDetectionContext): 43 Store the dataDetectionContext on WebPage, and make it accessible to WebCore 44 via the FrameLoaderClient (it is used in FrameLoader when the load completes). 45 46 * UIProcess/WebPageProxy.cpp: 47 (WebKit::WebPageProxy::loadRequest): 48 (WebKit::WebPageProxy::loadFile): 49 (WebKit::WebPageProxy::loadData): 50 (WebKit::WebPageProxy::loadHTMLString): 51 (WebKit::WebPageProxy::loadAlternateHTMLString): 52 (WebKit::WebPageProxy::loadPlainTextString): 53 (WebKit::WebPageProxy::loadWebArchiveData): 54 * UIProcess/WebPageProxy.h: 55 * WebKit2.xcodeproj/project.pbxproj: 56 * WebProcess/WebPage/WebPage.cpp: 57 (WebKit::WebPage::loadRequest): 58 (WebKit::WebPage::loadStringImpl): 59 (WebKit::WebPage::loadData): 60 (WebKit::WebPage::loadString): 61 (WebKit::WebPage::loadAlternateHTMLString): 62 (WebKit::WebPage::loadHTMLString): Deleted. 63 (WebKit::WebPage::loadPlainTextString): Deleted. 64 (WebKit::WebPage::loadWebArchiveData): Deleted. 65 * WebProcess/WebPage/WebPage.messages.in: 66 Adopt LoadParameters, taking this opportunity to reduce the number of very similar messages. 67 We can take this further (we should be able to get it down to just LoadRequest 68 and LoadData) in the future. When any load occurs, grab the client's DataDetectorse 69 context dictionary and send it along with the load request, storing it in WebPage. 70 1 71 2016-07-06 Chris Dumez <cdumez@apple.com> 2 72 -
trunk/Source/WebKit2/Shared/Cocoa/LoadParametersCocoa.mm
r202888 r202889 1 1 /* 2 * Copyright (C) 201 4Apple Inc. All rights reserved.2 * Copyright (C) 2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #i mport"config.h"27 #i mport "WebProcessProxy.h"26 #include "config.h" 27 #include "LoadParameters.h" 28 28 29 #i mport "DataDetectionResult.h"29 #if PLATFORM(COCOA) 30 30 31 #i mport <WebCore/SearchPopupMenuCocoa.h>32 #i mport <wtf/cf/TypeCastsCF.h>31 #include "ArgumentCodersMac.h" 32 #include "WebCoreArgumentCoders.h" 33 33 34 34 namespace WebKit { 35 35 36 #if ENABLE(DATA_DETECTION) 37 void WebPageProxy::setDataDetectionResult(const DataDetectionResult& dataDetectionResult) 36 void LoadParameters::platformEncode(IPC::ArgumentEncoder& encoder) const 38 37 { 39 m_dataDetectionResults = dataDetectionResult.results; 40 } 41 #endif 42 43 void WebPageProxy::saveRecentSearches(const String& name, const Vector<WebCore::RecentSearch>& searchItems) 44 { 45 if (!name) { 46 // FIXME: This should be a message check. 47 return; 48 } 49 50 WebCore::saveRecentSearches(name, searchItems); 38 IPC::encode(encoder, dataDetectionContext.get()); 51 39 } 52 40 53 void WebPageProxy::loadRecentSearches(const String& name, Vector<WebCore::RecentSearch>& searchItems)41 bool LoadParameters::platformDecode(IPC::ArgumentDecoder& decoder, LoadParameters& data) 54 42 { 55 if (!name) { 56 // FIXME: This should be a message check. 57 return; 58 } 43 if (!IPC::decode(decoder, data.dataDetectionContext)) 44 return false; 59 45 60 searchItems = WebCore::loadRecentSearches(name);46 return true; 61 47 } 62 48 63 #if ENABLE(CONTENT_FILTERING) 64 void WebPageProxy::contentFilterDidBlockLoadForFrame(const WebCore::ContentFilterUnblockHandler& unblockHandler, uint64_t frameID) 65 { 66 if (WebFrameProxy* frame = m_process->webFrame(frameID)) 67 frame->contentFilterDidBlockLoad(unblockHandler); 68 } 49 } // namespace WebKit 50 69 51 #endif 70 71 } -
trunk/Source/WebKit2/Shared/LoadParameters.h
r202888 r202889 1 1 /* 2 * Copyright (C) 201 4Apple Inc. All rights reserved.2 * Copyright (C) 2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #i mport "config.h"27 # import "WebProcessProxy.h"26 #ifndef LoadParameters_h 27 #define LoadParameters_h 28 28 29 #import "DataDetectionResult.h" 29 #include "DataReference.h" 30 #include "SandboxExtension.h" 31 #include "UserData.h" 32 #include <WebCore/ResourceRequest.h> 30 33 31 #import <WebCore/SearchPopupMenuCocoa.h> 32 #import <wtf/cf/TypeCastsCF.h> 34 OBJC_CLASS NSDictionary; 35 36 namespace IPC { 37 class ArgumentDecoder; 38 class ArgumentEncoder; 39 } 33 40 34 41 namespace WebKit { 35 42 36 #if ENABLE(DATA_DETECTION) 37 void WebPageProxy::setDataDetectionResult(const DataDetectionResult& dataDetectionResult) 38 { 39 m_dataDetectionResults = dataDetectionResult.results; 40 } 43 struct LoadParameters { 44 void encode(IPC::ArgumentEncoder&) const; 45 static bool decode(IPC::ArgumentDecoder&, LoadParameters&); 46 47 void platformEncode(IPC::ArgumentEncoder&) const; 48 static bool platformDecode(IPC::ArgumentDecoder&, LoadParameters&); 49 50 uint64_t navigationID; 51 52 WebCore::ResourceRequest request; 53 SandboxExtension::Handle sandboxExtensionHandle; 54 55 IPC::DataReference data; 56 String string; 57 String MIMEType; 58 String encodingName; 59 60 String baseURLString; 61 String unreachableURLString; 62 String provisionalLoadErrorURLString; 63 64 uint64_t shouldOpenExternalURLsPolicy; 65 UserData userData; 66 67 #if PLATFORM(COCOA) 68 RetainPtr<NSDictionary> dataDetectionContext; 41 69 #endif 70 }; 42 71 43 void WebPageProxy::saveRecentSearches(const String& name, const Vector<WebCore::RecentSearch>& searchItems) 44 { 45 if (!name) { 46 // FIXME: This should be a message check. 47 return; 48 } 72 } // namespace WebKit 49 73 50 WebCore::saveRecentSearches(name, searchItems); 51 } 52 53 void WebPageProxy::loadRecentSearches(const String& name, Vector<WebCore::RecentSearch>& searchItems) 54 { 55 if (!name) { 56 // FIXME: This should be a message check. 57 return; 58 } 59 60 searchItems = WebCore::loadRecentSearches(name); 61 } 62 63 #if ENABLE(CONTENT_FILTERING) 64 void WebPageProxy::contentFilterDidBlockLoadForFrame(const WebCore::ContentFilterUnblockHandler& unblockHandler, uint64_t frameID) 65 { 66 if (WebFrameProxy* frame = m_process->webFrame(frameID)) 67 frame->contentFilterDidBlockLoad(unblockHandler); 68 } 69 #endif 70 71 } 74 #endif // LoadParameters_h -
trunk/Source/WebKit2/Shared/mac/ArgumentCodersMac.h
r189052 r202889 38 38 OBJC_CLASS NSNumber; 39 39 OBJC_CLASS NSString; 40 OBJC_CLASS NSURL; 40 41 41 42 namespace IPC { … … 88 89 bool decode(ArgumentDecoder&, RetainPtr<NSData>&); 89 90 91 // NSURL 92 void encode(ArgumentEncoder&, NSURL *); 93 bool decode(ArgumentDecoder&, RetainPtr<NSURL>&); 94 90 95 } // namespace IPC 91 96 -
trunk/Source/WebKit2/Shared/mac/ArgumentCodersMac.mm
r185775 r202889 56 56 NSDateType, 57 57 NSDataType, 58 NSURLType, 58 59 Unknown, 59 60 }; … … 85 86 if ([object isKindOfClass:[NSData class]]) 86 87 return NSDataType; 88 if ([object isKindOfClass:[NSURL class]]) 89 return NSURLType; 87 90 88 91 ASSERT_NOT_REACHED(); … … 126 129 case NSDataType: 127 130 encode(encoder, static_cast<NSData *>(object)); 131 return; 132 case NSURLType: 133 encode(encoder, static_cast<NSURL *>(object)); 128 134 return; 129 135 case Unknown: … … 206 212 return false; 207 213 result = data; 214 return true; 215 } 216 case NSURLType: { 217 RetainPtr<NSURL> URL; 218 if (!decode(decoder, URL)) 219 return false; 220 result = URL; 208 221 return true; 209 222 } … … 506 519 } 507 520 521 void encode(ArgumentEncoder& encoder, NSURL *URL) 522 { 523 encode(encoder, (CFURLRef)URL); 524 } 525 526 bool decode(ArgumentDecoder& decoder, RetainPtr<NSURL>& result) 527 { 528 RetainPtr<CFURLRef> URL; 529 if (!decode(decoder, URL)) 530 return false; 531 532 result = adoptNS((NSURL *)URL.leakRef()); 533 return true; 534 } 535 508 536 } // namespace IPC -
trunk/Source/WebKit2/UIProcess/API/APIUIClient.h
r199558 r202889 165 165 virtual UIViewController *presentingViewController() { return nullptr; } 166 166 #endif 167 #if PLATFORM(COCOA) 168 virtual NSDictionary *dataDetectionContext() { return nullptr; } 169 #endif 167 170 168 171 virtual void didClickAutoFillButton(WebKit::WebPageProxy&, API::Object*) { } -
trunk/Source/WebKit2/UIProcess/Cocoa/UIDelegate.h
r199558 r202889 98 98 void didNotHandleTapAsClick(const WebCore::IntPoint&) override; 99 99 UIViewController *presentingViewController() override; 100 #endif 100 #endif // PLATFORM(IOS) 101 102 NSDictionary *dataDetectionContext() override; 103 101 104 void imageOrMediaDocumentSizeChanged(const WebCore::IntSize&) override; 102 105 … … 131 134 bool presentingViewControllerForWebView : 1; 132 135 #endif 136 bool dataDetectionContextForWebView : 1; 133 137 bool webViewImageOrMediaDocumentSizeChanged : 1; 134 138 -
trunk/Source/WebKit2/UIProcess/Cocoa/UIDelegate.mm
r199901 r202889 102 102 m_delegateMethods.presentingViewControllerForWebView = [delegate respondsToSelector:@selector(_presentingViewControllerForWebView:)]; 103 103 #endif 104 m_delegateMethods.dataDetectionContextForWebView = [delegate respondsToSelector:@selector(_dataDetectionContextForWebView:)]; 104 105 m_delegateMethods.webViewImageOrMediaDocumentSizeChanged = [delegate respondsToSelector:@selector(_webView:imageOrMediaDocumentSizeChanged:)]; 105 106 … … 442 443 #endif 443 444 445 NSDictionary *UIDelegate::UIClient::dataDetectionContext() 446 { 447 if (!m_uiDelegate.m_delegateMethods.dataDetectionContextForWebView) 448 return nullptr; 449 450 auto delegate = m_uiDelegate.m_delegate.get(); 451 if (!delegate) 452 return nullptr; 453 454 return [static_cast<id <WKUIDelegatePrivate>>(delegate) _dataDetectionContextForWebView:m_uiDelegate.m_webView]; 455 } 456 444 457 void UIDelegate::UIClient::imageOrMediaDocumentSizeChanged(const WebCore::IntSize& newSize) 445 458 { -
trunk/Source/WebKit2/UIProcess/Cocoa/WebPageProxyCocoa.mm
r195722 r202889 25 25 26 26 #import "config.h" 27 #import "WebPageProxy.h" 28 29 #import "APIUIClient.h" 30 #import "DataDetectionResult.h" 31 #import "LoadParameters.h" 27 32 #import "WebProcessProxy.h" 28 29 #import "DataDetectionResult.h"30 33 31 34 #import <WebCore/SearchPopupMenuCocoa.h> … … 69 72 #endif 70 73 74 void WebPageProxy::addPlatformLoadParameters(LoadParameters& loadParameters) 75 { 76 loadParameters.dataDetectionContext = m_uiClient->dataDetectionContext(); 71 77 } 78 79 } -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r202763 r202889 56 56 #include "DrawingAreaProxyMessages.h" 57 57 #include "EventDispatcherMessages.h" 58 #include "LoadParameters.h" 58 59 #include "Logging.h" 59 60 #include "NativeWebGestureEvent.h" … … 907 908 } 908 909 910 #if !PLATFORM(COCOA) 911 void WebPageProxy::addPlatformLoadParameters(LoadParameters&) 912 { 913 } 914 #endif 915 909 916 RefPtr<API::Navigation> WebPageProxy::loadRequest(const ResourceRequest& request, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy, API::Object* userData) 910 917 { … … 921 928 reattachToWebProcess(); 922 929 923 SandboxExtension::Handle sandboxExtensionHandle; 924 bool createdExtension = maybeInitializeSandboxExtensionHandle(request.url(), sandboxExtensionHandle); 930 LoadParameters loadParameters; 931 loadParameters.navigationID = navigation->navigationID(); 932 loadParameters.request = request; 933 loadParameters.shouldOpenExternalURLsPolicy = (uint64_t)shouldOpenExternalURLsPolicy; 934 loadParameters.userData = UserData(process().transformObjectsToHandles(userData).get()); 935 bool createdExtension = maybeInitializeSandboxExtensionHandle(request.url(), loadParameters.sandboxExtensionHandle); 925 936 if (createdExtension) 926 937 m_process->willAcquireUniversalFileReadSandboxExtension(); 927 m_process->send(Messages::WebPage::LoadRequest(navigation->navigationID(), request, sandboxExtensionHandle, (uint64_t)shouldOpenExternalURLsPolicy, UserData(process().transformObjectsToHandles(userData).get())), m_pageID); 938 addPlatformLoadParameters(loadParameters); 939 940 m_process->send(Messages::WebPage::LoadRequest(loadParameters), m_pageID); 928 941 m_process->responsivenessTimer().start(); 929 942 … … 960 973 String resourceDirectoryPath = resourceDirectoryURL.fileSystemPath(); 961 974 962 SandboxExtension::Handle sandboxExtensionHandle; 963 SandboxExtension::createHandle(resourceDirectoryPath, SandboxExtension::ReadOnly, sandboxExtensionHandle); 975 LoadParameters loadParameters; 976 loadParameters.navigationID = navigation->navigationID(); 977 loadParameters.request = fileURL; 978 loadParameters.shouldOpenExternalURLsPolicy = (uint64_t)ShouldOpenExternalURLsPolicy::ShouldNotAllow; 979 loadParameters.userData = UserData(process().transformObjectsToHandles(userData).get()); 980 SandboxExtension::createHandle(resourceDirectoryPath, SandboxExtension::ReadOnly, loadParameters.sandboxExtensionHandle); 981 addPlatformLoadParameters(loadParameters); 982 964 983 m_process->assumeReadAccessToBaseURL(resourceDirectoryURL); 965 m_process->send(Messages::WebPage::LoadRequest( navigation->navigationID(), fileURL, sandboxExtensionHandle, (uint64_t)ShouldOpenExternalURLsPolicy::ShouldNotAllow, UserData(process().transformObjectsToHandles(userData).get())), m_pageID);984 m_process->send(Messages::WebPage::LoadRequest(loadParameters), m_pageID); 966 985 m_process->responsivenessTimer().start(); 967 986 … … 983 1002 reattachToWebProcess(); 984 1003 1004 LoadParameters loadParameters; 1005 loadParameters.navigationID = navigation->navigationID(); 1006 loadParameters.data = data->dataReference(); 1007 loadParameters.MIMEType = MIMEType; 1008 loadParameters.encodingName = encoding; 1009 loadParameters.baseURLString = baseURL; 1010 loadParameters.userData = UserData(process().transformObjectsToHandles(userData).get()); 1011 addPlatformLoadParameters(loadParameters); 1012 985 1013 m_process->assumeReadAccessToBaseURL(baseURL); 986 m_process->send(Messages::WebPage::LoadData( navigation->navigationID(), data->dataReference(), MIMEType, encoding, baseURL, UserData(process().transformObjectsToHandles(userData).get())), m_pageID);1014 m_process->send(Messages::WebPage::LoadData(loadParameters), m_pageID); 987 1015 m_process->responsivenessTimer().start(); 988 1016 … … 1005 1033 reattachToWebProcess(); 1006 1034 1035 LoadParameters loadParameters; 1036 loadParameters.navigationID = navigation->navigationID(); 1037 loadParameters.string = htmlString; 1038 loadParameters.encodingName = ASCIILiteral("text/html"); 1039 loadParameters.baseURLString = baseURL; 1040 loadParameters.userData = UserData(process().transformObjectsToHandles(userData).get()); 1041 addPlatformLoadParameters(loadParameters); 1042 1007 1043 m_process->assumeReadAccessToBaseURL(baseURL); 1008 m_process->send(Messages::WebPage::Load HTMLString(navigation->navigationID(), htmlString, baseURL, UserData(process().transformObjectsToHandles(userData).get())), m_pageID);1044 m_process->send(Messages::WebPage::LoadString(loadParameters), m_pageID); 1009 1045 m_process->responsivenessTimer().start(); 1010 1046 … … 1034 1070 m_mainFrame->setUnreachableURL(unreachableURL); 1035 1071 1072 LoadParameters loadParameters; 1073 loadParameters.navigationID = 0; 1074 loadParameters.string = htmlString; 1075 loadParameters.baseURLString = baseURL; 1076 loadParameters.unreachableURLString = unreachableURL; 1077 loadParameters.provisionalLoadErrorURLString = m_failingProvisionalLoadURL; 1078 loadParameters.userData = UserData(process().transformObjectsToHandles(userData).get()); 1079 addPlatformLoadParameters(loadParameters); 1080 1036 1081 m_process->assumeReadAccessToBaseURL(baseURL); 1037 1082 m_process->assumeReadAccessToBaseURL(unreachableURL); 1038 m_process->send(Messages::WebPage::LoadAlternateHTMLString( htmlString, baseURL, unreachableURL, m_failingProvisionalLoadURL, UserData(process().transformObjectsToHandles(userData).get())), m_pageID);1083 m_process->send(Messages::WebPage::LoadAlternateHTMLString(loadParameters), m_pageID); 1039 1084 m_process->responsivenessTimer().start(); 1040 1085 } … … 1051 1096 m_pageLoadState.setPendingAPIRequestURL(transaction, blankURL().string()); 1052 1097 1053 m_process->send(Messages::WebPage::LoadPlainTextString(string, UserData(process().transformObjectsToHandles(userData).get())), m_pageID); 1098 LoadParameters loadParameters; 1099 loadParameters.navigationID = 0; 1100 loadParameters.string = string; 1101 loadParameters.MIMEType = ASCIILiteral("text/plain"); 1102 loadParameters.userData = UserData(process().transformObjectsToHandles(userData).get()); 1103 addPlatformLoadParameters(loadParameters); 1104 1105 m_process->send(Messages::WebPage::LoadString(loadParameters), m_pageID); 1054 1106 m_process->responsivenessTimer().start(); 1055 1107 } … … 1066 1118 m_pageLoadState.setPendingAPIRequestURL(transaction, blankURL().string()); 1067 1119 1068 m_process->send(Messages::WebPage::LoadWebArchiveData(webArchiveData->dataReference(), UserData(process().transformObjectsToHandles(userData).get())), m_pageID); 1120 LoadParameters loadParameters; 1121 loadParameters.navigationID = 0; 1122 loadParameters.data = webArchiveData->dataReference(); 1123 loadParameters.MIMEType = ASCIILiteral("application/x-webarchive"); 1124 loadParameters.encodingName = ASCIILiteral("utf-16"); 1125 loadParameters.userData = UserData(process().transformObjectsToHandles(userData).get()); 1126 addPlatformLoadParameters(loadParameters); 1127 1128 m_process->send(Messages::WebPage::LoadData(loadParameters), m_pageID); 1069 1129 m_process->responsivenessTimer().start(); 1070 1130 } -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r202511 r202889 206 206 struct EditingRange; 207 207 struct EditorState; 208 struct LoadParameters; 208 209 struct PlatformPopupMenuData; 209 210 struct PrintInfo; … … 368 369 void closePage(bool stopResponsivenessTimer); 369 370 371 void addPlatformLoadParameters(LoadParameters&); 370 372 RefPtr<API::Navigation> loadRequest(const WebCore::ResourceRequest&, WebCore::ShouldOpenExternalURLsPolicy = WebCore::ShouldOpenExternalURLsPolicy::ShouldAllowExternalSchemes, API::Object* userData = nullptr); 371 373 RefPtr<API::Navigation> loadFile(const String& fileURL, const String& resourceDirectoryURL, API::Object* userData = nullptr); -
trunk/Source/WebKit2/UIProcess/ios/WKActionSheetAssistant.h
r197596 r202889 26 26 #if PLATFORM(IOS) 27 27 28 #import "DataDetectorsUISPI.h"29 28 #import "GestureTypes.h" 30 29 #import "WKActionSheet.h" 31 30 #import <UIKit/UIPopoverController.h> 31 #import <WebCore/DataDetectorsUISPI.h> 32 32 #import <wtf/RetainPtr.h> 33 33 -
trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm
r202884 r202889 30 30 31 31 #import "APIUIClient.h" 32 #import "DataDetectorsUISPI.h"33 32 #import "EditingRange.h" 34 33 #import "ManagedConfigurationSPI.h" … … 66 65 #import <WebCore/CoreGraphicsSPI.h> 67 66 #import <WebCore/DataDetectorsCoreSPI.h> 67 #import <WebCore/DataDetectorsUISPI.h> 68 68 #import <WebCore/FloatQuad.h> 69 69 #import <WebCore/Pasteboard.h> -
trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
r202852 r202889 597 597 29CD55AA128E294F00133C85 /* WKAccessibilityWebPageObjectBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 29CD55A8128E294F00133C85 /* WKAccessibilityWebPageObjectBase.h */; }; 598 598 29CD55AB128E294F00133C85 /* WKAccessibilityWebPageObjectBase.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29CD55A9128E294F00133C85 /* WKAccessibilityWebPageObjectBase.mm */; }; 599 2D1087601D2C573E00B85F82 /* LoadParameters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D10875E1D2C573E00B85F82 /* LoadParameters.cpp */; }; 600 2D1087611D2C573E00B85F82 /* LoadParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D10875F1D2C573E00B85F82 /* LoadParameters.h */; }; 601 2D1087631D2C641B00B85F82 /* LoadParametersCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D1087621D2C641B00B85F82 /* LoadParametersCocoa.mm */; }; 599 602 2D125C5E1857EA05003BA3CB /* ViewGestureController.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D125C5C1857EA05003BA3CB /* ViewGestureController.h */; }; 600 603 2D125C5F1857EA05003BA3CB /* ViewGestureControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D125C5D1857EA05003BA3CB /* ViewGestureControllerMac.mm */; }; … … 688 691 2DAF06D718BD1A470081CEB1 /* SmartMagnificationController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DAF06D518BD1A470081CEB1 /* SmartMagnificationController.mm */; }; 689 692 2DAF4FFB1B636181006013D6 /* ViewGestureController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2DAF4FFA1B636181006013D6 /* ViewGestureController.cpp */; }; 693 2DC4CF7B1D2DE24B00ECCC94 /* WebPageCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DC4CF7A1D2DE24B00ECCC94 /* WebPageCocoa.mm */; }; 690 694 2DC6D9C318C44A610043BAD4 /* WKWebViewContentProviderRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DC6D9C118C44A610043BAD4 /* WKWebViewContentProviderRegistry.h */; }; 691 695 2DC6D9C418C44A610043BAD4 /* WKWebViewContentProviderRegistry.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DC6D9C218C44A610043BAD4 /* WKWebViewContentProviderRegistry.mm */; }; … … 1736 1740 CE1A0BD21A48E6C60054EF74 /* AssertionServicesSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE1A0BCC1A48E6C60054EF74 /* AssertionServicesSPI.h */; }; 1737 1741 CE1A0BD31A48E6C60054EF74 /* CorePDFSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE1A0BCD1A48E6C60054EF74 /* CorePDFSPI.h */; }; 1738 CE1A0BD41A48E6C60054EF74 /* DataDetectorsUISPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE1A0BCE1A48E6C60054EF74 /* DataDetectorsUISPI.h */; };1739 1742 CE1A0BD51A48E6C60054EF74 /* ManagedConfigurationSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE1A0BCF1A48E6C60054EF74 /* ManagedConfigurationSPI.h */; }; 1740 1743 CE1A0BD61A48E6C60054EF74 /* TCCSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE1A0BD01A48E6C60054EF74 /* TCCSPI.h */; }; … … 2601 2604 2D0035221BC7414800DA8716 /* DeprecatedPDFPlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DeprecatedPDFPlugin.h; path = PDF/DeprecatedPDFPlugin.h; sourceTree = "<group>"; }; 2602 2605 2D0035231BC7414800DA8716 /* DeprecatedPDFPlugin.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = DeprecatedPDFPlugin.mm; path = PDF/DeprecatedPDFPlugin.mm; sourceTree = "<group>"; }; 2606 2D10875E1D2C573E00B85F82 /* LoadParameters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LoadParameters.cpp; sourceTree = "<group>"; }; 2607 2D10875F1D2C573E00B85F82 /* LoadParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoadParameters.h; sourceTree = "<group>"; }; 2608 2D1087621D2C641B00B85F82 /* LoadParametersCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LoadParametersCocoa.mm; sourceTree = "<group>"; }; 2603 2609 2D125C5C1857EA05003BA3CB /* ViewGestureController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewGestureController.h; sourceTree = "<group>"; }; 2604 2610 2D125C5D1857EA05003BA3CB /* ViewGestureControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ViewGestureControllerMac.mm; sourceTree = "<group>"; }; … … 2703 2709 2DAF06D818BD23BA0081CEB1 /* SmartMagnificationController.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; name = SmartMagnificationController.messages.in; path = ios/SmartMagnificationController.messages.in; sourceTree = "<group>"; }; 2704 2710 2DAF4FFA1B636181006013D6 /* ViewGestureController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ViewGestureController.cpp; sourceTree = "<group>"; }; 2711 2DC4CF7A1D2DE24B00ECCC94 /* WebPageCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPageCocoa.mm; sourceTree = "<group>"; }; 2705 2712 2DC6D9C118C44A610043BAD4 /* WKWebViewContentProviderRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebViewContentProviderRegistry.h; sourceTree = "<group>"; }; 2706 2713 2DC6D9C218C44A610043BAD4 /* WKWebViewContentProviderRegistry.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKWebViewContentProviderRegistry.mm; sourceTree = "<group>"; }; … … 3841 3848 CE1A0BCC1A48E6C60054EF74 /* AssertionServicesSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AssertionServicesSPI.h; sourceTree = "<group>"; }; 3842 3849 CE1A0BCD1A48E6C60054EF74 /* CorePDFSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CorePDFSPI.h; sourceTree = "<group>"; }; 3843 CE1A0BCE1A48E6C60054EF74 /* DataDetectorsUISPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataDetectorsUISPI.h; sourceTree = "<group>"; };3844 3850 CE1A0BCF1A48E6C60054EF74 /* ManagedConfigurationSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ManagedConfigurationSPI.h; sourceTree = "<group>"; }; 3845 3851 CE1A0BD01A48E6C60054EF74 /* TCCSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TCCSPI.h; sourceTree = "<group>"; }; … … 4483 4489 1A92DC1212F8BAB90017AF65 /* LayerTreeContext.cpp */, 4484 4490 1A92DC1012F8BA460017AF65 /* LayerTreeContext.h */, 4491 2D10875E1D2C573E00B85F82 /* LoadParameters.cpp */, 4492 2D10875F1D2C573E00B85F82 /* LoadParameters.h */, 4485 4493 2D50366A1BCDE17900E20BB3 /* NativeWebGestureEvent.h */, 4486 4494 C02BFF1512514FD8009CCBEA /* NativeWebKeyboardEvent.h */, … … 4898 4906 2D29ECCE192F2C2E00984B78 /* RemoteLayerTreeDisplayRefreshMonitor.h */, 4899 4907 2D29ECCF192F2C2E00984B78 /* RemoteLayerTreeDisplayRefreshMonitor.mm */, 4908 2DC4CF7A1D2DE24B00ECCC94 /* WebPageCocoa.mm */, 4900 4909 ); 4901 4910 path = Cocoa; … … 5237 5246 C55F916C1C595E440029E92D /* DataDetectionResult.h */, 5238 5247 C55F916D1C595E440029E92D /* DataDetectionResult.mm */, 5248 2D1087621D2C641B00B85F82 /* LoadParametersCocoa.mm */, 5239 5249 1AB1F78E1D1B34A6007C9BD1 /* WebCoreArgumentCodersCocoa.mm */, 5240 5250 37C4C0921814B3AF003688B9 /* WKNSArray.h */, … … 7158 7168 CDA041F31ACE2105004A13EC /* BackBoardServicesSPI.h */, 7159 7169 CE1A0BCD1A48E6C60054EF74 /* CorePDFSPI.h */, 7160 CE1A0BCE1A48E6C60054EF74 /* DataDetectorsUISPI.h */,7161 7170 CE1A0BCF1A48E6C60054EF74 /* ManagedConfigurationSPI.h */, 7162 7171 579D18B71CCFE34B00B1974C /* PhotosSPI.h */, … … 7461 7470 51032F1E180F791700961BB7 /* DatabaseToWebProcessConnectionMessages.h in Headers */, 7462 7471 C55F91711C59676E0029E92D /* DataDetectionResult.h in Headers */, 7463 CE1A0BD41A48E6C60054EF74 /* DataDetectorsUISPI.h in Headers */,7464 7472 1AC75380183BE50F0072CB15 /* DataReference.h in Headers */, 7465 7473 83891B6C1A68C30B0030F386 /* DiagnosticLoggingClient.h in Headers */, … … 7853 7861 7C85FD8019341665000177C4 /* WebPreferencesKeys.h in Headers */, 7854 7862 BCD598AC112B7FDF00EC8C23 /* WebPreferencesStore.h in Headers */, 7863 2D1087611D2C573E00B85F82 /* LoadParameters.h in Headers */, 7855 7864 BC032D9710F437AF0058C15A /* WebProcess.h in Headers */, 7856 7865 1A043A09124D11A900FFBFB5 /* WebProcessConnection.h in Headers */, … … 8878 8887 515E7727183DD6F60007203F /* AsyncRequest.cpp in Sources */, 8879 8888 BCEE966C112FAF57006BCC24 /* Attachment.cpp in Sources */, 8889 2D1087631D2C641B00B85F82 /* LoadParametersCocoa.mm in Sources */, 8880 8890 E1A31735134CEA80007C9A4F /* AttributedString.mm in Sources */, 8881 8891 512F589612A8838800629530 /* AuthenticationChallengeProxy.cpp in Sources */, … … 8938 8948 BC2652161182608100243E12 /* DrawingAreaProxy.cpp in Sources */, 8939 8949 1A64230812DD09EB00CAAE2C /* DrawingAreaProxyMessageReceiver.cpp in Sources */, 8950 2DC4CF7B1D2DE24B00ECCC94 /* WebPageCocoa.mm in Sources */, 8940 8951 8CFECE941490F140002AAA32 /* EditorState.cpp in Sources */, 8941 8952 51B15A8413843A3900321AD8 /* EnvironmentUtilities.cpp in Sources */, … … 9060 9071 1A2D82A8127F4EAB001EB962 /* NPRemoteObjectMap.cpp in Sources */, 9061 9072 1A2161B111F37664008AD0F5 /* NPRuntimeObjectMap.cpp in Sources */, 9073 2D1087601D2C573E00B85F82 /* LoadParameters.cpp in Sources */, 9062 9074 1A2162B011F38971008AD0F5 /* NPRuntimeUtilities.cpp in Sources */, 9063 9075 1A2D84A4127F6AD1001EB962 /* NPVariantData.cpp in Sources */, -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
r202511 r202889 1630 1630 } 1631 1631 1632 NSCachedURLResponse *WebFrameLoaderClient::willCacheResponse(DocumentLoader*, unsigned long identifier, NSCachedURLResponse* response) const1632 NSCachedURLResponse *WebFrameLoaderClient::willCacheResponse(DocumentLoader*, unsigned long identifier, NSCachedURLResponse* response) const 1633 1633 { 1634 1634 WebPage* webPage = m_frame->page(); … … 1637 1637 1638 1638 return webPage->injectedBundleResourceLoadClient().shouldCacheResponse(webPage, m_frame, identifier) ? response : nil; 1639 } 1640 1641 NSDictionary *WebFrameLoaderClient::dataDetectionContext() 1642 { 1643 WebPage* webPage = m_frame->page(); 1644 if (!webPage) 1645 return nil; 1646 1647 return webPage->dataDetectionContext(); 1639 1648 } 1640 1649 -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h
r202410 r202889 222 222 223 223 NSCachedURLResponse* willCacheResponse(WebCore::DocumentLoader*, unsigned long identifier, NSCachedURLResponse*) const override; 224 225 NSDictionary *dataDetectionContext() override; 224 226 #endif 225 227 -
trunk/Source/WebKit2/WebProcess/WebPage/Cocoa/WebPageCocoa.mm
r202888 r202889 1 1 /* 2 * Copyright (C) 201 4Apple Inc. All rights reserved.2 * Copyright (C) 2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 25 25 26 26 #import "config.h" 27 #import "WebP rocessProxy.h"27 #import "WebPage.h" 28 28 29 #import " DataDetectionResult.h"29 #import "LoadParameters.h" 30 30 31 #import <WebCore/SearchPopupMenuCocoa.h> 32 #import <wtf/cf/TypeCastsCF.h> 31 #if PLATFORM(COCOA) 32 33 using namespace WebCore; 33 34 34 35 namespace WebKit { 35 36 36 #if ENABLE(DATA_DETECTION) 37 void WebPageProxy::setDataDetectionResult(const DataDetectionResult& dataDetectionResult) 37 void WebPage::platformDidReceiveLoadParameters(const LoadParameters& loadParameters) 38 38 { 39 m_dataDetectionResults = dataDetectionResult.results; 40 } 41 #endif 42 43 void WebPageProxy::saveRecentSearches(const String& name, const Vector<WebCore::RecentSearch>& searchItems) 44 { 45 if (!name) { 46 // FIXME: This should be a message check. 47 return; 48 } 49 50 WebCore::saveRecentSearches(name, searchItems); 39 m_dataDetectionContext = loadParameters.dataDetectionContext; 51 40 } 52 41 53 void WebPageProxy::loadRecentSearches(const String& name, Vector<WebCore::RecentSearch>& searchItems) 54 { 55 if (!name) { 56 // FIXME: This should be a message check. 57 return; 58 } 42 } // namespace WebKit 59 43 60 searchItems = WebCore::loadRecentSearches(name); 61 } 62 63 #if ENABLE(CONTENT_FILTERING) 64 void WebPageProxy::contentFilterDidBlockLoadForFrame(const WebCore::ContentFilterUnblockHandler& unblockHandler, uint64_t frameID) 65 { 66 if (WebFrameProxy* frame = m_process->webFrame(frameID)) 67 frame->contentFilterDidBlockLoad(unblockHandler); 68 } 69 #endif 70 71 } 44 #endif // PLATFORM(COCOA) -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r202763 r202889 42 42 #include "InjectedBundleBackForwardList.h" 43 43 #include "InjectedBundleScriptWorld.h" 44 #include "LoadParameters.h" 44 45 #include "Logging.h" 45 46 #include "NetscapePlugin.h" … … 1140 1141 } 1141 1142 1142 void WebPage::loadRequest(uint64_t navigationID, const ResourceRequest& request, const SandboxExtension::Handle& sandboxExtensionHandle, uint64_t shouldOpenExternalURLsPolicy, const UserData& userData) 1143 #if !PLATFORM(COCOA) 1144 void WebPage::platformDidReceiveLoadParameters(const LoadParameters& loadParameters) 1145 { 1146 } 1147 #endif 1148 1149 void WebPage::loadRequest(const LoadParameters& loadParameters) 1143 1150 { 1144 1151 SendStopResponsivenessTimer stopper(this); 1145 1152 1146 m_pendingNavigationID = navigationID;1147 1148 m_sandboxExtensionTracker.beginLoad(m_mainFrame.get(), sandboxExtensionHandle);1153 m_pendingNavigationID = loadParameters.navigationID; 1154 1155 m_sandboxExtensionTracker.beginLoad(m_mainFrame.get(), loadParameters.sandboxExtensionHandle); 1149 1156 1150 1157 // Let the InjectedBundle know we are about to start the load, passing the user data from the UIProcess 1151 1158 // to all the client to set up any needed state. 1152 m_loaderClient.willLoadURLRequest(this, request, WebProcess::singleton().transformHandlesToObjects(userData.object()).get()); 1159 m_loaderClient.willLoadURLRequest(this, loadParameters.request, WebProcess::singleton().transformHandlesToObjects(loadParameters.userData.object()).get()); 1160 1161 platformDidReceiveLoadParameters(loadParameters); 1153 1162 1154 1163 // Initate the load in WebCore. 1155 FrameLoadRequest frameLoadRequest(m_mainFrame->coreFrame(), request, ShouldOpenExternalURLsPolicy::ShouldNotAllow);1156 ShouldOpenExternalURLsPolicy externalURLsPolicy = static_cast<ShouldOpenExternalURLsPolicy>( shouldOpenExternalURLsPolicy);1164 FrameLoadRequest frameLoadRequest(m_mainFrame->coreFrame(), loadParameters.request, ShouldOpenExternalURLsPolicy::ShouldNotAllow); 1165 ShouldOpenExternalURLsPolicy externalURLsPolicy = static_cast<ShouldOpenExternalURLsPolicy>(loadParameters.shouldOpenExternalURLsPolicy); 1157 1166 frameLoadRequest.setShouldOpenExternalURLsPolicy(externalURLsPolicy); 1158 1167 … … 1180 1189 } 1181 1190 1182 void WebPage::loadString (uint64_t navigationID, const String& htmlString, const String& MIMEType, const URL& baseURL, const URL& unreachableURL, const UserData& userData)1191 void WebPage::loadStringImpl(uint64_t navigationID, const String& htmlString, const String& MIMEType, const URL& baseURL, const URL& unreachableURL, const UserData& userData) 1183 1192 { 1184 1193 if (!htmlString.isNull() && htmlString.is8Bit()) { … … 1191 1200 } 1192 1201 1193 void WebPage::loadData(uint64_t navigationID, const IPC::DataReference& data, const String& MIMEType, const String& encodingName, const String& baseURLString, const UserData& userData) 1194 { 1195 RefPtr<SharedBuffer> sharedBuffer = SharedBuffer::create(reinterpret_cast<const char*>(data.data()), data.size()); 1196 URL baseURL = baseURLString.isEmpty() ? blankURL() : URL(URL(), baseURLString); 1197 loadDataImpl(navigationID, sharedBuffer, MIMEType, encodingName, baseURL, URL(), userData); 1198 } 1199 1200 void WebPage::loadHTMLString(uint64_t navigationID, const String& htmlString, const String& baseURLString, const UserData& userData) 1201 { 1202 URL baseURL = baseURLString.isEmpty() ? blankURL() : URL(URL(), baseURLString); 1203 loadString(navigationID, htmlString, ASCIILiteral("text/html"), baseURL, URL(), userData); 1204 } 1205 1206 void WebPage::loadAlternateHTMLString(const String& htmlString, const String& baseURLString, const String& unreachableURLString, const String& provisionalLoadErrorURLString, const UserData& userData) 1207 { 1208 URL baseURL = baseURLString.isEmpty() ? blankURL() : URL(URL(), baseURLString); 1209 URL unreachableURL = unreachableURLString.isEmpty() ? URL() : URL(URL(), unreachableURLString); 1210 URL provisionalLoadErrorURL = provisionalLoadErrorURLString.isEmpty() ? URL() : URL(URL(), provisionalLoadErrorURLString); 1202 void WebPage::loadData(const LoadParameters& loadParameters) 1203 { 1204 platformDidReceiveLoadParameters(loadParameters); 1205 1206 RefPtr<SharedBuffer> sharedBuffer = SharedBuffer::create(reinterpret_cast<const char*>(loadParameters.data.data()), loadParameters.data.size()); 1207 URL baseURL = loadParameters.baseURLString.isEmpty() ? blankURL() : URL(URL(), loadParameters.baseURLString); 1208 loadDataImpl(loadParameters.navigationID, sharedBuffer, loadParameters.MIMEType, loadParameters.encodingName, baseURL, URL(), loadParameters.userData); 1209 } 1210 1211 void WebPage::loadString(const LoadParameters& loadParameters) 1212 { 1213 platformDidReceiveLoadParameters(loadParameters); 1214 1215 URL baseURL = loadParameters.baseURLString.isEmpty() ? blankURL() : URL(URL(), loadParameters.baseURLString); 1216 loadStringImpl(loadParameters.navigationID, loadParameters.string, loadParameters.MIMEType, baseURL, URL(), loadParameters.userData); 1217 } 1218 1219 void WebPage::loadAlternateHTMLString(const LoadParameters& loadParameters) 1220 { 1221 platformDidReceiveLoadParameters(loadParameters); 1222 1223 URL baseURL = loadParameters.baseURLString.isEmpty() ? blankURL() : URL(URL(), loadParameters.baseURLString); 1224 URL unreachableURL = loadParameters.unreachableURLString.isEmpty() ? URL() : URL(URL(), loadParameters.unreachableURLString); 1225 URL provisionalLoadErrorURL = loadParameters.provisionalLoadErrorURLString.isEmpty() ? URL() : URL(URL(), loadParameters.provisionalLoadErrorURLString); 1211 1226 m_mainFrame->coreFrame()->loader().setProvisionalLoadErrorBeingHandledURL(provisionalLoadErrorURL); 1212 loadString (0, htmlString, ASCIILiteral("text/html"), baseURL, unreachableURL,userData);1227 loadStringImpl(0, loadParameters.string, ASCIILiteral("text/html"), baseURL, unreachableURL, loadParameters.userData); 1213 1228 m_mainFrame->coreFrame()->loader().setProvisionalLoadErrorBeingHandledURL({ }); 1214 }1215 1216 void WebPage::loadPlainTextString(const String& string, const UserData& userData)1217 {1218 loadString(0, string, ASCIILiteral("text/plain"), blankURL(), URL(), userData);1219 }1220 1221 void WebPage::loadWebArchiveData(const IPC::DataReference& webArchiveData, const UserData& userData)1222 {1223 RefPtr<SharedBuffer> sharedBuffer = SharedBuffer::create(reinterpret_cast<const char*>(webArchiveData.data()), webArchiveData.size() * sizeof(uint8_t));1224 loadDataImpl(0, sharedBuffer, ASCIILiteral("application/x-webarchive"), ASCIILiteral("utf-16"), blankURL(), URL(), userData);1225 1229 } 1226 1230 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h
r202763 r202889 193 193 struct EditorState; 194 194 struct InteractionInformationAtPosition; 195 struct LoadParameters; 195 196 struct PrintInfo; 196 197 struct WebPageCreationParameters; … … 854 855 bool pdfPluginEnabled() const { return m_pdfPluginEnabled; } 855 856 void setPDFPluginEnabled(bool enabled) { m_pdfPluginEnabled = enabled; } 857 858 NSDictionary *dataDetectionContext() const { return m_dataDetectionContext.get(); } 856 859 #endif 857 860 … … 999 1002 1000 1003 void loadDataImpl(uint64_t navigationID, PassRefPtr<WebCore::SharedBuffer>, const String& MIMEType, const String& encodingName, const WebCore::URL& baseURL, const WebCore::URL& failingURL, const UserData&); 1001 void loadString (uint64_t navigationID, const String&, const String& MIMEType, const WebCore::URL& baseURL, const WebCore::URL& failingURL, const UserData&);1004 void loadStringImpl(uint64_t navigationID, const String&, const String& MIMEType, const WebCore::URL& baseURL, const WebCore::URL& failingURL, const UserData&); 1002 1005 1003 1006 bool platformHasLocalDataForURL(const WebCore::URL&); … … 1005 1008 // Actions 1006 1009 void tryClose(); 1007 void loadRequest(uint64_t navigationID, const WebCore::ResourceRequest&, const SandboxExtension::Handle&, uint64_t shouldOpenExternalURLsPolicy, const UserData&); 1008 void loadData(uint64_t navigationID, const IPC::DataReference&, const String& MIMEType, const String& encodingName, const String& baseURL, const UserData&); 1009 void loadHTMLString(uint64_t navigationID, const String& htmlString, const String& baseURL, const UserData&); 1010 void loadAlternateHTMLString(const String& htmlString, const String& baseURL, const String& unreachableURL, const String& provisionalLoadErrorURL, const UserData&); 1011 void loadPlainTextString(const String&, const UserData&); 1012 void loadWebArchiveData(const IPC::DataReference&, const UserData&); 1010 void platformDidReceiveLoadParameters(const LoadParameters&); 1011 void loadRequest(const LoadParameters&); 1012 void loadData(const LoadParameters&); 1013 void loadString(const LoadParameters&); 1014 void loadAlternateHTMLString(const LoadParameters&); 1013 1015 void navigateToPDFLinkWithSimulatedClick(const String& url, WebCore::IntPoint documentPoint, WebCore::IntPoint screenPoint); 1014 1016 void reload(uint64_t navigationID, bool reloadFromOrigin, bool contentBlockersEnabled, const SandboxExtension::Handle&); … … 1280 1282 1281 1283 ViewGestureGeometryCollector m_viewGestureGeometryCollector; 1284 1285 RetainPtr<NSDictionary> m_dataDetectionContext; 1282 1286 1283 1287 #elif HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL)) -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
r202763 r202889 133 133 134 134 LoadURLInFrame(String url, uint64_t frameID) 135 LoadRequest(uint64_t navigationID, WebCore::ResourceRequest request, WebKit::SandboxExtension::Handle sandboxExtensionHandle, uint64_t shouldOpenExternalURLsPolicy, WebKit::UserData userData) 136 LoadData(uint64_t navigationID, IPC::DataReference data, String MIMEType, String encoding, String baseURL, WebKit::UserData userData) 137 LoadHTMLString(uint64_t navigationID, String htmlString, String baseURL, WebKit::UserData userData) 138 LoadAlternateHTMLString(String htmlString, String baseURL, String unreachableURL, String provisionalLoadErrorURL, WebKit::UserData userData) 139 LoadPlainTextString(String string, WebKit::UserData userData) 140 LoadWebArchiveData(IPC::DataReference webArchiveData, WebKit::UserData userData) 135 LoadRequest(struct WebKit::LoadParameters loadParameters) 136 LoadData(struct WebKit::LoadParameters loadParameters) 137 LoadString(struct WebKit::LoadParameters loadParameters) 138 LoadAlternateHTMLString(struct WebKit::LoadParameters loadParameters) 139 141 140 NavigateToPDFLinkWithSimulatedClick(String url, WebCore::IntPoint documentPoint, WebCore::IntPoint screenPoint) 142 141 -
trunk/Tools/ChangeLog
r202883 r202889 1 2016-07-06 Tim Horton <timothy_horton@apple.com> 2 3 Email from June 1st containing text 'Today @ 7:10PM' is linkified, but shouldn't be 4 https://bugs.webkit.org/show_bug.cgi?id=159498 5 <rdar://problem/26719903> 6 7 Reviewed by Sam Weinig. 8 9 * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: 10 * TestWebKitAPI/Tests/WebKit2Cocoa/DataDetection.mm: Added. 11 (-[DataDetectionNavigationDelegate webView:didFinishNavigation:]): 12 (-[DataDetectionUIDelegate _dataDetectionContextForWebView:]): 13 (expectLinkCount): 14 (TEST): 15 Add a test ensuring that ReferenceDate in the DataDetectors context is respected 16 when deciding what to linkify. 17 1 18 2016-07-06 Alexey Proskuryakov <ap@apple.com> 2 19 -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r202822 r202889 50 50 2D1646E21D1862CD00015A1A /* DeferredViewInWindowStateChange.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D1646E11D1862CD00015A1A /* DeferredViewInWindowStateChange.mm */; }; 51 51 2D51A0C71C8BF00C00765C45 /* DOMHTMLVideoElementWrapper.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D51A0C51C8BF00400765C45 /* DOMHTMLVideoElementWrapper.mm */; }; 52 2DC4CF771D2D9DD800ECCC94 /* DataDetection.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DC4CF761D2D9DD800ECCC94 /* DataDetection.mm */; }; 52 53 2DD7D3AF178227B30026E1E3 /* lots-of-text-vertical-lr.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 2DD7D3AE178227AC0026E1E3 /* lots-of-text-vertical-lr.html */; }; 53 54 2E7765CD16C4D80A00BA2BB1 /* mainIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2E7765CC16C4D80A00BA2BB1 /* mainIOS.mm */; }; … … 661 662 2D8104CB1BEC13E70020DA46 /* FindInPage.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FindInPage.mm; sourceTree = "<group>"; }; 662 663 2D9A53AE1B31FA8D0074D5AA /* ShrinkToFit.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ShrinkToFit.mm; sourceTree = "<group>"; }; 664 2DC4CF761D2D9DD800ECCC94 /* DataDetection.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DataDetection.mm; sourceTree = "<group>"; }; 663 665 2DD355351BD08378005DF4A7 /* AutoLayoutIntegration.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AutoLayoutIntegration.mm; sourceTree = "<group>"; }; 664 666 2DD7D3A9178205D00026E1E3 /* ResizeReversePaginatedWebView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResizeReversePaginatedWebView.cpp; sourceTree = "<group>"; }; … … 1167 1169 A14FC5891B89927100D107EB /* ContentFilteringPlugIn.mm */, 1168 1170 1AAD19F51C7CE20300831E47 /* Coding.mm */, 1171 2DC4CF761D2D9DD800ECCC94 /* DataDetection.mm */, 1169 1172 A1A4FE5D18DD3DB700B5EA8A /* Download.mm */, 1170 1173 2D8104CB1BEC13E70020DA46 /* FindInPage.mm */, … … 2129 2132 7CCE7F051A411AE600447C4C /* NewFirstVisuallyNonEmptyLayoutFrames.cpp in Sources */, 2130 2133 7CCE7F251A411AF600447C4C /* OpenAndCloseWindow.mm in Sources */, 2134 2DC4CF771D2D9DD800ECCC94 /* DataDetection.mm in Sources */, 2131 2135 7CCE7F071A411AE600447C4C /* PageLoadBasic.cpp in Sources */, 2132 2136 7C83E0C11D0A652F00FEBCF3 /* ProvisionalURLNotChange.mm in Sources */,
Note:
See TracChangeset
for help on using the changeset viewer.