From fdc4f7a5c8956a3e1a39c812697d2d4fc3348025 Mon Sep 17 00:00:00 2001 From: Pritesh Nandgaonkar Date: Tue, 18 Sep 2018 11:56:20 -0700 Subject: [PATCH] Rename iOS SonarConnection to FlipperConnection Summary: Rename iOS SonarConnection to FlipperConnection Reviewed By: jknoxville Differential Revision: D9916509 fbshipit-source-id: 7253ab37f5ab28dc8063fb6b3765afd1c2aee645 --- .../SonarKitLayoutPlugin/SonarKitLayoutPlugin.mm | 10 +++++----- .../SonarKitNetworkPlugin/SKBufferingPlugin.mm | 8 ++++---- iOS/Sample/Podfile.lock | 2 +- iOS/SonarKit.podspec | 2 +- iOS/SonarKit/CppBridge/SonarCppBridgingConnection.h | 4 ++-- .../{SonarConnection.h => FlipperConnection.h} | 2 +- iOS/SonarKit/FlipperPlugin.h | 4 ++-- iOS/SonarKitTestUtils/BlockBasedSonarPlugin.h | 4 ++-- iOS/SonarKitTestUtils/BlockBasedSonarPlugin.m | 2 +- iOS/SonarKitTestUtils/SonarConnectionMock.h | 4 ++-- iOS/SonarKitTests/SonarCppBridgingTests.mm | 2 +- 11 files changed, 22 insertions(+), 22 deletions(-) rename iOS/SonarKit/{SonarConnection.h => FlipperConnection.h} (96%) diff --git a/iOS/Plugins/SonarKitLayoutPlugin/SonarKitLayoutPlugin/SonarKitLayoutPlugin.mm b/iOS/Plugins/SonarKitLayoutPlugin/SonarKitLayoutPlugin/SonarKitLayoutPlugin.mm index b040b4522..71836e6cb 100644 --- a/iOS/Plugins/SonarKitLayoutPlugin/SonarKitLayoutPlugin/SonarKitLayoutPlugin.mm +++ b/iOS/Plugins/SonarKitLayoutPlugin/SonarKitLayoutPlugin/SonarKitLayoutPlugin.mm @@ -10,7 +10,7 @@ #import "SonarKitLayoutPlugin.h" #import -#import +#import #import #import #import "SKDescriptorMapper.h" @@ -33,7 +33,7 @@ id _rootNode; id _tapListener; - id _connection; + id _connection; NSMutableSet *_registeredDelegates; } @@ -70,7 +70,7 @@ return @"Inspector"; } -- (void)didConnect:(id)connection { +- (void)didConnect:(id)connection { _connection = connection; [SKInvalidation enableInvalidations]; @@ -147,7 +147,7 @@ - (void)onCallSetData:(NSString *)objectId withPath:(NSArray *)path toValue:(id)value - withConnection:(id)connection { + withConnection:(id)connection { id node = [_trackedObjects objectForKey: objectId]; if (node == nil) { SKLog(@"node is nil, trying to setData: \ @@ -215,7 +215,7 @@ _lastHighlightedNode = objectId; } -- (void)onCallSetSearchActive:(BOOL)active withConnection:(id)connection { +- (void)onCallSetSearchActive:(BOOL)active withConnection:(id)connection { if (active) { [_tapListener mountWithFrame: [[UIScreen mainScreen] bounds]]; __block id rootNode = _rootNode; diff --git a/iOS/Plugins/SonarKitNetworkPlugin/SonarKitNetworkPlugin/SKBufferingPlugin.mm b/iOS/Plugins/SonarKitNetworkPlugin/SonarKitNetworkPlugin/SKBufferingPlugin.mm index 00dfbb350..713d2bd93 100644 --- a/iOS/Plugins/SonarKitNetworkPlugin/SonarKitNetworkPlugin/SKBufferingPlugin.mm +++ b/iOS/Plugins/SonarKitNetworkPlugin/SonarKitNetworkPlugin/SKBufferingPlugin.mm @@ -10,7 +10,7 @@ #import #import "SKBufferingPlugin.h" -#import +#import #import "SKDispatchQueue.h" #import "SKBufferingPlugin+CPPInitialization.h" @@ -20,7 +20,7 @@ static const NSUInteger bufferSize = 500; @property(assign, nonatomic) std::vector ringBuffer; @property(assign, nonatomic) std::shared_ptr connectionAccessQueue; -@property(strong, nonatomic) id connection; +@property(strong, nonatomic) id connection; @end @@ -29,7 +29,7 @@ static const NSUInteger bufferSize = 500; // std::vector _ringBuffer; // std::shared_ptr _connectionAccessQueue; // -// id _connection; +// id _connection; // } - (instancetype)initWithQueue:(dispatch_queue_t)queue { @@ -45,7 +45,7 @@ static const NSUInteger bufferSize = 500; return @"Network"; } -- (void)didConnect:(id)connection { +- (void)didConnect:(id)connection { _connectionAccessQueue->async(^{ self->_connection = connection; [self sendBufferedEvents]; diff --git a/iOS/Sample/Podfile.lock b/iOS/Sample/Podfile.lock index f2aaf5322..ef0c592bf 100644 --- a/iOS/Sample/Podfile.lock +++ b/iOS/Sample/Podfile.lock @@ -91,7 +91,7 @@ SPEC CHECKSUMS: PeerTalk: 77481b0a8136f226b90ccf828d6061f70139ffde RSocket: 4fdb7e562db30a2d4fceddefdc601749ffc9ebe2 Sonar: cfbef2d6119e92563d51bf3cdd9ae34f4eda068b - SonarKit: 34ede518cc5ebc9678acd0b09403674cab04a991 + SonarKit: fe6e84d73807d07900d47020170290674d931de7 Yoga: aaae8abea68951f60bee05f6277d3eed90bb91bb YogaKit: d447a9bb808718e6f58e52a2255a8050081a3ead diff --git a/iOS/SonarKit.podspec b/iOS/SonarKit.podspec index 305fa3845..1f0ac2273 100644 --- a/iOS/SonarKit.podspec +++ b/iOS/SonarKit.podspec @@ -64,7 +64,7 @@ Pod::Spec.new do |spec| 'iOS/Plugins/SonarKitNetworkPlugin/SonarKitNetworkPlugin/SKResponseInfo.h', 'iOS/Plugins/SonarKitNetworkPlugin/SonarKitNetworkPlugin/SonarKitNetworkPlugin.h', 'iOS/FBDefines/FBMacros.h', - 'iOS/SonarKit/**/{FlipperStateUpdateListener,FlipperClient,FlipperPlugin,SonarConnection,SonarResponder,SKMacros}.h' + 'iOS/SonarKit/**/{FlipperStateUpdateListener,FlipperClient,FlipperPlugin,FlipperConnection,SonarResponder,SKMacros}.h' header_search_paths = "\"$(PODS_ROOT)/SonarKit/iOS/SonarKit\" \"$(PODS_ROOT)\"/Headers/Private/SonarKit/** \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/PeerTalkSonar\"" ss.pod_target_xcconfig = { "USE_HEADERMAP" => "NO", "DEFINES_MODULE" => "YES", diff --git a/iOS/SonarKit/CppBridge/SonarCppBridgingConnection.h b/iOS/SonarKit/CppBridge/SonarCppBridgingConnection.h index 1afd764a2..c9dd2656d 100644 --- a/iOS/SonarKit/CppBridge/SonarCppBridgingConnection.h +++ b/iOS/SonarKit/CppBridge/SonarCppBridgingConnection.h @@ -6,13 +6,13 @@ * */ #import -#import +#import /** SonarCppBridgingConnection is a simple ObjC wrapper around SonarConnection that forwards messages to the underlying C++ connection. This class allows pure Objective-C plugins to send messages to the underlying connection. */ -@interface SonarCppBridgingConnection : NSObject +@interface SonarCppBridgingConnection : NSObject - (instancetype)initWithCppConnection:(std::shared_ptr)conn; @end diff --git a/iOS/SonarKit/SonarConnection.h b/iOS/SonarKit/FlipperConnection.h similarity index 96% rename from iOS/SonarKit/SonarConnection.h rename to iOS/SonarKit/FlipperConnection.h index ddf009d1e..7364b512b 100644 --- a/iOS/SonarKit/SonarConnection.h +++ b/iOS/SonarKit/FlipperConnection.h @@ -15,7 +15,7 @@ typedef void (^SonarReceiver)(NSDictionary*, id); /** Represents a connection between the Desktop and mobile plugins with corresponding identifiers. */ -@protocol SonarConnection +@protocol FlipperConnection /** Invoke a method on the Sonar desktop plugin with with a matching identifier. diff --git a/iOS/SonarKit/FlipperPlugin.h b/iOS/SonarKit/FlipperPlugin.h index f118a3fa3..b1cb50f0d 100644 --- a/iOS/SonarKit/FlipperPlugin.h +++ b/iOS/SonarKit/FlipperPlugin.h @@ -13,7 +13,7 @@ SK_EXTERN_C_BEGIN void SonarPerformBlockOnMainThread(void(^block)()); SK_EXTERN_C_END -@protocol SonarConnection; +@protocol FlipperConnection; @protocol FlipperPlugin @@ -28,7 +28,7 @@ Called when a connection has been established between this plugin and the corres the Sonar desktop app. The provided connection can be used to register method receivers as well as send messages back to the desktop app. */ -- (void)didConnect:(id)connection; +- (void)didConnect:(id)connection; /** Called when a plugin has been disconnected and the SonarConnection provided in didConnect is no diff --git a/iOS/SonarKitTestUtils/BlockBasedSonarPlugin.h b/iOS/SonarKitTestUtils/BlockBasedSonarPlugin.h index f5000965c..fdf049c76 100644 --- a/iOS/SonarKitTestUtils/BlockBasedSonarPlugin.h +++ b/iOS/SonarKitTestUtils/BlockBasedSonarPlugin.h @@ -9,9 +9,9 @@ #import -@protocol SonarConnection; +@protocol FlipperConnection; -typedef void (^ConnectBlock)(id); +typedef void (^ConnectBlock)(id); typedef void (^DisconnectBlock)(); @interface BlockBasedSonarPlugin : NSObject diff --git a/iOS/SonarKitTestUtils/BlockBasedSonarPlugin.m b/iOS/SonarKitTestUtils/BlockBasedSonarPlugin.m index 3de673ef0..4acd07a96 100644 --- a/iOS/SonarKitTestUtils/BlockBasedSonarPlugin.m +++ b/iOS/SonarKitTestUtils/BlockBasedSonarPlugin.m @@ -29,7 +29,7 @@ return _identifier; } -- (void)didConnect:(id)connection +- (void)didConnect:(id)connection { if (_connect) { _connect(connection); diff --git a/iOS/SonarKitTestUtils/SonarConnectionMock.h b/iOS/SonarKitTestUtils/SonarConnectionMock.h index 750a6a7c0..957ff23e0 100644 --- a/iOS/SonarKitTestUtils/SonarConnectionMock.h +++ b/iOS/SonarKitTestUtils/SonarConnectionMock.h @@ -7,9 +7,9 @@ */ #import -#import +#import -@interface SonarConnectionMock : NSObject +@interface SonarConnectionMock : NSObject @property (nonatomic, assign, getter=isConnected) BOOL connected; @property (nonatomic, readonly) NSDictionary *receivers; diff --git a/iOS/SonarKitTests/SonarCppBridgingTests.mm b/iOS/SonarKitTests/SonarCppBridgingTests.mm index 645961a2b..0a198cd12 100644 --- a/iOS/SonarKitTests/SonarCppBridgingTests.mm +++ b/iOS/SonarKitTests/SonarCppBridgingTests.mm @@ -19,7 +19,7 @@ using facebook::flipper::SonarCppWrapperPlugin; @implementation DummyPlugin - (NSString *)identifier { return @"Dummy"; } -- (void)didConnect:(id)connection {} +- (void)didConnect:(id)connection {} - (void)didDisconnect {} @end