Title: [253603] branches/safari-608-branch/Source/WebKit
Revision
253603
Author
[email protected]
Date
2019-12-16 17:23:08 -0800 (Mon, 16 Dec 2019)

Log Message

Cherry-pick r250461. rdar://problem/57979214

    Adopt new UIWebGeolocationPolicyDecider SPI to pass a view instead of a window
    https://bugs.webkit.org/show_bug.cgi?id=202329
    <rdar://problem/25963823>

    Reviewed by Wenson Hsieh.

    * Platform/spi/ios/UIKitSPI.h:
    * UIProcess/ios/WKGeolocationProviderIOS.mm:
    (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]):
    * UIProcess/ios/WKGeolocationProviderIOSObjCSecurityOrigin.mm:
    (WebKit::decidePolicyForGeolocationRequestFromOrigin):
    Switch to newer SPI that takes a UIView instead of a UIWindow, so that
    UIWebGeolocationPolicyDecider can find the correct presenting view controller.

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250461 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-608-branch/Source/WebKit/ChangeLog (253602 => 253603)


--- branches/safari-608-branch/Source/WebKit/ChangeLog	2019-12-17 01:16:44 UTC (rev 253602)
+++ branches/safari-608-branch/Source/WebKit/ChangeLog	2019-12-17 01:23:08 UTC (rev 253603)
@@ -1,3 +1,40 @@
+2019-12-16  Dan Robson  <[email protected]>
+
+        Cherry-pick r250461. rdar://problem/57979214
+
+    Adopt new UIWebGeolocationPolicyDecider SPI to pass a view instead of a window
+    https://bugs.webkit.org/show_bug.cgi?id=202329
+    <rdar://problem/25963823>
+    
+    Reviewed by Wenson Hsieh.
+    
+    * Platform/spi/ios/UIKitSPI.h:
+    * UIProcess/ios/WKGeolocationProviderIOS.mm:
+    (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]):
+    * UIProcess/ios/WKGeolocationProviderIOSObjCSecurityOrigin.mm:
+    (WebKit::decidePolicyForGeolocationRequestFromOrigin):
+    Switch to newer SPI that takes a UIView instead of a UIWindow, so that
+    UIWebGeolocationPolicyDecider can find the correct presenting view controller.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250461 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-09-27  Tim Horton  <[email protected]>
+
+            Adopt new UIWebGeolocationPolicyDecider SPI to pass a view instead of a window
+            https://bugs.webkit.org/show_bug.cgi?id=202329
+            <rdar://problem/25963823>
+
+            Reviewed by Wenson Hsieh.
+
+            * Platform/spi/ios/UIKitSPI.h:
+            * UIProcess/ios/WKGeolocationProviderIOS.mm:
+            (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]):
+            * UIProcess/ios/WKGeolocationProviderIOSObjCSecurityOrigin.mm:
+            (WebKit::decidePolicyForGeolocationRequestFromOrigin):
+            Switch to newer SPI that takes a UIView instead of a UIWindow, so that
+            UIWebGeolocationPolicyDecider can find the correct presenting view controller.
+
 2019-12-03  Alan Coon  <[email protected]>
 
         Cherry-pick r252811. rdar://problem/57609336

Modified: branches/safari-608-branch/Source/WebKit/Platform/spi/ios/UIKitSPI.h (253602 => 253603)


--- branches/safari-608-branch/Source/WebKit/Platform/spi/ios/UIKitSPI.h	2019-12-17 01:16:44 UTC (rev 253602)
+++ branches/safari-608-branch/Source/WebKit/Platform/spi/ios/UIKitSPI.h	2019-12-17 01:23:08 UTC (rev 253603)
@@ -1106,6 +1106,10 @@
 @property (nonatomic, readonly) NSInteger _gsModifierFlags;
 @end
 
+@interface UIWebGeolocationPolicyDecider (Staging_25963823)
+- (void)decidePolicyForGeolocationRequestFromOrigin:(id)securityOrigin requestingURL:(NSURL *)requestingURL view:(UIView *)view listener:(id)listener;
+@end
+
 @interface UIColor (IPI)
 + (UIColor *)insertionPointColor;
 @end

Modified: branches/safari-608-branch/Source/WebKit/UIProcess/ios/WKGeolocationProviderIOS.mm (253602 => 253603)


--- branches/safari-608-branch/Source/WebKit/UIProcess/ios/WKGeolocationProviderIOS.mm	2019-12-17 01:16:44 UTC (rev 253602)
+++ branches/safari-608-branch/Source/WebKit/UIProcess/ios/WKGeolocationProviderIOS.mm	2019-12-17 01:23:08 UTC (rev 253603)
@@ -68,7 +68,7 @@
 @end
 
 namespace WebKit {
-void decidePolicyForGeolocationRequestFromOrigin(WebCore::SecurityOrigin*, const String& urlString, id<WebAllowDenyPolicyListener>, UIWindow*);
+void decidePolicyForGeolocationRequestFromOrigin(WebCore::SecurityOrigin*, const String& urlString, id<WebAllowDenyPolicyListener>, UIView*);
 };
 
 struct GeolocationRequestData {
@@ -211,7 +211,7 @@
 
         if (requiresUserAuthorization) {
             RetainPtr<WKWebAllowDenyPolicyListener> policyListener = adoptNS([[WKWebAllowDenyPolicyListener alloc] initWithCompletionHandler:WTFMove(request.completionHandler)]);
-            WebKit::decidePolicyForGeolocationRequestFromOrigin(request.origin.get(), request.frame->url(), policyListener.get(), [request.view window]);
+            WebKit::decidePolicyForGeolocationRequestFromOrigin(request.origin.get(), request.frame->url(), policyListener.get(), request.view.get());
         } else
             request.completionHandler(true);
     }

Modified: branches/safari-608-branch/Source/WebKit/UIProcess/ios/WKGeolocationProviderIOSObjCSecurityOrigin.mm (253602 => 253603)


--- branches/safari-608-branch/Source/WebKit/UIProcess/ios/WKGeolocationProviderIOSObjCSecurityOrigin.mm	2019-12-17 01:16:44 UTC (rev 253602)
+++ branches/safari-608-branch/Source/WebKit/UIProcess/ios/WKGeolocationProviderIOSObjCSecurityOrigin.mm	2019-12-17 01:23:08 UTC (rev 253603)
@@ -30,7 +30,6 @@
 
 #import "UIKitSPI.h"
 #import <Foundation/NSURL.h>
-#import <UIKit/UIWindow.h>
 #import <WebCore/SecurityOrigin.h>
 #import <wtf/RetainPtr.h>
 #import <wtf/text/WTFString.h>
@@ -45,13 +44,17 @@
 
 namespace WebKit {
 
-void decidePolicyForGeolocationRequestFromOrigin(WebCore::SecurityOrigin*, const String& urlString, id<WebAllowDenyPolicyListener>, UIWindow* window);
+void decidePolicyForGeolocationRequestFromOrigin(WebCore::SecurityOrigin*, const String& urlString, id<WebAllowDenyPolicyListener>, UIView *);
 
-void decidePolicyForGeolocationRequestFromOrigin(WebCore::SecurityOrigin* origin, const String& urlString, id<WebAllowDenyPolicyListener> listener, UIWindow* window)
+void decidePolicyForGeolocationRequestFromOrigin(WebCore::SecurityOrigin* origin, const String& urlString, id<WebAllowDenyPolicyListener> listener, UIView *view)
 {
     RetainPtr<WebSecurityOrigin> securityOrigin = adoptNS([[WebSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:origin]);
     RetainPtr<NSURL> requestUrl = adoptNS([[NSURL alloc] initWithString:urlString]);
-    [[UIWebGeolocationPolicyDecider sharedPolicyDecider] decidePolicyForGeolocationRequestFromOrigin:securityOrigin.get() requestingURL:requestUrl.get() window:window listener:listener];
+    RetainPtr<UIWebGeolocationPolicyDecider> decider = [UIWebGeolocationPolicyDecider sharedPolicyDecider];
+    if ([decider respondsToSelector:@selector(decidePolicyForGeolocationRequestFromOrigin:requestingURL:view:listener:)])
+        [decider decidePolicyForGeolocationRequestFromOrigin:securityOrigin.get() requestingURL:requestUrl.get() view:view listener:listener];
+    else
+        [decider decidePolicyForGeolocationRequestFromOrigin:securityOrigin.get() requestingURL:requestUrl.get() window:view.window listener:listener];
 }
 
 } // namespace WebKit
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to