Rename facebook::sonar namespace
Summary: Pull Request resolved: https://github.com/facebook/flipper/pull/271 Reviewed By: passy Differential Revision: D9861393 Pulled By: jknoxville fbshipit-source-id: d65f751c35028748915023f33f273d6ec45863c8
This commit is contained in:
committed by
Facebook Github Bot
parent
159ce69bc8
commit
a480be90a2
@@ -14,5 +14,5 @@ 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 <SonarConnection>
|
||||
- (instancetype)initWithCppConnection:(std::shared_ptr<facebook::sonar::SonarConnection>)conn;
|
||||
- (instancetype)initWithCppConnection:(std::shared_ptr<facebook::flipper::SonarConnection>)conn;
|
||||
@end
|
||||
|
||||
@@ -13,10 +13,10 @@
|
||||
|
||||
@implementation SonarCppBridgingConnection
|
||||
{
|
||||
std::shared_ptr<facebook::sonar::SonarConnection> conn_;
|
||||
std::shared_ptr<facebook::flipper::SonarConnection> conn_;
|
||||
}
|
||||
|
||||
- (instancetype)initWithCppConnection:(std::shared_ptr<facebook::sonar::SonarConnection>)conn
|
||||
- (instancetype)initWithCppConnection:(std::shared_ptr<facebook::flipper::SonarConnection>)conn
|
||||
{
|
||||
if (self = [super init]) {
|
||||
conn_ = conn;
|
||||
@@ -34,7 +34,7 @@
|
||||
- (void)receive:(NSString *)method withBlock:(SonarReceiver)receiver
|
||||
{
|
||||
const auto lambda = [receiver](const folly::dynamic &message,
|
||||
std::unique_ptr<facebook::sonar::SonarResponder> responder) {
|
||||
std::unique_ptr<facebook::flipper::SonarResponder> responder) {
|
||||
@autoreleasepool {
|
||||
SonarCppBridgingResponder *const objCResponder =
|
||||
[[SonarCppBridgingResponder alloc] initWithCppResponder:std::move(responder)];
|
||||
|
||||
@@ -14,5 +14,5 @@ that forwards messages to the underlying C++ responder. This class allows
|
||||
pure Objective-C plugins to send messages to the underlying responder.
|
||||
*/
|
||||
@interface SonarCppBridgingResponder : NSObject <SonarResponder>
|
||||
- (instancetype)initWithCppResponder:(std::unique_ptr<facebook::sonar::SonarResponder>)responder;
|
||||
- (instancetype)initWithCppResponder:(std::unique_ptr<facebook::flipper::SonarResponder>)responder;
|
||||
@end
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
#import <FBCxxUtils/FBCxxFollyDynamicConvert.h>
|
||||
|
||||
@implementation SonarCppBridgingResponder {
|
||||
std::unique_ptr<facebook::sonar::SonarResponder> responder_;
|
||||
std::unique_ptr<facebook::flipper::SonarResponder> responder_;
|
||||
}
|
||||
|
||||
- (instancetype)initWithCppResponder:(std::unique_ptr<facebook::sonar::SonarResponder>)responder
|
||||
- (instancetype)initWithCppResponder:(std::unique_ptr<facebook::flipper::SonarResponder>)responder
|
||||
{
|
||||
if (!responder) {
|
||||
return nil;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#import <SonarKit/SonarPlugin.h>
|
||||
|
||||
namespace facebook {
|
||||
namespace sonar {
|
||||
namespace flipper {
|
||||
|
||||
using ObjCPlugin = NSObject<SonarPlugin> *;
|
||||
|
||||
@@ -23,14 +23,14 @@ SonarCppWrapperPlugin is a simple C++ wrapper around Objective-C Sonar plugins
|
||||
that can be passed to SonarClient. This class allows developers to write pure
|
||||
Objective-C plugins if they want.
|
||||
*/
|
||||
class SonarCppWrapperPlugin final : public facebook::sonar::SonarPlugin {
|
||||
class SonarCppWrapperPlugin final : public facebook::flipper::SonarPlugin {
|
||||
public:
|
||||
// Under ARC copying objCPlugin *does* increment its retain count
|
||||
SonarCppWrapperPlugin(ObjCPlugin objCPlugin) : _objCPlugin(objCPlugin) {}
|
||||
|
||||
std::string identifier() const override { return [[_objCPlugin identifier] UTF8String]; }
|
||||
|
||||
void didConnect(std::shared_ptr<facebook::sonar::SonarConnection> conn) override
|
||||
void didConnect(std::shared_ptr<facebook::flipper::SonarConnection> conn) override
|
||||
{
|
||||
SonarCppBridgingConnection *const bridgingConn = [[SonarCppBridgingConnection alloc] initWithCppConnection:conn];
|
||||
[_objCPlugin didConnect:bridgingConn];
|
||||
@@ -44,5 +44,5 @@ private:
|
||||
ObjCPlugin _objCPlugin;
|
||||
};
|
||||
|
||||
} // namespace sonar
|
||||
} // namespace flipper
|
||||
} // namespace facebook
|
||||
|
||||
@@ -20,10 +20,10 @@
|
||||
//#import "SKPortForwardingServer.h"
|
||||
#endif
|
||||
|
||||
using WrapperPlugin = facebook::sonar::SonarCppWrapperPlugin;
|
||||
using WrapperPlugin = facebook::flipper::SonarCppWrapperPlugin;
|
||||
|
||||
@implementation SonarClient {
|
||||
facebook::sonar::SonarClient *_cppClient;
|
||||
facebook::flipper::SonarClient *_cppClient;
|
||||
folly::ScopedEventBaseThread sonarThread;
|
||||
folly::ScopedEventBaseThread connectionThread;
|
||||
#if !TARGET_OS_SIMULATOR
|
||||
@@ -61,7 +61,7 @@ using WrapperPlugin = facebook::sonar::SonarCppWrapperPlugin;
|
||||
deviceName = [NSString stringWithFormat:@"%@ %@", [[UIDevice currentDevice] model], @"Simulator"];
|
||||
#endif
|
||||
|
||||
facebook::sonar::SonarClient::init({
|
||||
facebook::flipper::SonarClient::init({
|
||||
{
|
||||
"localhost",
|
||||
"iOS",
|
||||
@@ -74,7 +74,7 @@ using WrapperPlugin = facebook::sonar::SonarCppWrapperPlugin;
|
||||
sonarThread.getEventBase(),
|
||||
connectionThread.getEventBase()
|
||||
});
|
||||
_cppClient = facebook::sonar::SonarClient::instance();
|
||||
_cppClient = facebook::flipper::SonarClient::instance();
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@@ -129,19 +129,19 @@ using WrapperPlugin = facebook::sonar::SonarCppWrapperPlugin;
|
||||
- (NSArray *)getStateElements {
|
||||
NSMutableArray<NSDictionary<NSString *, NSString *>*> *const array = [NSMutableArray array];
|
||||
|
||||
for (facebook::sonar::StateElement element: _cppClient->getStateElements()) {
|
||||
facebook::sonar::State state = element.state_;
|
||||
for (facebook::flipper::StateElement element: _cppClient->getStateElements()) {
|
||||
facebook::flipper::State state = element.state_;
|
||||
NSString *stateString;
|
||||
switch (state) {
|
||||
case facebook::sonar::in_progress:
|
||||
case facebook::flipper::in_progress:
|
||||
stateString = @"⏳ ";
|
||||
break;
|
||||
|
||||
case facebook::sonar::success:
|
||||
case facebook::flipper::success:
|
||||
stateString = @"✅ ";
|
||||
break;
|
||||
|
||||
case facebook::sonar::failed:
|
||||
case facebook::flipper::failed:
|
||||
stateString = @"❌ ";
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user