Changeset 272228 in webkit
- Timestamp:
- Feb 2, 2021 12:57:05 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r272195 r272228 1 2021-02-02 Alex Christensen <achristensen@webkit.org> 2 3 Adopt UIEventAttribution instead of _UIEventAttribution 4 https://bugs.webkit.org/show_bug.cgi?id=220683 5 6 Reviewed by John Wilander. 7 8 * wtf/PlatformHave.h: 9 1 10 2021-02-02 Carlos Garcia Campos <cgarcia@igalia.com> 2 11 -
trunk/Source/WTF/wtf/PlatformHave.h
r272188 r272228 743 743 #endif 744 744 745 #if ((PLATFORM(IOS) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000) 746 #define HAVE_UI_EVENT_ATTRIBUTION 1 747 #endif 748 745 749 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 120000) \ 746 750 || ((PLATFORM(IOS) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000) \ -
trunk/Source/WebKit/ChangeLog
r272217 r272228 1 2021-02-02 Alex Christensen <achristensen@webkit.org> 2 3 Adopt UIEventAttribution instead of _UIEventAttribution 4 https://bugs.webkit.org/show_bug.cgi?id=220683 5 6 Reviewed by John Wilander. 7 8 UIKit introduced UIEventAttribution, so let's adopt it so they can remove their SPI. 9 See rdar://73629041 10 11 * UIProcess/API/Cocoa/WKWebViewPrivate.h: 12 * UIProcess/API/ios/WKWebViewIOS.mm: 13 (-[WKWebView _setUIEventAttribution:]): 14 (-[WKWebView _uiEventAttribution]): 15 1 16 2021-02-02 Rini Patel <rini_patel@apple.com> 2 17 -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h
r272096 r272228 109 109 #endif 110 110 111 @class UIEventAttribution; 111 112 @class WKBrowsingContextHandle; 112 113 @class WKDownload; … … 395 396 396 397 @property (nonatomic, copy, setter=_setEventAttribution:) _UIEventAttribution *_eventAttribution WK_API_AVAILABLE(ios(WK_IOS_TBA)); 398 @property (nonatomic, copy, setter=_setUIEventAttribution:) UIEventAttribution *_uiEventAttribution WK_API_AVAILABLE(ios(WK_IOS_TBA)); 397 399 398 400 @property (nonatomic, readonly) CGRect _contentVisibleRect WK_API_AVAILABLE(ios(10.0)); -
trunk/Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm
r271771 r272228 66 66 #endif 67 67 68 #if HAVE(UI_EVENT_ATTRIBUTION) 69 #import <UIKit/UIEventAttribution.h> 70 #endif 71 68 72 #include "UIKitSoftLink.h" 69 73 … … 2523 2527 @implementation WKWebView (WKPrivateIOS) 2524 2528 2529 - (void)_setUIEventAttribution:(UIEventAttribution *)attribution 2530 { 2531 #if HAVE(UI_EVENT_ATTRIBUTION) 2532 if (attribution) { 2533 WebCore::PrivateClickMeasurement measurement( 2534 WebCore::PrivateClickMeasurement::SourceID(attribution.sourceIdentifier), 2535 WebCore::PrivateClickMeasurement::SourceSite(attribution.reportEndpoint), 2536 WebCore::PrivateClickMeasurement::AttributeOnSite(attribution.destinationURL), 2537 attribution.sourceDescription, 2538 attribution.purchaser 2539 ); 2540 _page->setPrivateClickMeasurement(WTFMove(measurement)); 2541 } else 2542 _page->setPrivateClickMeasurement(WTF::nullopt); 2543 #endif 2544 } 2545 2546 - (UIEventAttribution *)_uiEventAttribution 2547 { 2548 #if HAVE(UI_EVENT_ATTRIBUTION) 2549 auto& measurement = _page->privateClickMeasurement(); 2550 if (!measurement || !measurement->sourceID().isValid()) 2551 return nil; 2552 2553 auto attributeOnURL = URL(URL(), makeString("https://", measurement->attributeOnSite().registrableDomain.string())); 2554 return [[[UIEventAttribution alloc] initWithSourceIdentifier:measurement->sourceID().id destinationURL:attributeOnURL sourceDescription:measurement->sourceDescription() purchaser:measurement->purchaser()] autorelease]; 2555 #else 2556 return nil; 2557 #endif 2558 } 2559 2525 2560 - (void)_setEventAttribution:(_UIEventAttribution *)attribution 2526 2561 { -
trunk/Tools/ChangeLog
r272220 r272228 1 2021-02-02 Alex Christensen <achristensen@webkit.org> 2 3 Adopt UIEventAttribution instead of _UIEventAttribution 4 https://bugs.webkit.org/show_bug.cgi?id=220683 5 6 Reviewed by John Wilander. 7 8 * TestWebKitAPI/Tests/WebKitCocoa/EventAttribution.mm: 9 (-[MockEventAttribution initWithReportEndpoint:destinationURL:]): 10 (TestWebKitAPI::TEST): 11 (-[MockEventAttribution initWithReportEndpoint:attributeOn:]): Deleted. 12 1 13 2021-02-02 Aakash Jain <aakash_jain@apple.com> 2 14 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/EventAttribution.mm
r271799 r272228 26 26 #import "config.h" 27 27 28 #if PLATFORM(IOS_FAMILY)28 #if HAVE(UI_EVENT_ATTRIBUTION) 29 29 30 30 #import "HTTPServer.h" … … 39 39 40 40 @property (nonatomic, assign, readonly) uint8_t sourceIdentifier; 41 @property (nonatomic, copy, readonly) NSURL * attributeOn;41 @property (nonatomic, copy, readonly) NSURL *destinationURL; 42 42 @property (nonatomic, copy, readonly) NSURL *reportEndpoint; 43 43 @property (nonatomic, copy, readonly) NSString *sourceDescription; 44 44 @property (nonatomic, copy, readonly) NSString *purchaser; 45 - (instancetype)initWithReportEndpoint:(NSURL *)reportEndpoint attributeOn:(NSURL *)attributeOn;45 - (instancetype)initWithReportEndpoint:(NSURL *)reportEndpoint destinationURL:(NSURL *)destinationURL; 46 46 47 47 @end … … 49 49 @implementation MockEventAttribution 50 50 51 - (instancetype)initWithReportEndpoint:(NSURL *)reportEndpoint attributeOn:(NSURL *)attributeOn51 - (instancetype)initWithReportEndpoint:(NSURL *)reportEndpoint destinationURL:(NSURL *)destinationURL 52 52 { 53 53 if (!(self = [super init])) … … 55 55 56 56 _sourceIdentifier = 42; 57 _ attributeOn = attributeOn;57 _destinationURL = destinationURL; 58 58 _reportEndpoint = reportEndpoint; 59 59 _sourceDescription = @"test source description"; … … 102 102 103 103 auto exampleURL = [NSURL URLWithString:@"https://example.com/"]; 104 auto attribution = [[[MockEventAttribution alloc] initWithReportEndpoint:server.request().URL attributeOn:exampleURL] autorelease];104 auto attribution = [[[MockEventAttribution alloc] initWithReportEndpoint:server.request().URL destinationURL:exampleURL] autorelease]; 105 105 auto webView = [[WKWebView new] autorelease]; 106 webView._ eventAttribution = (_UIEventAttribution *)attribution;106 webView._uiEventAttribution = (UIEventAttribution *)attribution; 107 107 [webView.configuration.websiteDataStore _setResourceLoadStatisticsEnabled:YES]; 108 108 [webView.configuration.websiteDataStore _allowTLSCertificateChain:@[(id)testCertificate().get()] forHost:serverURL.host];
Note: See TracChangeset
for help on using the changeset viewer.