Changeset 215246 in webkit
- Timestamp:
- Apr 11, 2017 11:43:46 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 11 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r215242 r215246 1 2017-04-11 David Quesada <david_quesada@apple.com> 2 3 Add SPI for handling geolocation authorization requests 4 https://bugs.webkit.org/show_bug.cgi?id=170362 5 rdar://problem/17508627 6 7 Reviewed by Alex Christensen. 8 9 Add a new WKUIDelegate method for the WKGeolocationProviderIOS to call when a web page 10 requests geolocation access. To support testing this change, make it possible to override 11 the CoreLocation abstraction WKGeolocationProviderIOS uses. There is now a configurable 12 object on the process pool that implements a protocol for providing location updates for 13 web views in the process pool. If the client doesn't provide this object, 14 WKGeolocationProviderIOS falls back to an object that wraps the existing WebKit1 15 WebGeolocationCoreLocationProvider and conforms to the new protocol. 16 17 * Shared/Cocoa/APIObject.mm: 18 (API::Object::newObject): 19 * Shared/WebGeolocationPosition.h: 20 (WebKit::WebGeolocationPosition::create): 21 * UIProcess/API/C/WKGeolocationPosition.cpp: 22 (WKGeolocationPositionCreate_b): 23 * UIProcess/API/Cocoa/WKProcessPool.mm: 24 (-[WKProcessPool _coreLocationProvider]): 25 (-[WKProcessPool _setCoreLocationProvider:]): 26 * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: 27 * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: 28 * UIProcess/API/Cocoa/_WKGeolocationCoreLocationProvider.h: Copied from Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp. 29 * UIProcess/API/Cocoa/_WKGeolocationPosition.h: Copied from Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp. 30 * UIProcess/API/Cocoa/_WKGeolocationPosition.mm: Added. 31 (WebKit::if): 32 (-[_WKGeolocationPosition dealloc]): 33 (-[_WKGeolocationPosition _apiObject]): 34 * UIProcess/API/Cocoa/_WKGeolocationPositionInternal.h: Copied from Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp. 35 (WebKit::wrapper): 36 * UIProcess/ios/WKGeolocationProviderIOS.mm: 37 (kit): 38 (-[WKGeolocationProviderIOS initWithProcessPool:]): 39 (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]): 40 (-[WKGeolocationProviderIOS positionChanged:]): 41 (-[WKLegacyCoreLocationProvider setListener:]): 42 (-[WKLegacyCoreLocationProvider requestGeolocationAuthorization]): 43 (-[WKLegacyCoreLocationProvider start]): 44 (-[WKLegacyCoreLocationProvider stop]): 45 (-[WKLegacyCoreLocationProvider setEnableHighAccuracy:]): 46 (-[WKLegacyCoreLocationProvider geolocationAuthorizationGranted]): 47 (-[WKLegacyCoreLocationProvider geolocationAuthorizationDenied]): 48 (-[WKLegacyCoreLocationProvider positionChanged:]): 49 (-[WKLegacyCoreLocationProvider errorOccurred:]): 50 (-[WKLegacyCoreLocationProvider resetGeolocation]): 51 Implement a new class that bridges the currently used WebGeolocationCoreLocationProvider 52 to conform to the _WKGeolocationCoreLocationProvider protocol that WKGeolocationProviderIOS 53 expects. 54 * WebKit2.xcodeproj/project.pbxproj: 55 1 56 2017-04-11 Eric Carlson <eric.carlson@apple.com> 2 57 -
trunk/Source/WebKit2/Shared/Cocoa/APIObject.mm
r213947 r215246 73 73 #import "_WKExperimentalFeatureInternal.h" 74 74 #import "_WKFrameHandleInternal.h" 75 #import "_WKGeolocationPositionInternal.h" 75 76 #import "_WKHitTestResultInternal.h" 76 77 #import "_WKProcessPoolConfigurationInternal.h" … … 180 181 break; 181 182 183 #if PLATFORM(IOS) 184 case Type::GeolocationPosition: 185 wrapper = [_WKGeolocationPosition alloc]; 186 break; 187 #endif 188 182 189 case Type::HTTPCookieStore: 183 190 wrapper = [WKHTTPCookieStore alloc]; -
trunk/Source/WebKit2/Shared/WebGeolocationPosition.h
r204668 r215246 59 59 }; 60 60 61 static PassRefPtr<WebGeolocationPosition> create(double timestamp, double latitude, double longitude, double accuracy, bool providesAltitude, double altitude, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed)61 static Ref<WebGeolocationPosition> create(double timestamp, double latitude, double longitude, double accuracy, bool providesAltitude, double altitude, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed) 62 62 { 63 return adoptRef( new WebGeolocationPosition(timestamp, latitude, longitude, accuracy, providesAltitude, altitude, providesAltitudeAccuracy, altitudeAccuracy, providesHeading, heading, providesSpeed, speed));63 return adoptRef(*new WebGeolocationPosition(timestamp, latitude, longitude, accuracy, providesAltitude, altitude, providesAltitudeAccuracy, altitudeAccuracy, providesHeading, heading, providesSpeed, speed)); 64 64 } 65 65 -
trunk/Source/WebKit2/UIProcess/API/C/WKGeolocationPosition.cpp
r202242 r215246 45 45 { 46 46 auto position = WebGeolocationPosition::create(timestamp, latitude, longitude, accuracy, providesAltitude, altitude, providesAltitudeAccuracy, altitudeAccuracy, providesHeading, heading, providesSpeed, speed); 47 return toAPI( position.leakRef());47 return toAPI(&position.leakRef()); 48 48 } -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKProcessPool.mm
r213877 r215246 62 62 #if PLATFORM(IOS) 63 63 RetainPtr<WKGeolocationProviderIOS> _geolocationProvider; 64 RetainPtr<id <_WKGeolocationCoreLocationProvider>> _coreLocationProvider; 64 65 #endif // PLATFORM(IOS) 65 66 } … … 309 310 } 310 311 312 #if PLATFORM(IOS) 313 - (id <_WKGeolocationCoreLocationProvider>)_coreLocationProvider 314 { 315 return _coreLocationProvider.get(); 316 } 317 318 - (void)_setCoreLocationProvider:(id<_WKGeolocationCoreLocationProvider>)coreLocationProvider 319 { 320 if (_geolocationProvider) 321 [NSException raise:NSGenericException format:@"Changing the location provider is not supported after a web view in the process pool has begun servicing geolocation requests."]; 322 323 _coreLocationProvider = coreLocationProvider; 324 } 325 #endif // PLATFORM(IOS) 326 311 327 @end 312 328 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKProcessPoolPrivate.h
r205559 r215246 32 32 @protocol _WKAutomationDelegate; 33 33 @protocol _WKDownloadDelegate; 34 @protocol _WKGeolocationCoreLocationProvider; 34 35 35 36 @interface WKProcessPool () … … 55 56 @property (nonatomic, weak, setter=_setAutomationDelegate:) id <_WKAutomationDelegate> _automationDelegate WK_API_AVAILABLE(macosx(10.12), ios(10.0)); 56 57 58 #if TARGET_OS_IPHONE 59 @property (nonatomic, setter=_setCoreLocationProvider:) id <_WKGeolocationCoreLocationProvider> _coreLocationProvider WK_API_AVAILABLE(ios(WK_IOS_TBA)); 60 #endif 61 57 62 + (NSURL *)_websiteDataURLForContainerWithURL:(NSURL *)containerURL; 58 63 + (NSURL *)_websiteDataURLForContainerWithURL:(NSURL *)containerURL bundleIdentifierIfNotInContainer:(NSString *)bundleIdentifier; -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUIDelegatePrivate.h
r214440 r215246 36 36 @class UIScrollView; 37 37 @class UIViewController; 38 @class WKFrameInfo; 38 39 @class _WKContextMenuElementInfo; 39 40 @class _WKActivatedElementInfo; … … 73 74 - (void)_webView:(WKWebView *)webView didNotHandleTapAsClickAtPoint:(CGPoint)point; 74 75 - (BOOL)_webView:(WKWebView *)webView shouldRequestGeolocationAuthorizationForURL:(NSURL *)url isMainFrame:(BOOL)isMainFrame mainFrameURL:(NSURL *)mainFrameURL; 76 - (void)_webView:(WKWebView *)webView requestGeolocationAuthorizationForURL:(NSURL *)url frame:(WKFrameInfo *)frame decisionHandler:(void (^)(BOOL authorized))decisionHandler WK_API_AVAILABLE(ios(WK_IOS_TBA)); 75 77 - (UIViewController *)_webView:(WKWebView *)webView previewViewControllerForURL:(NSURL *)url WK_API_AVAILABLE(ios(9.0)); 76 78 - (void)_webView:(WKWebView *)webView commitPreviewedViewController:(UIViewController *)previewedViewController WK_API_AVAILABLE(ios(9.0)); -
trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKGeolocationCoreLocationProvider.h
r215245 r215246 1 1 /* 2 * Copyright (C) 201 1, 2012Apple Inc. All rights reserved.2 * Copyright (C) 2017 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 #include "config.h" 27 #include "WKGeolocationPosition.h" 26 #import <WebKit/WKFoundation.h> 28 27 29 #include "WKAPICast.h" 30 #include "WebGeolocationPosition.h" 28 #if WK_API_ENABLED && TARGET_OS_IPHONE 31 29 32 using namespace WebKit; 30 #import <Foundation/NSObject.h> 33 31 34 WKTypeID WKGeolocationPositionGetTypeID() 35 { 36 return toAPI(WebGeolocationPosition::APIType); 37 } 32 NS_ASSUME_NONNULL_BEGIN 38 33 39 WKGeolocationPositionRef WKGeolocationPositionCreate(double timestamp, double latitude, double longitude, double accuracy) 40 { 41 return WKGeolocationPositionCreate_b(timestamp, latitude, longitude, accuracy, false, 0., false, 0., false, 0., false, 0.); 42 } 34 @class _WKGeolocationPosition; 43 35 44 WKGeolocationPositionRef WKGeolocationPositionCreate_b(double timestamp, double latitude, double longitude, double accuracy, bool providesAltitude, double altitude, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed) 45 { 46 auto position = WebGeolocationPosition::create(timestamp, latitude, longitude, accuracy, providesAltitude, altitude, providesAltitudeAccuracy, altitudeAccuracy, providesHeading, heading, providesSpeed, speed); 47 return toAPI(position.leakRef()); 48 } 36 @protocol _WKGeolocationCoreLocationListener <NSObject> 37 - (void)geolocationAuthorizationGranted; 38 - (void)geolocationAuthorizationDenied; 39 - (void)positionChanged:(_WKGeolocationPosition *)position; 40 - (void)errorOccurred:(NSString *)errorMessage; 41 - (void)resetGeolocation; 42 @end 43 44 @protocol _WKGeolocationCoreLocationProvider <NSObject> 45 - (void)setListener:(id <_WKGeolocationCoreLocationListener>)listener; 46 - (void)requestGeolocationAuthorization; 47 - (void)start; 48 - (void)stop; 49 - (void)setEnableHighAccuracy:(BOOL)flag; 50 @end 51 52 NS_ASSUME_NONNULL_END 53 54 #endif // WK_API_ENABLED && TARGET_OS_IPHONE -
trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKGeolocationPosition.h
r215245 r215246 1 1 /* 2 * Copyright (C) 201 1, 2012Apple Inc. All rights reserved.2 * Copyright (C) 2017 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 #include "config.h" 27 #include "WKGeolocationPosition.h" 26 #import <WebKit/WKFoundation.h> 28 27 29 #include "WKAPICast.h" 30 #include "WebGeolocationPosition.h" 28 #if WK_API_ENABLED && TARGET_OS_IPHONE 31 29 32 using namespace WebKit; 30 #import <Foundation/Foundation.h> 33 31 34 WKTypeID WKGeolocationPositionGetTypeID() 35 { 36 return toAPI(WebGeolocationPosition::APIType); 37 } 32 @class CLLocation; 38 33 39 WKGeolocationPositionRef WKGeolocationPositionCreate(double timestamp, double latitude, double longitude, double accuracy) 40 { 41 return WKGeolocationPositionCreate_b(timestamp, latitude, longitude, accuracy, false, 0., false, 0., false, 0., false, 0.); 42 } 34 NS_ASSUME_NONNULL_BEGIN 43 35 44 WKGeolocationPositionRef WKGeolocationPositionCreate_b(double timestamp, double latitude, double longitude, double accuracy, bool providesAltitude, double altitude, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed) 45 { 46 auto position = WebGeolocationPosition::create(timestamp, latitude, longitude, accuracy, providesAltitude, altitude, providesAltitudeAccuracy, altitudeAccuracy, providesHeading, heading, providesSpeed, speed); 47 return toAPI(position.leakRef()); 48 } 36 WK_CLASS_AVAILABLE(ios(WK_IOS_TBA)) 37 @interface _WKGeolocationPosition : NSObject 38 39 + (instancetype)positionWithLocation:(CLLocation *)location; 40 41 @end 42 43 NS_ASSUME_NONNULL_END 44 45 #endif // WK_API_ENABLED && TARGET_OS_IPHONE -
trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKGeolocationPositionInternal.h
r215245 r215246 1 1 /* 2 * Copyright (C) 201 1, 2012Apple Inc. All rights reserved.2 * Copyright (C) 2017 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 #include "config.h" 27 #include "WKGeolocationPosition.h" 26 #import "_WKGeolocationPosition.h" 28 27 29 #include "WKAPICast.h" 30 #include "WebGeolocationPosition.h" 28 #if WK_API_ENABLED && TARGET_OS_IPHONE 31 29 32 using namespace WebKit; 30 #import "WebGeolocationPosition.h" 33 31 34 WKTypeID WKGeolocationPositionGetTypeID() 32 namespace WebKit { 33 34 inline _WKGeolocationPosition *wrapper(WebKit::WebGeolocationPosition &position) 35 35 { 36 return toAPI(WebGeolocationPosition::APIType); 36 ASSERT([position.wrapper() isKindOfClass:[_WKGeolocationPosition class]]); 37 return (_WKGeolocationPosition *)position.wrapper(); 37 38 } 38 39 39 WKGeolocationPositionRef WKGeolocationPositionCreate(double timestamp, double latitude, double longitude, double accuracy)40 {41 return WKGeolocationPositionCreate_b(timestamp, latitude, longitude, accuracy, false, 0., false, 0., false, 0., false, 0.);42 40 } 43 41 44 WKGeolocationPositionRef WKGeolocationPositionCreate_b(double timestamp, double latitude, double longitude, double accuracy, bool providesAltitude, double altitude, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed) 45 { 46 auto position = WebGeolocationPosition::create(timestamp, latitude, longitude, accuracy, providesAltitude, altitude, providesAltitudeAccuracy, altitudeAccuracy, providesHeading, heading, providesSpeed, speed); 47 return toAPI(position.leakRef()); 42 @interface _WKGeolocationPosition () <WKObject> { 43 @package 44 API::ObjectStorage<WebKit::WebGeolocationPosition> _geolocationPosition; 48 45 } 46 @end 47 48 #endif // WK_API_ENABLED && TARGET_OS_IPHONE -
trunk/Source/WebKit2/UIProcess/ios/WKGeolocationProviderIOS.mm
r208342 r215246 29 29 #if PLATFORM(IOS) 30 30 31 #import "APIFrameInfo.h" 31 32 #import "APISecurityOrigin.h" 33 #import "CompletionHandlerCallChecker.h" 32 34 #import "GeolocationPermissionRequestProxy.h" 35 #import "WKFrameInfoInternal.h" 36 #import "WKProcessPoolInternal.h" 33 37 #import "WKUIDelegatePrivate.h" 34 38 #import "WKWebView.h" 35 39 #import "WebGeolocationManagerProxy.h" 36 40 #import "WebProcessPool.h" 41 #import "_WKGeolocationCoreLocationProvider.h" 42 #import "_WKGeolocationPositionInternal.h" 37 43 #import <WebCore/GeolocationPosition.h> 38 44 #import <WebCore/URL.h> 39 45 #import <WebGeolocationPosition.h> 40 46 #import <wtf/Assertions.h> 47 #import <wtf/BlockPtr.h> 41 48 #import <wtf/HashSet.h> 42 49 #import <wtf/PassRefPtr.h> … … 54 61 #pragma clang diagnostic ignored "-Wdeprecated-declarations" 55 62 56 @interface WKGeolocationProviderIOS (WebGeolocationCoreLocationUpdateListener) <WebGeolocationCoreLocationUpdateListener> 63 @interface WKGeolocationProviderIOS (_WKGeolocationCoreLocationListener) <_WKGeolocationCoreLocationListener> 64 @end 65 66 @interface WKLegacyCoreLocationProvider : NSObject<_WKGeolocationCoreLocationProvider, WebGeolocationCoreLocationUpdateListener> 57 67 @end 58 68 … … 65 75 void decidePolicyForGeolocationRequestFromOrigin(SecurityOrigin*, const String& urlString, id<WebAllowDenyPolicyListener>, UIWindow*); 66 76 }; 77 78 static inline Ref<WebGeolocationPosition> kit(WebCore::GeolocationPosition *position) 79 { 80 return WebGeolocationPosition::create(position->timestamp(), position->latitude(), position->longitude(), position->accuracy(), position->canProvideAltitude(), position->altitude(), position->canProvideAltitudeAccuracy(), position->altitudeAccuracy(), position->canProvideHeading(), position->heading(), position->canProvideSpeed(), position->speed()); 81 } 67 82 68 83 struct GeolocationRequestData { … … 75 90 @implementation WKGeolocationProviderIOS { 76 91 RefPtr<WebGeolocationManagerProxy> _geolocationManager; 77 RetainPtr< WebGeolocationCoreLocationProvider> _coreLocationProvider;92 RetainPtr<id <_WKGeolocationCoreLocationProvider>> _coreLocationProvider; 78 93 BOOL _isWebCoreGeolocationActive; 79 94 RefPtr<WebGeolocationPosition> _lastActivePosition; … … 149 164 }; 150 165 _geolocationManager->initializeProvider(reinterpret_cast<WKGeolocationProviderBase*>(&providerCallback)); 151 _coreLocationProvider = adoptNS([[WebGeolocationCoreLocationProvider alloc] initWithListener:self]); 166 _coreLocationProvider = wrapper(processPool)._coreLocationProvider ?: adoptNS(static_cast<id <_WKGeolocationCoreLocationProvider>>([[WKLegacyCoreLocationProvider alloc] init])); 167 [_coreLocationProvider setListener:self]; 152 168 return self; 153 169 } … … 178 194 179 195 id<WKUIDelegatePrivate> uiDelegate = static_cast<id <WKUIDelegatePrivate>>([request.view UIDelegate]); 196 if ([uiDelegate respondsToSelector:@selector(_webView:requestGeolocationAuthorizationForURL:frame:decisionHandler:)]) { 197 URL requestFrameURL(URL(), request.frame->url()); 198 RetainPtr<WKFrameInfo> frameInfo = wrapper(API::FrameInfo::create(*request.frame.get(), *request.origin.get())); 199 RefPtr<CompletionHandlerCallChecker> checker = CompletionHandlerCallChecker::create(uiDelegate, @selector(_webView:requestGeolocationAuthorizationForURL:frame:decisionHandler:)); 200 [uiDelegate _webView:request.view.get() requestGeolocationAuthorizationForURL:requestFrameURL frame:frameInfo.get() decisionHandler:BlockPtr<void(BOOL)>::fromCallable([request, checker = WTFMove(checker)](BOOL authorized) { 201 if (checker->completionHandlerHasBeenCalled()) 202 return; 203 if (authorized) 204 request.permissionRequest->allow(); 205 else 206 request.permissionRequest->deny(); 207 checker->didCallCompletionHandler(); 208 }).get()]; 209 return; 210 } 211 180 212 if ([uiDelegate respondsToSelector:@selector(_webView:shouldRequestGeolocationAuthorizationForURL:isMainFrame:mainFrameURL:)]) { 181 213 const WebFrameProxy* mainFrame = request.frame->page()->mainFrame(); … … 204 236 } 205 237 206 - (void)positionChanged:( GeolocationPosition*)position207 { 208 _lastActivePosition = WebGeolocationPosition::create(position->timestamp(), position->latitude(), position->longitude(), position->accuracy(), position->canProvideAltitude(), position->altitude(), position->canProvideAltitudeAccuracy(), position->altitudeAccuracy(), position->canProvideHeading(), position->heading(), position->canProvideSpeed(), position->speed());238 - (void)positionChanged:(_WKGeolocationPosition *)position 239 { 240 _lastActivePosition = position->_geolocationPosition.get(); 209 241 _geolocationManager->providerDidChangePosition(_lastActivePosition.get()); 210 242 } … … 218 250 { 219 251 _geolocationManager->resetPermissions(); 252 } 253 254 @end 255 256 # pragma mark - Implementation of WKLegacyCoreLocationProvider 257 258 @implementation WKLegacyCoreLocationProvider { 259 id <_WKGeolocationCoreLocationListener> _listener; 260 RetainPtr<WebGeolocationCoreLocationProvider> _provider; 261 } 262 263 // <_WKGeolocationCoreLocationProvider> Methods 264 265 - (void)setListener:(id<_WKGeolocationCoreLocationListener>)listener 266 { 267 ASSERT(listener && !_listener && !_provider); 268 _listener = listener; 269 _provider = adoptNS([[WebGeolocationCoreLocationProvider alloc] initWithListener:self]); 270 } 271 272 - (void)requestGeolocationAuthorization 273 { 274 ASSERT(_provider); 275 [_provider requestGeolocationAuthorization]; 276 } 277 278 - (void)start 279 { 280 ASSERT(_provider); 281 [_provider start]; 282 } 283 284 - (void)stop 285 { 286 ASSERT(_provider); 287 [_provider stop]; 288 } 289 290 - (void)setEnableHighAccuracy:(BOOL)flag 291 { 292 ASSERT(_provider); 293 [_provider setEnableHighAccuracy:flag]; 294 } 295 296 // <WebGeolocationCoreLocationUpdateListener> Methods 297 298 - (void)geolocationAuthorizationGranted 299 { 300 ASSERT(_listener); 301 [_listener geolocationAuthorizationGranted]; 302 } 303 304 - (void)geolocationAuthorizationDenied 305 { 306 ASSERT(_listener); 307 [_listener geolocationAuthorizationDenied]; 308 } 309 310 - (void)positionChanged:(WebCore::GeolocationPosition *)corePosition 311 { 312 ASSERT(_listener); 313 auto position = kit(corePosition); 314 [_listener positionChanged:wrapper(position.get())]; 315 } 316 317 - (void)errorOccurred:(NSString *)errorMessage 318 { 319 ASSERT(_listener); 320 [_listener errorOccurred:errorMessage]; 321 } 322 323 - (void)resetGeolocation 324 { 325 ASSERT(_listener); 326 [_listener resetGeolocation]; 220 327 } 221 328 -
trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
r214934 r215246 1172 1172 5CE85B201C88E64B0070BFCE /* PingLoad.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CE85B1F1C88E6430070BFCE /* PingLoad.h */; }; 1173 1173 5CFECB041E1ED1CC00F88504 /* LegacyCustomProtocolManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5CFECB031E1ED1C800F88504 /* LegacyCustomProtocolManager.cpp */; }; 1174 636353A51E9858DF0009F8AF /* _WKGeolocationCoreLocationProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 63FABE191E970D65003011D5 /* _WKGeolocationCoreLocationProvider.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1175 63C32C251E9810D900699BD0 /* _WKGeolocationPosition.mm in Sources */ = {isa = PBXBuildFile; fileRef = 63C32C231E9810D900699BD0 /* _WKGeolocationPosition.mm */; }; 1176 63C32C261E9810D900699BD0 /* _WKGeolocationPosition.h in Headers */ = {isa = PBXBuildFile; fileRef = 63C32C241E9810D900699BD0 /* _WKGeolocationPosition.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1177 63C32C281E98119000699BD0 /* _WKGeolocationPositionInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 63C32C271E98119000699BD0 /* _WKGeolocationPositionInternal.h */; }; 1174 1178 6501BD1A12F1243400E9F248 /* WKBundleInspector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65B86F1712F11D7B00B7DD8A /* WKBundleInspector.cpp */; }; 1175 1179 659C551E130006410025C0C2 /* InjectedBundlePageResourceLoadClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6546A82913000164000CEB1C /* InjectedBundlePageResourceLoadClient.cpp */; }; … … 3432 3436 5D442A5516D5856700AC3331 /* PluginService.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PluginService.entitlements; sourceTree = "<group>"; }; 3433 3437 5DAD73F1116FF90C00EE5396 /* BaseTarget.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = BaseTarget.xcconfig; sourceTree = "<group>"; }; 3438 63C32C231E9810D900699BD0 /* _WKGeolocationPosition.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKGeolocationPosition.mm; sourceTree = "<group>"; }; 3439 63C32C241E9810D900699BD0 /* _WKGeolocationPosition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKGeolocationPosition.h; sourceTree = "<group>"; }; 3440 63C32C271E98119000699BD0 /* _WKGeolocationPositionInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKGeolocationPositionInternal.h; sourceTree = "<group>"; }; 3441 63FABE191E970D65003011D5 /* _WKGeolocationCoreLocationProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = _WKGeolocationCoreLocationProvider.h; sourceTree = "<group>"; }; 3434 3442 6546A82913000164000CEB1C /* InjectedBundlePageResourceLoadClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundlePageResourceLoadClient.cpp; sourceTree = "<group>"; }; 3435 3443 6546A82A13000164000CEB1C /* InjectedBundlePageResourceLoadClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundlePageResourceLoadClient.h; sourceTree = "<group>"; }; … … 5523 5531 37A64E5618F38F4600EB30F1 /* _WKFormInputSession.h */, 5524 5532 CD78E1181DB7E5AD0014A2DE /* _WKFullscreenDelegate.h */, 5533 63FABE191E970D65003011D5 /* _WKGeolocationCoreLocationProvider.h */, 5534 63C32C241E9810D900699BD0 /* _WKGeolocationPosition.h */, 5535 63C32C231E9810D900699BD0 /* _WKGeolocationPosition.mm */, 5536 63C32C271E98119000699BD0 /* _WKGeolocationPositionInternal.h */, 5525 5537 5143B25E1DDCDFD10014FAC6 /* _WKIconLoadingDelegate.h */, 5526 5538 37A64E5418F38E3C00EB30F1 /* _WKInputDelegate.h */, … … 8082 8094 510F59101DDE296900412FF5 /* _WKIconLoadingDelegate.h in Headers */, 8083 8095 37A64E5518F38E3C00EB30F1 /* _WKInputDelegate.h in Headers */, 8096 63C32C281E98119000699BD0 /* _WKGeolocationPositionInternal.h in Headers */, 8084 8097 2D790A9D1AD7050D00AB90B3 /* _WKLayoutMode.h in Headers */, 8085 8098 510F59111DDE297000412FF5 /* _WKLinkIconParameters.h in Headers */, … … 8278 8291 1A1EC69E1872092100B951F0 /* ImportanceAssertion.h in Headers */, 8279 8292 BC204EE311C83E98008F3375 /* InjectedBundle.h in Headers */, 8293 636353A51E9858DF0009F8AF /* _WKGeolocationCoreLocationProvider.h in Headers */, 8280 8294 935EEBA2127761D0003322B8 /* InjectedBundleBackForwardList.h in Headers */, 8281 8295 935EEBA4127761D6003322B8 /* InjectedBundleBackForwardListItem.h in Headers */, … … 8791 8805 BC4075F6124FF0270068F20A /* WKCertificateInfo.h in Headers */, 8792 8806 BC407627124FF0400068F20A /* WKCertificateInfoMac.h in Headers */, 8807 63C32C261E9810D900699BD0 /* _WKGeolocationPosition.h in Headers */, 8793 8808 BCA284D71492F2C7001F9042 /* WKConnection.h in Headers */, 8794 8809 BC5C75C814954DA600BC4775 /* WKConnectionInternal.h in Headers */, … … 10327 10342 BCA0EF8012331E78007D3CFB /* WebUndoStep.cpp in Sources */, 10328 10343 51D124281E6D3F5D002B2820 /* WebURLSchemeHandler.cpp in Sources */, 10344 63C32C251E9810D900699BD0 /* _WKGeolocationPosition.mm in Sources */, 10329 10345 51D124331E6DE6CA002B2820 /* WebURLSchemeHandlerCocoa.mm in Sources */, 10330 10346 51D1242C1E6D41FD002B2820 /* WebURLSchemeHandlerProxy.cpp in Sources */, -
trunk/Tools/ChangeLog
r215243 r215246 1 2017-04-11 David Quesada <david_quesada@apple.com> 2 3 Add SPI for handling geolocation authorization requests 4 https://bugs.webkit.org/show_bug.cgi?id=170362 5 rdar://problem/17508627 6 7 Reviewed by Alex Christensen. 8 9 Add API tests for the new WKUIDelegate SPI for allowing or denying websites permission 10 to use geolocation. Adopt the new WKProcessPool._coreLocationProvider property to 11 provide a stub object to simulate the various configurations of geolocation permissions: 12 1. The app doesn't have permission to use geolocation. 13 2. The app is allowed to use geolocation, but the UI delegate denies the web view permission. 14 3. The app is allowed to use geolocation, and the UI delegate allows the web view permission. 15 16 * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: 17 * TestWebKitAPI/Tests/WebKit2Cocoa/Geolocation.mm: Added. 18 (-[TestCoreLocationProvider setListener:]): 19 (-[TestCoreLocationProvider requestGeolocationAuthorization]): 20 (-[TestCoreLocationProvider start]): 21 (-[TestCoreLocationProvider stop]): 22 (-[TestCoreLocationProvider setEnableHighAccuracy:]): 23 (expectException): 24 (-[GeolocationTestUIDelegate _webView:requestGeolocationAuthorizationForURL:frame:decisionHandler:]): 25 (-[GeolocationTestUIDelegate webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:]): 26 (TestWebKitAPI::TEST): 27 * TestWebKitAPI/Tests/WebKit2Cocoa/GeolocationGetCurrentPositionResult.html: Added. 28 1 29 2017-04-10 Matt Rajca <mrajca@apple.com> 2 30 -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r215243 r215246 197 197 5CE354D91E70DA5C00BEFE3B /* WKUserContentExtensionStore.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5CE354D81E70D9C300BEFE3B /* WKUserContentExtensionStore.mm */; }; 198 198 5E4B1D2E1D404C6100053621 /* WKScrollViewDelegateCrash.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5E4B1D2C1D404C6100053621 /* WKScrollViewDelegateCrash.mm */; }; 199 631EFFF61E7B5E8D00D2EBB8 /* Geolocation.mm in Sources */ = {isa = PBXBuildFile; fileRef = 631EFFF51E7B5E8D00D2EBB8 /* Geolocation.mm */; }; 200 634910E01E9D3FF300880309 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 634910DF1E9D3FF300880309 /* CoreLocation.framework */; }; 201 636353A71E98665D0009F8AF /* GeolocationGetCurrentPositionResult.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 636353A61E9861940009F8AF /* GeolocationGetCurrentPositionResult.html */; }; 199 202 6BFD294C1D5E6C1D008EC968 /* HashCountedSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A38D7E51C752D5F004F157D /* HashCountedSet.cpp */; }; 200 203 755A20AF1E6E38630093C69F /* DatabaseTrackerTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 755A20AE1E6E38630093C69F /* DatabaseTrackerTest.cpp */; }; … … 670 673 1C2B81871C8925A000A5529F /* Ahem.ttf in Copy Resources */, 671 674 1A63479F183D72A4005B1707 /* all-content-in-one-iframe.html in Copy Resources */, 675 636353A71E98665D0009F8AF /* GeolocationGetCurrentPositionResult.html in Copy Resources */, 672 676 C25CCA0D1E5141840026CB8A /* AllAhem.svg in Copy Resources */, 673 677 5C9E59411D3EB5AC00E3C62E /* ApplicationCache.db in Copy Resources */, … … 1122 1126 5CE354D81E70D9C300BEFE3B /* WKUserContentExtensionStore.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKUserContentExtensionStore.mm; sourceTree = "<group>"; }; 1123 1127 5E4B1D2C1D404C6100053621 /* WKScrollViewDelegateCrash.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WKScrollViewDelegateCrash.mm; path = ../ios/WKScrollViewDelegateCrash.mm; sourceTree = "<group>"; }; 1128 631EFFF51E7B5E8D00D2EBB8 /* Geolocation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Geolocation.mm; sourceTree = "<group>"; }; 1129 634910DF1E9D3FF300880309 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; 1130 636353A61E9861940009F8AF /* GeolocationGetCurrentPositionResult.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = GeolocationGetCurrentPositionResult.html; sourceTree = "<group>"; }; 1124 1131 755A20AE1E6E38630093C69F /* DatabaseTrackerTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DatabaseTrackerTest.cpp; sourceTree = "<group>"; }; 1125 1132 7560917719259C59009EF06E /* MemoryCacheAddImageToCacheIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MemoryCacheAddImageToCacheIOS.mm; sourceTree = "<group>"; }; … … 1507 1514 buildActionMask = 2147483647; 1508 1515 files = ( 1516 634910E01E9D3FF300880309 /* CoreLocation.framework in Frameworks */, 1509 1517 7A010BCB1D877C0500EDE72A /* CoreGraphics.framework in Frameworks */, 1510 1518 7C83E03F1D0A61A000FEBCF3 /* libicucore.dylib in Frameworks */, … … 1646 1654 3F1B52681D3D7129008D60C4 /* FullscreenLayoutConstraints.mm */, 1647 1655 CDE195B31CFE0ADE0053D256 /* FullscreenTopContentInset.mm */, 1656 631EFFF51E7B5E8D00D2EBB8 /* Geolocation.mm */, 1648 1657 510477751D298E03009747EB /* IDBDeleteRecovery.mm */, 1649 1658 5110FCEF1E01CBAA006F8D0B /* IDBIndexUpgradeToV2.mm */, … … 1788 1797 isa = PBXGroup; 1789 1798 children = ( 1799 634910DF1E9D3FF300880309 /* CoreLocation.framework */, 1790 1800 7A010BCA1D877C0500EDE72A /* CoreGraphics.framework */, 1791 1801 7C83E0331D0A5F2700FEBCF3 /* libicucore.dylib */, … … 1841 1851 3FBD1B491D39D1DB00E6D6FA /* FullscreenLayoutConstraints.html */, 1842 1852 CDE195B21CFE0ADE0053D256 /* FullscreenTopContentInset.html */, 1853 636353A61E9861940009F8AF /* GeolocationGetCurrentPositionResult.html */, 1843 1854 F4DEF6EC1E9B4D950048EF61 /* image-in-link-and-input.html */, 1844 1855 510477761D298E57009747EB /* IDBDeleteRecovery.html */, … … 2797 2808 CDBFCC451A9FF45300A7B691 /* FullscreenZoomInitialFrame.mm in Sources */, 2798 2809 7CCE7EF81A411AE600447C4C /* Geolocation.cpp in Sources */, 2810 631EFFF61E7B5E8D00D2EBB8 /* Geolocation.mm in Sources */, 2799 2811 7CCE7EE11A411A9A00447C4C /* GetBackingScaleFactor.mm in Sources */, 2800 2812 7CCE7EF91A411AE600447C4C /* GetInjectedBundleInitializationUserDataCallback.cpp in Sources */,
Note: See TracChangeset
for help on using the changeset viewer.