Title: [170298] trunk/Source/WebKit2
Revision
170298
Author
[email protected]
Date
2014-06-23 10:27:14 -0700 (Mon, 23 Jun 2014)

Log Message

Give read-only properties proper ownership attributes
https://bugs.webkit.org/show_bug.cgi?id=134197
<rdar://problem/16830117>

Reviewed by Dan Bernstein.

Also, make WKFrameInfo conform to NSCopying since it's a data-only object and thus intended to be copied.

* UIProcess/API/Cocoa/WKBackForwardList.h:
* UIProcess/API/Cocoa/WKBackForwardListItem.h:
* UIProcess/API/Cocoa/WKFrameInfo.h:
* UIProcess/API/Cocoa/WKFrameInfo.mm:
(-[WKFrameInfo copyWithZone:]):
(-[WKFrameInfo setRequest:]): Deleted.
* UIProcess/API/Cocoa/WKNavigation.h:
* UIProcess/API/Cocoa/WKNavigationAction.h:
* UIProcess/API/Cocoa/WKNavigationAction.mm:
(-[WKNavigationAction setSourceFrame:]):
(-[WKNavigationAction setTargetFrame:]):
* UIProcess/API/Cocoa/WKNavigationActionInternal.h:
* UIProcess/API/Cocoa/WKNavigationResponse.h:
* UIProcess/API/Cocoa/WKScriptMessage.h:
* UIProcess/API/Cocoa/WKUserContentController.h:
* UIProcess/API/Cocoa/WKUserScript.h:
* UIProcess/API/Cocoa/WKWebView.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (170297 => 170298)


--- trunk/Source/WebKit2/ChangeLog	2014-06-23 17:07:54 UTC (rev 170297)
+++ trunk/Source/WebKit2/ChangeLog	2014-06-23 17:27:14 UTC (rev 170298)
@@ -1,3 +1,31 @@
+2014-06-23  Anders Carlsson  <[email protected]>
+
+        Give read-only properties proper ownership attributes
+        https://bugs.webkit.org/show_bug.cgi?id=134197
+        <rdar://problem/16830117>
+
+        Reviewed by Dan Bernstein.
+
+        Also, make WKFrameInfo conform to NSCopying since it's a data-only object and thus intended to be copied.
+
+        * UIProcess/API/Cocoa/WKBackForwardList.h:
+        * UIProcess/API/Cocoa/WKBackForwardListItem.h:
+        * UIProcess/API/Cocoa/WKFrameInfo.h:
+        * UIProcess/API/Cocoa/WKFrameInfo.mm:
+        (-[WKFrameInfo copyWithZone:]):
+        (-[WKFrameInfo setRequest:]): Deleted.
+        * UIProcess/API/Cocoa/WKNavigation.h:
+        * UIProcess/API/Cocoa/WKNavigationAction.h:
+        * UIProcess/API/Cocoa/WKNavigationAction.mm:
+        (-[WKNavigationAction setSourceFrame:]):
+        (-[WKNavigationAction setTargetFrame:]):
+        * UIProcess/API/Cocoa/WKNavigationActionInternal.h:
+        * UIProcess/API/Cocoa/WKNavigationResponse.h:
+        * UIProcess/API/Cocoa/WKScriptMessage.h:
+        * UIProcess/API/Cocoa/WKUserContentController.h:
+        * UIProcess/API/Cocoa/WKUserScript.h:
+        * UIProcess/API/Cocoa/WKWebView.h:
+
 2014-06-23  Gwang Yoon Hwang  <[email protected]>
 
         Unreviewed, GTK build fix after r170274.

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardList.h (170297 => 170298)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardList.h	2014-06-23 17:07:54 UTC (rev 170297)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardList.h	2014-06-23 17:27:14 UTC (rev 170298)
@@ -37,17 +37,17 @@
 
 /*! @abstract The current item.
  */
-@property (nonatomic, readonly) WKBackForwardListItem *currentItem;
+@property (nonatomic, readonly, strong) WKBackForwardListItem *currentItem;
 
 /*! @abstract The item immediately preceding the current item, or nil
 if there isn't one.
  */
-@property (nonatomic, readonly) WKBackForwardListItem *backItem;
+@property (nonatomic, readonly, strong) WKBackForwardListItem *backItem;
 
 /*! @abstract The item immediately following the current item, or nil
 if there isn't one.
  */
-@property (nonatomic, readonly) WKBackForwardListItem *forwardItem;
+@property (nonatomic, readonly, strong) WKBackForwardListItem *forwardItem;
 
 /*! @abstract Returns the item at a specified distance from the current
  item.
@@ -63,13 +63,13 @@
  @discussion The items are in the order in which they were originally
  visited.
  */
-@property (nonatomic, readonly) NSArray *backList;
+@property (nonatomic, readonly, copy) NSArray *backList;
 
 /*! @abstract The portion of the list following the current item.
  @discussion The items are in the order in which they were originally
  visited.
  */
-@property (nonatomic, readonly) NSArray *forwardList;
+@property (nonatomic, readonly, copy) NSArray *forwardList;
 
 @end
 

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardListItem.h (170297 => 170298)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardListItem.h	2014-06-23 17:07:54 UTC (rev 170297)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardListItem.h	2014-06-23 17:27:14 UTC (rev 170298)
@@ -36,15 +36,15 @@
 
 /*! @abstract The URL of the webpage represented by this item.
  */
-@property (readonly) NSURL *URL;
+@property (readonly, copy) NSURL *URL;
 
 /*! @abstract The title of the webpage represented by this item.
  */
-@property (readonly) NSString *title;
+@property (readonly, copy) NSString *title;
 
 /*! @abstract The URL of the initial request that created this item.
  */
-@property (readonly) NSURL *initialURL;
+@property (readonly, copy) NSURL *initialURL;
 
 @end
 

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKFrameInfo.h (170297 => 170298)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKFrameInfo.h	2014-06-23 17:07:54 UTC (rev 170297)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKFrameInfo.h	2014-06-23 17:27:14 UTC (rev 170298)
@@ -35,7 +35,7 @@
  calls.
  */
 WK_CLASS_AVAILABLE(10_10, 8_0)
-@interface WKFrameInfo : NSObject
+@interface WKFrameInfo : NSObject <NSCopying>
 
 /*! @abstract A Boolean value indicating whether the frame is the main frame
  or a subframe.
@@ -44,7 +44,7 @@
 
 /*! @abstract The frame's current request.
  */
-@property (nonatomic, readonly) NSURLRequest *request;
+@property (nonatomic, readonly, copy) NSURLRequest *request;
 
 @end
 

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKFrameInfo.mm (170297 => 170298)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKFrameInfo.mm	2014-06-23 17:07:54 UTC (rev 170297)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKFrameInfo.mm	2014-06-23 17:27:14 UTC (rev 170298)
@@ -58,9 +58,9 @@
     return _request.get();
 }
 
-- (void)setRequest:(NSURLRequest *)request
+- (id)copyWithZone:(NSZone *)zone
 {
-    _request = adoptNS([request copy]);
+    return [self retain];
 }
 
 @end

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


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigation.h	2014-06-23 17:07:54 UTC (rev 170297)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigation.h	2014-06-23 17:27:14 UTC (rev 170298)
@@ -40,22 +40,22 @@
 
 /*! @abstract The initial request used to perform the navigation.
  */
-@property (nonatomic, readonly) NSURLRequest *initialRequest;
+@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) NSURLRequest *request;
+@property (nonatomic, readonly, copy) NSURLRequest *request;
 
 /* @abstract The response to the navigation, or nil if no response has yet
  been received.
  */
-@property (nonatomic, readonly) NSURLResponse *response;
+@property (nonatomic, readonly, copy) NSURLResponse *response;
 
 /* @abstract The error if the navigation failed, or nil if it did not fail.
  */
-@property (nonatomic, readonly) NSError *error;
+@property (nonatomic, readonly, copy) NSError *error;
 
 @end
 

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationAction.h (170297 => 170298)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationAction.h	2014-06-23 17:07:54 UTC (rev 170297)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationAction.h	2014-06-23 17:27:14 UTC (rev 170298)
@@ -61,11 +61,11 @@
 
 /*! @abstract The frame requesting the navigation.
  */
-@property (nonatomic, readonly) WKFrameInfo *sourceFrame;
+@property (nonatomic, readonly, copy) WKFrameInfo *sourceFrame;
 
 /*! @abstract The target frame, or nil if this is a new window navigation.
  */
-@property (nonatomic, readonly) WKFrameInfo *targetFrame;
+@property (nonatomic, readonly, copy) WKFrameInfo *targetFrame;
 
 /*! @abstract The type of action that triggered the navigation.
  @discussion The value is one of the constants of the enumerated type WKNavigationType.
@@ -74,7 +74,7 @@
 
 /*! @abstract The navigation's request.
  */
-@property (nonatomic, readonly) NSURLRequest *request;
+@property (nonatomic, readonly, copy) NSURLRequest *request;
 
 #if !TARGET_OS_IPHONE
 

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationAction.mm (170297 => 170298)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationAction.mm	2014-06-23 17:07:54 UTC (rev 170297)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationAction.mm	2014-06-23 17:27:14 UTC (rev 170298)
@@ -134,7 +134,7 @@
 
 - (void)setSourceFrame:(WKFrameInfo *)sourceFrame
 {
-    _sourceFrame = sourceFrame;
+    _sourceFrame = adoptNS([sourceFrame copy]);
 }
 
 - (WKFrameInfo *)targetFrame
@@ -144,7 +144,7 @@
 
 - (void)setTargetFrame:(WKFrameInfo *)targetFrame
 {
-    _targetFrame = targetFrame;
+    _targetFrame = adoptNS([targetFrame copy]);
 }
 
 - (NSURLRequest *)request

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationActionInternal.h (170297 => 170298)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationActionInternal.h	2014-06-23 17:07:54 UTC (rev 170297)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationActionInternal.h	2014-06-23 17:27:14 UTC (rev 170298)
@@ -35,8 +35,8 @@
 
 @interface WKNavigationAction ()
 
-@property (nonatomic, readwrite, strong) WKFrameInfo *sourceFrame;
-@property (nonatomic, readwrite, strong) WKFrameInfo *targetFrame;
+@property (nonatomic, readwrite, copy) WKFrameInfo *sourceFrame;
+@property (nonatomic, readwrite, copy) WKFrameInfo *targetFrame;
 
 @property (nonatomic, readwrite, copy) NSURLRequest *request;
 

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


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationResponse.h	2014-06-23 17:07:54 UTC (rev 170297)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKNavigationResponse.h	2014-06-23 17:27:14 UTC (rev 170298)
@@ -42,7 +42,7 @@
 
 /*! @abstract The frame's response.
  */
-@property (nonatomic, readonly) NSURLResponse *response;
+@property (nonatomic, readonly, copy) NSURLResponse *response;
 
 /*! @abstract A Boolean value indicating whether WebKit can display the response's MIME type natively.
  @discussion Allowing a navigation response with a MIME type that can't be shown will cause the navigation to fail.

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKScriptMessage.h (170297 => 170298)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKScriptMessage.h	2014-06-23 17:07:54 UTC (rev 170297)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKScriptMessage.h	2014-06-23 17:27:14 UTC (rev 170298)
@@ -42,17 +42,17 @@
  @discussion Allowed types are NSNumber, NSString, NSDate, NSArray,
  NSDictionary, and NSNull.
  */
-@property (nonatomic, readonly) id body;
+@property (nonatomic, readonly, copy) id body;
 
 /*! @abstract The web view sending the message. */
 @property (nonatomic, readonly, weak) WKWebView *webView;
 
 /*! @abstract The frame sending the message. */
-@property (nonatomic, readonly) WKFrameInfo *frameInfo;
+@property (nonatomic, readonly, copy) WKFrameInfo *frameInfo;
 
 /*! @abstract The name of the message handler to which the message is sent.
  */
-@property (nonatomic, readonly) NSString *name;
+@property (nonatomic, readonly, copy) NSString *name;
 
 @end
 

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUserContentController.h (170297 => 170298)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUserContentController.h	2014-06-23 17:07:54 UTC (rev 170297)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUserContentController.h	2014-06-23 17:27:14 UTC (rev 170298)
@@ -43,7 +43,7 @@
 /*! @abstract The user scripts associated with this user content
  controller.
 */
-@property (nonatomic, readonly) NSArray *userScripts;
+@property (nonatomic, readonly, copy) NSArray *userScripts;
 
 /*! @abstract Adds a user script.
  @param userScript The user script to add.

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUserScript.h (170297 => 170298)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUserScript.h	2014-06-23 17:07:54 UTC (rev 170297)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUserScript.h	2014-06-23 17:27:14 UTC (rev 170298)
@@ -45,7 +45,7 @@
 @interface WKUserScript : NSObject <NSCopying>
 
 /* @abstract The script source code. */
-@property (nonatomic, readonly) NSString *source;
+@property (nonatomic, readonly, copy) NSString *source;
 
 /* @abstract When the script should be injected. */
 @property (nonatomic, readonly) WKUserScriptInjectionTime injectionTime;

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.h (170297 => 170298)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.h	2014-06-23 17:07:54 UTC (rev 170297)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.h	2014-06-23 17:27:14 UTC (rev 170298)
@@ -56,7 +56,7 @@
 
 /*! @abstract A copy of the configuration with which the web view was
  initialized. */
-@property (nonatomic, readonly) WKWebViewConfiguration *configuration;
+@property (nonatomic, readonly, copy) WKWebViewConfiguration *configuration;
 
 /*! @abstract The web view's navigation delegate. */
 @property (nonatomic, weak) id <WKNavigationDelegate> navigationDelegate;
@@ -65,7 +65,7 @@
 @property (nonatomic, weak) id <WKUIDelegate> UIDelegate;
 
 /*! @abstract The web view's back-forward list. */
-@property (nonatomic, readonly) WKBackForwardList *backForwardList;
+@property (nonatomic, readonly, strong) WKBackForwardList *backForwardList;
 
 /*! @abstract Returns a web view initialized with a specified frame and
  configuration.
@@ -110,7 +110,7 @@
  @discussion @link WKWebView @/link is key-value observing (KVO) compliant
  for this property.
  */
-@property (nonatomic, readonly) NSString *title;
+@property (nonatomic, readonly, copy) NSString *title;
 
 /*! @abstract The active URL.
  @discussion This is the URL that should be reflected in the user
@@ -118,7 +118,7 @@
  @link WKWebView @/link is key-value observing (KVO) compliant for this
  property.
  */
-@property (nonatomic, readonly) NSURL *URL;
+@property (nonatomic, readonly, copy) NSURL *URL;
 
 /*! @abstract A Boolean value indicating whether the view is currently
  loading content.
@@ -203,7 +203,7 @@
 #if TARGET_OS_IPHONE
 /*! @abstract The scroll view associated with the web view.
  */
-@property (nonatomic, readonly) UIScrollView *scrollView;
+@property (nonatomic, readonly, strong) UIScrollView *scrollView;
 #endif
 
 #if !TARGET_OS_IPHONE
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to