Make it easy to test enabling formal delegate protocols
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Jan 2015 16:17:04 +0000 (16:17 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Jan 2015 16:17:04 +0000 (16:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=140892

Reviewed by Dan Bernstein.

Add an WK_ENABLE_FORMAL_DELEGATE_PROTOCOLS define that controls whether delegates should be formal protocols.

* Misc/WebDownload.h:
* WebView/WebFrameLoadDelegate.h:
* WebView/WebPolicyDelegate.h:
* WebView/WebResourceLoadDelegate.h:
* WebView/WebUIDelegate.h:
* WebView/WebView.h:

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

Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Misc/WebDownload.h
Source/WebKit/mac/WebView/WebFrameLoadDelegate.h
Source/WebKit/mac/WebView/WebPolicyDelegate.h
Source/WebKit/mac/WebView/WebResourceLoadDelegate.h
Source/WebKit/mac/WebView/WebUIDelegate.h
Source/WebKit/mac/WebView/WebView.h

index b50c68c66a744e1562a838b7b8f1a61404bc2de4..aa772ec278b5569db0a1e6bbcdafd2a8ff629a65 100644 (file)
@@ -1,3 +1,19 @@
+2015-01-26  Anders Carlsson  <andersca@apple.com>
+
+        Make it easy to test enabling formal delegate protocols
+        https://bugs.webkit.org/show_bug.cgi?id=140892
+
+        Reviewed by Dan Bernstein.
+
+        Add an WK_ENABLE_FORMAL_DELEGATE_PROTOCOLS define that controls whether delegates should be formal protocols.
+
+        * Misc/WebDownload.h:
+        * WebView/WebFrameLoadDelegate.h:
+        * WebView/WebPolicyDelegate.h:
+        * WebView/WebResourceLoadDelegate.h:
+        * WebView/WebUIDelegate.h:
+        * WebView/WebView.h:
+
 2015-01-26  Chris Dumez  <cdumez@apple.com>
 
         Rename Document::body() to Document::bodyOrFrameset() for clarity
index 3e94ab50baa85cbdaa05421109cb695f6fcd2b91..53b92be2bf2f2310a3ef3a00534c7728ba3229f5 100644 (file)
 
 @optional
 
+#ifndef WK_ENABLE_FORMAL_DELEGATE_PROTOCOLS
+@end
+
+@interface NSObject (WebDownloadDelegate)
+#endif
+
 /*!
     @method downloadWindowForAuthenticationSheet:
     @abstract
index 167c3ef2c161cf86ff88d264da186326b5f14b95..42cafb6e5e3db02c3df46ef425c5c1cd3d129cf0 100644 (file)
 @protocol WebFrameLoadDelegate <NSObject>
 
 @optional
+
+#ifndef WK_ENABLE_FORMAL_DELEGATE_PROTOCOLS
 @end
 
 @interface NSObject (WebFrameLoadDelegate)
+#endif
 
 /*!
     @method webView:didStartProvisionalLoadForFrame:
index 3d4360047fe30d76c0898dc2f85b9c238f77579c..c01e56e20fd57ab3645366d5ce6ac815957f2e2e 100644 (file)
@@ -140,9 +140,12 @@ extern NSString *WebActionOriginalURLKey; // NSURL
 @protocol WebPolicyDelegate <NSObject>
 
 @optional
+
+#ifndef WK_ENABLE_FORMAL_DELEGATE_PROTOCOLS
 @end
 
 @interface NSObject (WebPolicyDelegate)
+#endif
 
 /*!
    @method webView:decidePolicyForNavigationAction:request:frame:decisionListener:
index 3603b0fb1ddcdf71ee92fad7712ff55e92aa134c..e7b1b7f30b4e99a0b1f7943ecf0da8b27e8deb66 100644 (file)
 @protocol WebResourceLoadDelegate <NSObject>
 
 @optional
+
+#ifndef WK_ENABLE_FORMAL_DELEGATE_PROTOCOLS
 @end
 
 @interface NSObject (WebResourceLoadDelegate)
+#endif
 
 /*!
     @method webView:identifierForInitialRequest:fromDataSource:
index 2d5693deac8a942ca61f0ba9dd2801f9e6c2553e..be65ec2e079a1e7cc19461ede5789f64d96a4805 100644 (file)
@@ -163,9 +163,12 @@ typedef NS_OPTIONS(NSUInteger, WebDragSourceAction) {
 @protocol WebUIDelegate <NSObject>
 
 @optional
+
+#ifndef WK_ENABLE_FORMAL_DELEGATE_PROTOCOLS
 @end
 
 @interface NSObject (WebUIDelegate)
+#endif
 
 /*!
     @method webView:createWebViewWithRequest:
index a00a0725e0dabd71f4b05b48d8628d71039ee1a7..5fdf907e3fb5c3677bac484c7041a6492958ad0d 100644 (file)
@@ -222,31 +222,51 @@ extern NSString *WebViewProgressFinishedNotification;
     @property UIDelegate
     @abstract The WebView's WebUIDelegate.
 */
+#ifdef WK_ENABLE_FORMAL_DELEGATE_PROTOCOLS
+@property (nonatomic, assign) id <WebUIDelegate> UIDelegate;
+#else
 @property (nonatomic, assign) id UIDelegate;
+#endif
 
 /*!
     @property resourceLoadDelegate
     @abstract The WebView's WebResourceLoadDelegate.
 */
+#ifdef WK_ENABLE_FORMAL_DELEGATE_PROTOCOLS
+@property (nonatomic, assign) id <WebResourceLoadDelegate> resourceLoadDelegate;
+#else
 @property (nonatomic, assign) id resourceLoadDelegate;
+#endif
 
 /*!
     @property downloadDelegate
     @abstract The WebView's WebDownloadDelegate.
 */
+#ifdef WK_ENABLE_FORMAL_DELEGATE_PROTOCOLS
+@property (nonatomic, assign) id <WebDownloadDelegate> downloadDelegate;
+#else
 @property (nonatomic, assign) id downloadDelegate;
+#endif
 
 /*!
     @property frameLoadDelegate
     @abstract The WebView's WebFrameLoadDelegate delegate.
 */
+#ifdef WK_ENABLE_FORMAL_DELEGATE_PROTOCOLS
+@property (nonatomic, assign) id <WebFrameLoadDelegate> frameLoadDelegate;
+#else
 @property (nonatomic, assign) id frameLoadDelegate;
+#endif
 
 /*!
     @property policyDelegate
     @abstract The WebView's WebPolicyDelegate.
 */
+#ifdef WK_ENABLE_FORMAL_DELEGATE_PROTOCOLS
+@property (nonatomic, assign) id <WebPolicyDelegate> policyDelegate;
+#else
 @property (nonatomic, assign) id policyDelegate;
+#endif
 
 /*!
     @property mainFrame