Title: [168581] trunk/Source/WebKit2
Revision
168581
Author
[email protected]
Date
2014-05-10 13:11:35 -0700 (Sat, 10 May 2014)

Log Message

Make -[WKNavigationResponse frame] SPI and only expose -[WKNavigationResponse isMainFrame]
https://bugs.webkit.org/show_bug.cgi?id=132781
<rdar://problem/16868319>

Reviewed by Darin Adler.

* UIProcess/API/Cocoa/WKNavigationResponse.h:
* UIProcess/API/Cocoa/WKNavigationResponse.mm:
(-[WKNavigationResponse description]):
(-[WKNavigationResponse isMainFrameNavigation]):
(-[WKNavigationResponse _frame]):
(-[WKNavigationResponse frame]): Deleted.
(-[WKNavigationResponse setFrame:]): Deleted.
* UIProcess/API/Cocoa/WKNavigationResponseInternal.h:
* UIProcess/API/Cocoa/WKNavigationResponsePrivate.h: Added.
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::PolicyClient::decidePolicyForResponse):
* WebKit2.xcodeproj/project.pbxproj:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (168580 => 168581)


--- trunk/Source/WebKit2/ChangeLog	2014-05-10 19:50:34 UTC (rev 168580)
+++ trunk/Source/WebKit2/ChangeLog	2014-05-10 20:11:35 UTC (rev 168581)
@@ -1,3 +1,24 @@
+2014-05-10  Anders Carlsson  <[email protected]>
+
+        Make -[WKNavigationResponse frame] SPI and only expose -[WKNavigationResponse isMainFrame]
+        https://bugs.webkit.org/show_bug.cgi?id=132781
+        <rdar://problem/16868319>
+
+        Reviewed by Darin Adler.
+
+        * UIProcess/API/Cocoa/WKNavigationResponse.h:
+        * UIProcess/API/Cocoa/WKNavigationResponse.mm:
+        (-[WKNavigationResponse description]):
+        (-[WKNavigationResponse isMainFrameNavigation]):
+        (-[WKNavigationResponse _frame]):
+        (-[WKNavigationResponse frame]): Deleted.
+        (-[WKNavigationResponse setFrame:]): Deleted.
+        * UIProcess/API/Cocoa/WKNavigationResponseInternal.h:
+        * UIProcess/API/Cocoa/WKNavigationResponsePrivate.h: Added.
+        * UIProcess/Cocoa/NavigationState.mm:
+        (WebKit::NavigationState::PolicyClient::decidePolicyForResponse):
+        * WebKit2.xcodeproj/project.pbxproj:
+
 2014-05-09  Dan Bernstein  <[email protected]>
 
         [Cocoa] Remove a deprecated bundle form delegate method now that no one implements it

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationResponse.h (168580 => 168581)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationResponse.h	2014-05-10 19:50:34 UTC (rev 168580)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationResponse.h	2014-05-10 20:11:35 UTC (rev 168581)
@@ -36,9 +36,9 @@
 WK_CLASS_AVAILABLE(10_10, 8_0)
 @interface WKNavigationResponse : NSObject
 
-/*! @abstract Represents the frame that is being navigated.
+/*! @abstract Whether the frame that is being navigated is the main frame or not.
  */
-@property (nonatomic, readonly) WKFrameInfo *frame;
+@property (nonatomic, readonly, getter=isMainFrameNavigation) BOOL mainFrameNavigation;
 
 /*! @abstract The NSURLResponse of the frame.
  */

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationResponse.mm (168580 => 168581)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationResponse.mm	2014-05-10 19:50:34 UTC (rev 168580)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationResponse.mm	2014-05-10 20:11:35 UTC (rev 168581)
@@ -29,27 +29,22 @@
 #if WK_API_ENABLED
 
 #import <wtf/RetainPtr.h>
+#import "WKFrameInfo.h"
 
 @implementation WKNavigationResponse {
-    RetainPtr<WKFrameInfo> _frame;
     RetainPtr<NSURLResponse> _response;
 }
 
 - (NSString *)description
 {
-    return [NSString stringWithFormat:@"<%@: %p; frame = %@; response = %@>", NSStringFromClass(self.class), self, _frame.get(), _response.get()];
+    return [NSString stringWithFormat:@"<%@: %p; response = %@>", NSStringFromClass(self.class), self, _response.get()];
 }
 
-- (WKFrameInfo *)frame
+- (BOOL)isMainFrameNavigation
 {
-    return _frame.get();
+    return [_frame isMainFrame];
 }
 
-- (void)setFrame:(WKFrameInfo *)frame
-{
-    _frame = frame;
-}
-
 - (NSURLResponse *)response
 {
     return _response.get();
@@ -62,4 +57,14 @@
 
 @end
 
+@implementation WKNavigationResponse (WKPrivate)
+
+- (WKFrameInfo *)_frame
+{
+    return _frame.get();
+}
+
+@end
+
+
 #endif

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationResponseInternal.h (168580 => 168581)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationResponseInternal.h	2014-05-10 19:50:34 UTC (rev 168580)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationResponseInternal.h	2014-05-10 20:11:35 UTC (rev 168581)
@@ -23,13 +23,17 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#import "WKNavigationResponse.h"
+#import "WKNavigationResponsePrivate.h"
 
 #if WK_API_ENABLED
 
-@interface WKNavigationResponse ()
+#import <wtf/RetainPtr.h>
 
-@property (nonatomic, readwrite, strong) WKFrameInfo *frame;
+@interface WKNavigationResponse () {
+@package
+    RetainPtr<WKFrameInfo> _frame;
+}
+
 @property (nonatomic, readwrite, copy) NSURLResponse *response;
 @property (nonatomic, readwrite) BOOL canShowMIMEType;
 

Copied: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationResponsePrivate.h (from rev 168579, trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationResponseInternal.h) (0 => 168581)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationResponsePrivate.h	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationResponsePrivate.h	2014-05-10 20:11:35 UTC (rev 168581)
@@ -0,0 +1,36 @@
+/*
+ * 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/WKNavigationResponse.h>
+
+#if WK_API_ENABLED
+
+@interface WKNavigationResponse (WKPrivate)
+
+@property (nonatomic, readonly) WKFrameInfo *_frame;
+
+@end
+
+#endif

Modified: trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm (168580 => 168581)


--- trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm	2014-05-10 19:50:34 UTC (rev 168580)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm	2014-05-10 20:11:35 UTC (rev 168581)
@@ -320,7 +320,7 @@
 
     auto navigationResponse = adoptNS([[WKNavigationResponse alloc] init]);
 
-    [navigationResponse setFrame:adoptNS([[WKFrameInfo alloc] initWithWebFrameProxy:*frame]).get()];
+    navigationResponse->_frame = adoptNS([[WKFrameInfo alloc] initWithWebFrameProxy:*frame]);
     [navigationResponse setResponse:resourceResponse.nsURLResponse()];
     [navigationResponse setCanShowMIMEType:canShowMIMEType];
 

Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (168580 => 168581)


--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2014-05-10 19:50:34 UTC (rev 168580)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2014-05-10 20:11:35 UTC (rev 168581)
@@ -294,6 +294,7 @@
 		1A9E329F1822FEDD00F5D04C /* WKRemoteObjectCoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9E329D1822FEDD00F5D04C /* WKRemoteObjectCoder.h */; };
 		1A9E32A11823018900F5D04C /* _WKRemoteObjectRegistryInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9E32A01823018900F5D04C /* _WKRemoteObjectRegistryInternal.h */; };
 		1A9FBA8D13FF04E600DEED67 /* PluginComplexTextInputState.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9FBA8C13FF04E600DEED67 /* PluginComplexTextInputState.h */; };
+		1AA13212191D5924009C1489 /* WKNavigationResponsePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AA13211191D5924009C1489 /* WKNavigationResponsePrivate.h */; };
 		1AA20D5118AD50E0005D1ED4 /* WKNavigationDelegatePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AA20D5018AD50E0005D1ED4 /* WKNavigationDelegatePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		1AA2E51D12E4C05E00BC4966 /* CGUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AA2E51B12E4C05E00BC4966 /* CGUtilities.h */; };
 		1AA2E51E12E4C05E00BC4966 /* CGUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AA2E51C12E4C05E00BC4966 /* CGUtilities.cpp */; };
@@ -2117,6 +2118,7 @@
 		1A9E329D1822FEDD00F5D04C /* WKRemoteObjectCoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKRemoteObjectCoder.h; sourceTree = "<group>"; };
 		1A9E32A01823018900F5D04C /* _WKRemoteObjectRegistryInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKRemoteObjectRegistryInternal.h; sourceTree = "<group>"; };
 		1A9FBA8C13FF04E600DEED67 /* PluginComplexTextInputState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginComplexTextInputState.h; sourceTree = "<group>"; };
+		1AA13211191D5924009C1489 /* WKNavigationResponsePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKNavigationResponsePrivate.h; sourceTree = "<group>"; };
 		1AA1C79A100E7FC50078DEBC /* WebCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WebCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		1AA1C7DE100E846E0078DEBC /* _javascript_Core.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = _javascript_Core.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		1AA1CC5C100FA1A10078DEBC /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = /System/Library/Frameworks/QuartzCore.framework; sourceTree = "<absolute>"; };
@@ -4772,6 +4774,7 @@
 				1A1B0EB418A424950038481A /* WKNavigationResponse.h */,
 				1A1B0EB318A424950038481A /* WKNavigationResponse.mm */,
 				1A1B0EB718A424CD0038481A /* WKNavigationResponseInternal.h */,
+				1AA13211191D5924009C1489 /* WKNavigationResponsePrivate.h */,
 				1AFDD3161891C94700153970 /* WKPreferences.h */,
 				1AFDD3181891CA1200153970 /* WKPreferences.mm */,
 				1A3C887F18A5ABAE00C4C962 /* WKPreferencesInternal.h */,
@@ -6790,6 +6793,7 @@
 				37C4E9F6131C6E7E0029BD5A /* config.h in Headers */,
 				BC032DAB10F437D10058C15A /* Connection.h in Headers */,
 				5136183E163126DA00A99DDE /* ConnectionStack.h in Headers */,
+				1AA13212191D5924009C1489 /* WKNavigationResponsePrivate.h in Headers */,
 				1AC1415118AC47EE006C602C /* WKWebViewConfigurationPrivate.h in Headers */,
 				514D9F5719119D35000063A7 /* ServicesController.h in Headers */,
 				CDC3830C17212282008A2FC3 /* CookieStorageShimLibrary.h in Headers */,
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to