Title: [171626] trunk
Revision
171626
Author
[email protected]
Date
2014-07-25 15:52:11 -0700 (Fri, 25 Jul 2014)

Log Message

WKNavigation's properties are either always nil or don't behave as documented
https://bugs.webkit.org/show_bug.cgi?id=135267
<rdar://problem/17730536>

Reviewed by Andreas Kling.

Source/WebKit2:
Remove the properties from WKNavigation and introduce -[WKNavigation _request] as SPI for now.

* Shared/API/Cocoa/WebKitPrivate.h:
* UIProcess/API/Cocoa/WKNavigation.h:
* UIProcess/API/Cocoa/WKNavigation.mm:
(-[WKNavigation _request]):
(-[WKNavigation initialRequest]): Deleted.
(-[WKNavigation request]): Deleted.
(-[WKNavigation setRequest:]): Deleted.
(-[WKNavigation response]): Deleted.
(-[WKNavigation error]): Deleted.
* UIProcess/API/Cocoa/WKNavigationInternal.h:
* UIProcess/API/Cocoa/WKNavigationPrivate.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKNavigationInternal.h.
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::createLoadRequestNavigation):
* WebKit2.xcodeproj/project.pbxproj:

Tools:
* TestWebKitAPI/Tests/WebKit2Cocoa/Navigation.mm:
(-[NavigationDelegate webView:didStartProvisionalNavigation:]):
(TEST):
(-[DidFailProvisionalNavigationDelegate webView:didStartProvisionalNavigation:]):
(-[DidFailProvisionalNavigationDelegate webView:didFailProvisionalNavigation:withError:]):

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (171625 => 171626)


--- trunk/Source/WebKit2/ChangeLog	2014-07-25 22:43:19 UTC (rev 171625)
+++ trunk/Source/WebKit2/ChangeLog	2014-07-25 22:52:11 UTC (rev 171626)
@@ -1,3 +1,28 @@
+2014-07-24  Anders Carlsson  <[email protected]>
+
+        WKNavigation's properties are either always nil or don't behave as documented
+        https://bugs.webkit.org/show_bug.cgi?id=135267
+        <rdar://problem/17730536>
+
+        Reviewed by Andreas Kling.
+
+        Remove the properties from WKNavigation and introduce -[WKNavigation _request] as SPI for now.
+
+        * Shared/API/Cocoa/WebKitPrivate.h:
+        * UIProcess/API/Cocoa/WKNavigation.h:
+        * UIProcess/API/Cocoa/WKNavigation.mm:
+        (-[WKNavigation _request]):
+        (-[WKNavigation initialRequest]): Deleted.
+        (-[WKNavigation request]): Deleted.
+        (-[WKNavigation setRequest:]): Deleted.
+        (-[WKNavigation response]): Deleted.
+        (-[WKNavigation error]): Deleted.
+        * UIProcess/API/Cocoa/WKNavigationInternal.h:
+        * UIProcess/API/Cocoa/WKNavigationPrivate.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKNavigationInternal.h.
+        * UIProcess/Cocoa/NavigationState.mm:
+        (WebKit::NavigationState::createLoadRequestNavigation):
+        * WebKit2.xcodeproj/project.pbxproj:
+
 2014-07-25  Brady Eidson  <[email protected]>
 
         Clean up WKOriginDataManager and get it messaging to the DatabaseProcess

Modified: trunk/Source/WebKit2/Shared/API/Cocoa/WebKitPrivate.h (171625 => 171626)


--- trunk/Source/WebKit2/Shared/API/Cocoa/WebKitPrivate.h	2014-07-25 22:43:19 UTC (rev 171625)
+++ trunk/Source/WebKit2/Shared/API/Cocoa/WebKitPrivate.h	2014-07-25 22:52:11 UTC (rev 171626)
@@ -24,6 +24,7 @@
  */
 
 #import <WebKit/WKHistoryDelegatePrivate.h>
+#import <WebKit/WKNavigationPrivate.h>
 #import <WebKit/WKProcessPoolPrivate.h>
 #import <WebKit/WKUIDelegatePrivate.h>
 #import <WebKit/WKWebViewConfigurationPrivate.h>

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigation.h (171625 => 171626)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigation.h	2014-07-25 22:43:19 UTC (rev 171625)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigation.h	2014-07-25 22:52:11 UTC (rev 171626)
@@ -29,8 +29,7 @@
 
 #import <Foundation/Foundation.h>
 
-/*! A WKNavigation object contains information for tracking the loading
- progress of a webpage.
+/*! A WKNavigation object can be used for tracking the loading progress of a webpage.
  @discussion A navigation is returned from the web view load methods, and is
  also passed to the navigation delegate methods, to uniquely identify a webpage
  load from start to finish.
@@ -38,25 +37,6 @@
 WK_CLASS_AVAILABLE(10_10, 8_0)
 @interface WKNavigation : NSObject
 
-/*! @abstract The initial request used to perform the navigation.
- */
-@property (nonatomic, readonly, copy) NSURLRequest *initialRequest;
-
-/*! @abstract The navigation's current request.
- @discussion This request may be different from the one returned by
- initialRequest if server-side redirects have occurred.
- */
-@property (nonatomic, readonly, copy) NSURLRequest *request;
-
-/* @abstract The response to the navigation, or nil if no response has yet
- been received.
- */
-@property (nonatomic, readonly, copy) NSURLResponse *response;
-
-/* @abstract The error if the navigation failed, or nil if it did not fail.
- */
-@property (nonatomic, readonly, copy) NSError *error;
-
 @end
 
 #endif

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigation.mm (171625 => 171626)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigation.mm	2014-07-25 22:43:19 UTC (rev 171625)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigation.mm	2014-07-25 22:52:11 UTC (rev 171626)
@@ -24,44 +24,20 @@
  */
 
 #import "config.h"
-#import "WKNavigation.h"
+#import "WKNavigationInternal.h"
 
 #import <wtf/RetainPtr.h>
 
 #if WK_API_ENABLED
 
-@implementation WKNavigation {
-    RetainPtr<NSURLRequest> _request;
-}
+@implementation WKNavigation
 
-- (NSURLRequest *)initialRequest
+- (NSURLRequest *)_request
 {
-    // FIXME: Implement.
-    return nil;
-}
-
-- (NSURLRequest *)request
-{
     return _request.get();
 }
 
-- (void)setRequest:(NSURLRequest *)request
-{
-    _request = adoptNS([request copy]);
-}
 
-- (NSURLResponse *)response
-{
-    // FIXME: Implement.
-    return nil;
-}
-
-- (NSError *)error
-{
-    // FIXME: Implement.
-    return nil;
-}
-
 @end
 
 #endif

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationInternal.h (171625 => 171626)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationInternal.h	2014-07-25 22:43:19 UTC (rev 171625)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationInternal.h	2014-07-25 22:52:11 UTC (rev 171626)
@@ -23,13 +23,16 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#import "WKNavigation.h"
+#import "WKNavigationPrivate.h"
 
 #if WK_API_ENABLED
 
-@interface WKNavigation ()
+#import <wtf/RetainPtr.h>
 
-@property (nonatomic, readwrite, copy) NSURLRequest *request;
+@interface WKNavigation () {
+@package
+    RetainPtr<NSURLRequest> _request;
+}
 
 @end
 

Copied: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationPrivate.h (from rev 171625, trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationInternal.h) (0 => 171626)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationPrivate.h	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationPrivate.h	2014-07-25 22:52:11 UTC (rev 171626)
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <WebKit/WKNavigation.h>
+
+#if WK_API_ENABLED
+
+@interface WKNavigation (WKPrivate)
+@property (nonatomic, readonly, copy) NSURLRequest *_request;
+@end
+
+#endif

Modified: trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm (171625 => 171626)


--- trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm	2014-07-25 22:43:19 UTC (rev 171625)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm	2014-07-25 22:52:11 UTC (rev 171626)
@@ -167,7 +167,7 @@
     ASSERT(!m_navigations.contains(navigationID));
 
     RetainPtr<WKNavigation> navigation = adoptNS([[WKNavigation alloc] init]);
-    [navigation setRequest:request];
+    navigation->_request = request;
 
     m_navigations.set(navigationID, navigation);
 

Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (171625 => 171626)


--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2014-07-25 22:43:19 UTC (rev 171625)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2014-07-25 22:52:11 UTC (rev 171626)
@@ -421,6 +421,7 @@
 		1AC8702D130B49A2002C1257 /* WebPluginSiteDataManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AC8702B130B49A2002C1257 /* WebPluginSiteDataManager.h */; };
 		1AC8702E130B49A2002C1257 /* WebPluginSiteDataManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC8702C130B49A2002C1257 /* WebPluginSiteDataManager.cpp */; };
 		1ACB7987191ECADD006A6A61 /* XPCPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACB7986191ECADD006A6A61 /* XPCPtr.h */; };
+		1ACC87BA1981C341003D1AF4 /* WKNavigationPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACC87B91981C341003D1AF4 /* WKNavigationPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		1ACECD2417162DB1001FC9EF /* StorageAreaMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ACECD2217162DB1001FC9EF /* StorageAreaMap.cpp */; };
 		1ACECD2517162DB1001FC9EF /* StorageAreaMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACECD2317162DB1001FC9EF /* StorageAreaMap.h */; };
 		1AD01BC81905D37E00C9C45F /* _WKErrorRecoveryAttempting.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AD01BC61905D37E00C9C45F /* _WKErrorRecoveryAttempting.mm */; };
@@ -2404,6 +2405,7 @@
 		1AC8702B130B49A2002C1257 /* WebPluginSiteDataManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPluginSiteDataManager.h; sourceTree = "<group>"; };
 		1AC8702C130B49A2002C1257 /* WebPluginSiteDataManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPluginSiteDataManager.cpp; sourceTree = "<group>"; };
 		1ACB7986191ECADD006A6A61 /* XPCPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPCPtr.h; sourceTree = "<group>"; };
+		1ACC87B91981C341003D1AF4 /* WKNavigationPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKNavigationPrivate.h; sourceTree = "<group>"; };
 		1ACECD2217162DB1001FC9EF /* StorageAreaMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StorageAreaMap.cpp; sourceTree = "<group>"; };
 		1ACECD2317162DB1001FC9EF /* StorageAreaMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StorageAreaMap.h; sourceTree = "<group>"; };
 		1AD01BC61905D37E00C9C45F /* _WKErrorRecoveryAttempting.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKErrorRecoveryAttempting.mm; sourceTree = "<group>"; };
@@ -5043,6 +5045,7 @@
 				1A4D664D18A3031B00D82E21 /* WKFrameInfoInternal.h */,
 				1A422F8A18B29B5400D8CD96 /* WKHistoryDelegatePrivate.h */,
 				1A5B1C4F1898606F004FCF9B /* WKNavigation.h */,
+				1ACC87B91981C341003D1AF4 /* WKNavigationPrivate.h */,
 				1A5B1C4E1898606F004FCF9B /* WKNavigation.mm */,
 				1A256E3618A1A788006FB922 /* WKNavigationAction.h */,
 				1A256E3518A1A788006FB922 /* WKNavigationAction.mm */,
@@ -7648,6 +7651,7 @@
 				517DD5BF180DA7D30081660B /* DatabaseProcessProxy.h in Headers */,
 				935EEB9B1277617C003322B8 /* WKBundleBackForwardListItem.h in Headers */,
 				51EFC1CF1524E62500C9A938 /* WKBundleDOMWindowExtension.h in Headers */,
+				1ACC87BA1981C341003D1AF4 /* WKNavigationPrivate.h in Headers */,
 				1AAF08A2192681D100B6390C /* WebUserContentControllerProxy.h in Headers */,
 				BCD25F1711D6BDE100169B0E /* WKBundleFrame.h in Headers */,
 				BCF049E611FE20F600F86A58 /* WKBundleFramePrivate.h in Headers */,

Modified: trunk/Tools/ChangeLog (171625 => 171626)


--- trunk/Tools/ChangeLog	2014-07-25 22:43:19 UTC (rev 171625)
+++ trunk/Tools/ChangeLog	2014-07-25 22:52:11 UTC (rev 171626)
@@ -1,3 +1,17 @@
+2014-07-25  Anders Carlsson  <[email protected]>
+
+        WKNavigation's properties are either always nil or don't behave as documented
+        https://bugs.webkit.org/show_bug.cgi?id=135267
+        <rdar://problem/17730536>
+
+        Reviewed by Andreas Kling.
+
+        * TestWebKitAPI/Tests/WebKit2Cocoa/Navigation.mm:
+        (-[NavigationDelegate webView:didStartProvisionalNavigation:]):
+        (TEST):
+        (-[DidFailProvisionalNavigationDelegate webView:didStartProvisionalNavigation:]):
+        (-[DidFailProvisionalNavigationDelegate webView:didFailProvisionalNavigation:withError:]):
+
 2014-07-25  Michael Catanzaro  <[email protected]>
 
         [GTK] install-dependencies needs to install perl-CGI on Fedora

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/Navigation.mm (171625 => 171626)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/Navigation.mm	2014-07-25 22:43:19 UTC (rev 171625)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/Navigation.mm	2014-07-25 22:52:11 UTC (rev 171626)
@@ -25,7 +25,7 @@
 
 #include "config.h"
 
-#import <WebKit/WKNavigation.h>
+#import <WebKit/WKNavigationPrivate.h>
 #import <WebKit/WKNavigationDelegate.h>
 #import <WebKit/WKWebView.h>
 #import <wtf/RetainPtr.h>
@@ -45,7 +45,7 @@
 - (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation
 {
     EXPECT_EQ(currentNavigation, navigation);
-    EXPECT_NOT_NULL(navigation.request);
+    EXPECT_NOT_NULL(navigation._request);
 }
 
 - (void)webView:(WKWebView *)webView didCommitNavigation:(WKNavigation *)navigation
@@ -88,7 +88,7 @@
 
     currentNavigation = [webView loadRequest:request];
     ASSERT_NOT_NULL(currentNavigation);
-    ASSERT_TRUE([[currentNavigation request] isEqual:request]);
+    ASSERT_TRUE([[currentNavigation _request] isEqual:request]);
 
     TestWebKitAPI::Util::run(&isDone);
 }
@@ -101,13 +101,13 @@
 - (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation
 {
     EXPECT_EQ(currentNavigation, navigation);
-    EXPECT_NOT_NULL(navigation.request);
+    EXPECT_NOT_NULL(navigation._request);
 }
 
 - (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation withError:(NSError *)error
 {
     EXPECT_EQ(currentNavigation, navigation);
-    EXPECT_NOT_NULL(navigation.request);
+    EXPECT_NOT_NULL(navigation._request);
 
     EXPECT_TRUE([error.domain isEqualToString:NSURLErrorDomain]);
     EXPECT_EQ(NSURLErrorUnsupportedURL, error.code);
@@ -133,7 +133,7 @@
 
     currentNavigation = [webView loadRequest:request];
     ASSERT_NOT_NULL(currentNavigation);
-    ASSERT_TRUE([[currentNavigation request] isEqual:request]);
+    ASSERT_TRUE([[currentNavigation _request] isEqual:request]);
 
     TestWebKitAPI::Util::run(&isDone);
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to