Changeset 225765 in webkit
- Timestamp:
- Dec 11, 2017 4:53:30 PM (6 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r225763 r225765 1 2017-12-11 Alex Christensen <achristensen@webkit.org> 2 3 Add a WKPageGroupRef setter in WKWebViewConfiguration 4 https://bugs.webkit.org/show_bug.cgi?id=180674 5 <rdar://problem/35920392> 6 7 Reviewed by Brady Eidson. 8 9 There is a Mac app trying to transition to WKWebView, and it uses WKPageGroupRef extensively. 10 To help it transition, we are temporarily giving it an ObjC way to use this organization for 11 its UserContentControllers to be united per PageGroup before it transitions away from SPIs like 12 WKBundleAddUserScript. Make it Mac-only to indicate that this should be transitioned away from, 13 rather than adopted on iOS. 14 15 No change in behavior for apps not using the new WKWebViewConfiguration._pageGroup SPI. 16 17 * UIProcess/API/Cocoa/WKWebView.mm: 18 (-[WKWebView _initializeWithConfiguration:]): 19 * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: 20 (-[WKWebViewConfiguration copyWithZone:]): 21 (-[WKWebViewConfiguration _pageGroup]): 22 (-[WKWebViewConfiguration _setPageGroup:]): 23 * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: 24 1 25 2017-12-11 Brent Fulgham <bfulgham@apple.com> 2 26 -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
r225714 r225765 518 518 pageConfiguration->setOverrideContentSecurityPolicy(overrideContentSecurityPolicy); 519 519 520 RefPtr<WebKit::WebPageGroup> pageGroup; 521 NSString *groupIdentifier = configuration._groupIdentifier; 522 if (groupIdentifier.length) { 523 pageGroup = WebKit::WebPageGroup::create(configuration._groupIdentifier); 524 pageConfiguration->setPageGroup(pageGroup.get()); 520 #if PLATFORM(MAC) 521 if (auto pageGroup = WebKit::toImpl([configuration _pageGroup])) { 522 pageConfiguration->setPageGroup(pageGroup); 523 pageConfiguration->setUserContentController(&pageGroup->userContentController()); 524 } else 525 #endif 526 { 527 NSString *groupIdentifier = configuration._groupIdentifier; 528 if (groupIdentifier.length) 529 pageConfiguration->setPageGroup(WebKit::WebPageGroup::create(configuration._groupIdentifier).ptr()); 525 530 } 526 531 -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm
r225615 r225765 33 33 #import "WKPreferences.h" 34 34 #import "WKProcessPool.h" 35 #import "WKRetainPtr.h" 35 36 #import "WKUserContentController.h" 36 37 #import "WKWebView.h" … … 137 138 138 139 #if PLATFORM(MAC) 140 WKRetainPtr<WKPageGroupRef> _pageGroup; 139 141 double _cpuLimit; 140 142 BOOL _showsURLsInToolTips; … … 348 350 configuration->_imageControlsEnabled = self->_imageControlsEnabled; 349 351 configuration->_requiresUserActionForEditingControlsManager = self->_requiresUserActionForEditingControlsManager; 352 configuration->_pageGroup = self._pageGroup; 350 353 #endif 351 354 #if ENABLE(DATA_DETECTION) && PLATFORM(IOS) … … 811 814 } 812 815 816 - (WKPageGroupRef)_pageGroup 817 { 818 return _pageGroup.get(); 819 } 820 821 - (void)_setPageGroup:(WKPageGroupRef)pageGroup 822 { 823 _pageGroup = pageGroup; 824 } 825 813 826 - (void)_setCPULimit:(double)cpuLimit 814 827 { -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h
r225615 r225765 27 27 28 28 #if WK_API_ENABLED 29 30 #import <WebKit/WKBase.h> 29 31 30 32 #if TARGET_OS_IPHONE … … 81 83 @property (nonatomic, readwrite, setter=_setRequiresUserActionForEditingControlsManager:) BOOL _requiresUserActionForEditingControlsManager WK_API_AVAILABLE(macosx(10.12)); 82 84 @property (nonatomic, readwrite, setter=_setCPULimit:) double _cpuLimit WK_API_AVAILABLE(macosx(WK_MAC_TBA)); 85 @property (nonatomic, readwrite, setter=_setPageGroup:) WKPageGroupRef _pageGroup WK_API_AVAILABLE(macosx(WK_MAC_TBA)); 83 86 #endif 84 87
Note: See TracChangeset
for help on using the changeset viewer.