Deprecate WKConnection
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Oct 2018 00:13:09 +0000 (00:13 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Oct 2018 00:13:09 +0000 (00:13 +0000)
https://bugs.webkit.org/show_bug.cgi?id=190147

Patch by Alex Christensen <achristensen@webkit.org> on 2018-10-02
Reviewed by Andy Estes.

* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):
* UIProcess/API/Cocoa/WKConnection.h:
* UIProcess/API/Cocoa/WKConnection.mm:
(didReceiveMessage):
(didClose):
* UIProcess/API/Cocoa/WKConnectionInternal.h:
* UIProcess/API/Cocoa/WKProcessGroup.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm:

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

Source/WebKit/ChangeLog
Source/WebKit/Shared/Cocoa/APIObject.mm
Source/WebKit/UIProcess/API/Cocoa/WKConnection.h
Source/WebKit/UIProcess/API/Cocoa/WKConnection.mm
Source/WebKit/UIProcess/API/Cocoa/WKConnectionInternal.h
Source/WebKit/UIProcess/API/Cocoa/WKProcessGroup.h
Source/WebKit/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h
Source/WebKit/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm

index 5f94474..3059644 100644 (file)
@@ -1,3 +1,21 @@
+2018-10-02  Alex Christensen  <achristensen@webkit.org>
+
+        Deprecate WKConnection
+        https://bugs.webkit.org/show_bug.cgi?id=190147
+
+        Reviewed by Andy Estes.
+
+        * Shared/Cocoa/APIObject.mm:
+        (API::Object::newObject):
+        * UIProcess/API/Cocoa/WKConnection.h:
+        * UIProcess/API/Cocoa/WKConnection.mm:
+        (didReceiveMessage):
+        (didClose):
+        * UIProcess/API/Cocoa/WKConnectionInternal.h:
+        * UIProcess/API/Cocoa/WKProcessGroup.h:
+        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
+        * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm:
+
 2018-10-01  Dean Jackson  <dino@apple.com>
 
         [macOS] Switching to discrete GPU should be done in the UI process
index 9fbd9b5..042298a 100644 (file)
@@ -178,7 +178,9 @@ void* Object::newObject(size_t size, Type type)
     case Type::Connection:
         // While not actually a WKObject instance, WKConnection uses allocateWKObject to allocate extra space
         // instead of using ObjectStorage because the wrapped C++ object is a subclass of WebConnection.
+        ALLOW_DEPRECATED_DECLARATIONS_BEGIN
         wrapper = allocateWKObject([WKConnection self], size);
+        ALLOW_DEPRECATED_DECLARATIONS_END
         break;
 
     case Type::Preferences:
index e7b2f0e..44b050d 100644 (file)
@@ -38,7 +38,7 @@
 
 @end
 
-WK_CLASS_AVAILABLE(macosx(10.10), ios(8.0))
+WK_CLASS_DEPRECATED_WITH_REPLACEMENT("_WKRemoteObjectRegistry", macos(10.10, WK_MAC_TBA), ios(8.0, WK_IOS_TBA))
 @interface WKConnection : NSObject
 
 - (void)sendMessageWithName:(NSString *)messageName body:(id)messageBody;
index 3f75c85..1769a50 100644 (file)
@@ -49,7 +49,9 @@
 
 static void didReceiveMessage(WKConnectionRef, WKStringRef messageName, WKTypeRef messageBody, const void* clientInfo)
 {
+    ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     auto connection = (__bridge WKConnection *)clientInfo;
+    ALLOW_DEPRECATED_DECLARATIONS_END
     auto delegate = connection->_delegate.get();
 
     if ([delegate respondsToSelector:@selector(connection:didReceiveMessageWithName:body:)]) {
@@ -61,7 +63,9 @@ static void didReceiveMessage(WKConnectionRef, WKStringRef messageName, WKTypeRe
 
 static void didClose(WKConnectionRef, const void* clientInfo)
 {
+    ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     auto connection = (__bridge WKConnection *)clientInfo;
+    ALLOW_DEPRECATED_DECLARATIONS_END
     auto delegate = connection->_delegate.get();
 
     if ([delegate respondsToSelector:@selector(connectionDidClose:)])
index 16fce5d..6767106 100644 (file)
@@ -33,7 +33,9 @@
 namespace WebKit {
 
 template<> struct WrapperTraits<WebConnection> {
+    ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     using WrapperClass = WKConnection;
+    ALLOW_DEPRECATED_DECLARATIONS_END
 };
 
 }
index 11c93e8..962c763 100644 (file)
 
 @required
 
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
 - (void)processGroup:(WKProcessGroup *)processGroup didCreateConnectionToWebProcessPlugIn:(WKConnection *)connection;
+#pragma clang diagnostic pop
 
 @end
 
index 0c9c02f..3278ef6 100644 (file)
@@ -45,7 +45,10 @@ WK_CLASS_AVAILABLE(macosx(10.10), ios(8.0))
 @interface WKWebProcessPlugInController : NSObject
 - (void)extendClassesForParameterCoder:(NSArray *)classes WK_API_AVAILABLE(macosx(10.14), ios(12.0));
 
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
 @property (readonly) WKConnection *connection;
+#pragma clang diagnostic pop
 
 @property (readonly) id parameters;
 
index 91d6b96..af26156 100644 (file)
@@ -91,10 +91,12 @@ static void setUpBundleClient(WKWebProcessPlugInController *plugInController, We
     setUpBundleClient(self, *_bundle);
 }
 
+ALLOW_DEPRECATED_DECLARATIONS_BEGIN
 - (WKConnection *)connection
 {
     return wrapper(*_bundle->webConnectionToUIProcess());
 }
+ALLOW_DEPRECATED_DECLARATIONS_END
 
 - (id)parameters
 {