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
@@ -26,7 +26,7 @@
|
|||||||
#include <Sonar/SonarState.h>
|
#include <Sonar/SonarState.h>
|
||||||
|
|
||||||
using namespace facebook;
|
using namespace facebook;
|
||||||
using namespace facebook::sonar;
|
using namespace facebook::flipper;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ Start by creating your first test file in this directory `MySonarPluginTests.cpp
|
|||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
namespace facebook {
|
namespace facebook {
|
||||||
namespace sonar {
|
namespace flipper {
|
||||||
namespace test {
|
namespace test {
|
||||||
|
|
||||||
TEST(MySonarPluginTests, testDummy) {
|
TEST(MySonarPluginTests, testDummy) {
|
||||||
@@ -69,7 +69,7 @@ TEST(MySonarPluginTests, testDummy) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace test
|
} // namespace test
|
||||||
} // namespace sonar
|
} // namespace flipper
|
||||||
} // namespace facebook
|
} // namespace facebook
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ struct CachedEvent {
|
|||||||
|
|
||||||
@interface SKBufferingPlugin(CPPInitialization)
|
@interface SKBufferingPlugin(CPPInitialization)
|
||||||
|
|
||||||
- (instancetype)initWithVectorEventSize:(NSUInteger)size connectionAccessQueue:(std::shared_ptr<facebook::sonar::DispatchQueue>)connectionAccessQueue;
|
- (instancetype)initWithVectorEventSize:(NSUInteger)size connectionAccessQueue:(std::shared_ptr<facebook::flipper::DispatchQueue>)connectionAccessQueue;
|
||||||
- (instancetype)initWithDispatchQueue:(std::shared_ptr<facebook::sonar::DispatchQueue>)queue;
|
- (instancetype)initWithDispatchQueue:(std::shared_ptr<facebook::flipper::DispatchQueue>)queue;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ static const NSUInteger bufferSize = 500;
|
|||||||
@interface SKBufferingPlugin()
|
@interface SKBufferingPlugin()
|
||||||
|
|
||||||
@property(assign, nonatomic) std::vector<CachedEvent> ringBuffer;
|
@property(assign, nonatomic) std::vector<CachedEvent> ringBuffer;
|
||||||
@property(assign, nonatomic) std::shared_ptr<facebook::sonar::DispatchQueue> connectionAccessQueue;
|
@property(assign, nonatomic) std::shared_ptr<facebook::flipper::DispatchQueue> connectionAccessQueue;
|
||||||
@property(strong, nonatomic) id<SonarConnection> connection;
|
@property(strong, nonatomic) id<SonarConnection> connection;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
@@ -27,7 +27,7 @@ static const NSUInteger bufferSize = 500;
|
|||||||
@implementation SKBufferingPlugin
|
@implementation SKBufferingPlugin
|
||||||
// {
|
// {
|
||||||
// std::vector<CachedEvent> _ringBuffer;
|
// std::vector<CachedEvent> _ringBuffer;
|
||||||
// std::shared_ptr<facebook::sonar::DispatchQueue> _connectionAccessQueue;
|
// std::shared_ptr<facebook::flipper::DispatchQueue> _connectionAccessQueue;
|
||||||
//
|
//
|
||||||
// id<SonarConnection> _connection;
|
// id<SonarConnection> _connection;
|
||||||
// }
|
// }
|
||||||
@@ -35,7 +35,7 @@ static const NSUInteger bufferSize = 500;
|
|||||||
- (instancetype)initWithQueue:(dispatch_queue_t)queue {
|
- (instancetype)initWithQueue:(dispatch_queue_t)queue {
|
||||||
if (self = [super init]) {
|
if (self = [super init]) {
|
||||||
_ringBuffer.reserve(bufferSize);
|
_ringBuffer.reserve(bufferSize);
|
||||||
_connectionAccessQueue = std::make_shared<facebook::sonar::GCDQueue>(queue);
|
_connectionAccessQueue = std::make_shared<facebook::flipper::GCDQueue>(queue);
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
@@ -87,14 +87,14 @@ static const NSUInteger bufferSize = 500;
|
|||||||
|
|
||||||
@implementation SKBufferingPlugin(CPPInitialization)
|
@implementation SKBufferingPlugin(CPPInitialization)
|
||||||
|
|
||||||
- (instancetype)initWithVectorEventSize:(NSUInteger)size connectionAccessQueue:(std::shared_ptr<facebook::sonar::DispatchQueue>)connectionAccessQueue {
|
- (instancetype)initWithVectorEventSize:(NSUInteger)size connectionAccessQueue:(std::shared_ptr<facebook::flipper::DispatchQueue>)connectionAccessQueue {
|
||||||
if (self = [super init]) {
|
if (self = [super init]) {
|
||||||
_ringBuffer.reserve(size);
|
_ringBuffer.reserve(size);
|
||||||
_connectionAccessQueue = connectionAccessQueue;
|
_connectionAccessQueue = connectionAccessQueue;
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
- (instancetype)initWithDispatchQueue:(std::shared_ptr<facebook::sonar::DispatchQueue>)queue {
|
- (instancetype)initWithDispatchQueue:(std::shared_ptr<facebook::flipper::DispatchQueue>)queue {
|
||||||
return [self initWithVectorEventSize:bufferSize
|
return [self initWithVectorEventSize:bufferSize
|
||||||
connectionAccessQueue:queue];
|
connectionAccessQueue:queue];
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
#import <dispatch/dispatch.h>
|
#import <dispatch/dispatch.h>
|
||||||
|
|
||||||
namespace facebook {
|
namespace facebook {
|
||||||
namespace sonar {
|
namespace flipper {
|
||||||
class DispatchQueue
|
class DispatchQueue
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -13,6 +13,6 @@
|
|||||||
#import <memory>
|
#import <memory>
|
||||||
|
|
||||||
@interface SonarKitNetworkPlugin(CPPInitialization)
|
@interface SonarKitNetworkPlugin(CPPInitialization)
|
||||||
- (instancetype)initWithNetworkAdapter:(id<SKNetworkAdapterDelegate>)adapter dispatchQueue:(std::shared_ptr<facebook::sonar::DispatchQueue>)queue;
|
- (instancetype)initWithNetworkAdapter:(id<SKNetworkAdapterDelegate>)adapter dispatchQueue:(std::shared_ptr<facebook::flipper::DispatchQueue>)queue;
|
||||||
@end
|
@end
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -106,7 +106,7 @@
|
|||||||
|
|
||||||
@implementation SonarKitNetworkPlugin (CPPInitialization)
|
@implementation SonarKitNetworkPlugin (CPPInitialization)
|
||||||
|
|
||||||
- (instancetype)initWithNetworkAdapter:(id<SKNetworkAdapterDelegate>)adapter dispatchQueue:(std::shared_ptr<facebook::sonar::DispatchQueue>)queue {
|
- (instancetype)initWithNetworkAdapter:(id<SKNetworkAdapterDelegate>)adapter dispatchQueue:(std::shared_ptr<facebook::flipper::DispatchQueue>)queue {
|
||||||
if (self = [super initWithDispatchQueue:queue]) {
|
if (self = [super initWithDispatchQueue:queue]) {
|
||||||
adapter.delegate = self;
|
adapter.delegate = self;
|
||||||
_adapter = adapter;
|
_adapter = adapter;
|
||||||
|
|||||||
@@ -16,36 +16,36 @@ PODS:
|
|||||||
- PeerTalk (0.0.2)
|
- PeerTalk (0.0.2)
|
||||||
- RSocket (0.10.0):
|
- RSocket (0.10.0):
|
||||||
- Folly
|
- Folly
|
||||||
- Sonar (0.6.16):
|
- Sonar (0.7.0):
|
||||||
- Folly (~> 1.1)
|
- Folly (~> 1.1)
|
||||||
- RSocket (~> 0.10)
|
- RSocket (~> 0.10)
|
||||||
- SonarKit (0.6.16):
|
- SonarKit (0.7.0):
|
||||||
- SonarKit/Core (= 0.6.16)
|
- SonarKit/Core (= 0.7.0)
|
||||||
- SonarKit/Core (0.6.16):
|
- SonarKit/Core (0.7.0):
|
||||||
- CocoaAsyncSocket (~> 7.6)
|
- CocoaAsyncSocket (~> 7.6)
|
||||||
- Folly (~> 1.1)
|
- Folly (~> 1.1)
|
||||||
- OpenSSL-Static (= 1.0.2.c1)
|
- OpenSSL-Static (= 1.0.2.c1)
|
||||||
- PeerTalk (~> 0.0.2)
|
- PeerTalk (~> 0.0.2)
|
||||||
- Sonar (~> 0.6.16)
|
- Sonar (~> 0.7.0)
|
||||||
- SonarKit/CppBridge
|
- SonarKit/CppBridge
|
||||||
- SonarKit/FBCxxUtils
|
- SonarKit/FBCxxUtils
|
||||||
- SonarKit/FBDefines
|
- SonarKit/FBDefines
|
||||||
- SonarKit/CppBridge (0.6.16)
|
- SonarKit/CppBridge (0.7.0)
|
||||||
- SonarKit/FBCxxUtils (0.6.16)
|
- SonarKit/FBCxxUtils (0.7.0)
|
||||||
- SonarKit/FBDefines (0.6.16)
|
- SonarKit/FBDefines (0.7.0)
|
||||||
- SonarKit/SKIOSNetworkPlugin (0.6.16):
|
- SonarKit/SKIOSNetworkPlugin (0.7.0):
|
||||||
- SonarKit/Core
|
- SonarKit/Core
|
||||||
- SonarKit/SonarKitNetworkPlugin
|
- SonarKit/SonarKitNetworkPlugin
|
||||||
- SonarKit/SonarKitLayoutComponentKitSupport (0.6.16):
|
- SonarKit/SonarKitLayoutComponentKitSupport (0.7.0):
|
||||||
- ComponentKit
|
- ComponentKit
|
||||||
- SonarKit/Core
|
- SonarKit/Core
|
||||||
- SonarKit/SonarKitLayoutPlugin
|
- SonarKit/SonarKitLayoutPlugin
|
||||||
- Yoga (~> 1.9)
|
- Yoga (~> 1.9)
|
||||||
- SonarKit/SonarKitLayoutPlugin (0.6.16):
|
- SonarKit/SonarKitLayoutPlugin (0.7.0):
|
||||||
- SonarKit/Core
|
- SonarKit/Core
|
||||||
- Yoga (~> 1.9)
|
- Yoga (~> 1.9)
|
||||||
- YogaKit (~> 1.8)
|
- YogaKit (~> 1.8)
|
||||||
- SonarKit/SonarKitNetworkPlugin (0.6.16):
|
- SonarKit/SonarKitNetworkPlugin (0.7.0):
|
||||||
- SonarKit/Core
|
- SonarKit/Core
|
||||||
- Yoga (1.9.0)
|
- Yoga (1.9.0)
|
||||||
- YogaKit (1.9.0):
|
- YogaKit (1.9.0):
|
||||||
@@ -90,11 +90,11 @@ SPEC CHECKSUMS:
|
|||||||
OpenSSL-Static: bd17e34564a8591ad76b740318683a6caa19a13e
|
OpenSSL-Static: bd17e34564a8591ad76b740318683a6caa19a13e
|
||||||
PeerTalk: 77481b0a8136f226b90ccf828d6061f70139ffde
|
PeerTalk: 77481b0a8136f226b90ccf828d6061f70139ffde
|
||||||
RSocket: 4fdb7e562db30a2d4fceddefdc601749ffc9ebe2
|
RSocket: 4fdb7e562db30a2d4fceddefdc601749ffc9ebe2
|
||||||
Sonar: 74d1e3a853f1453511108ac1b3e7469a2b2ade92
|
Sonar: 3ce26a113ca4cf69e0d784c22ca605708ee657ee
|
||||||
SonarKit: 99c7f51f670c6203c225f509ca5b6f85c6ce734a
|
SonarKit: 924c28d0c1d5ef830d79cd71c934b3710daeb767
|
||||||
Yoga: aaae8abea68951f60bee05f6277d3eed90bb91bb
|
Yoga: aaae8abea68951f60bee05f6277d3eed90bb91bb
|
||||||
YogaKit: d447a9bb808718e6f58e52a2255a8050081a3ead
|
YogaKit: d447a9bb808718e6f58e52a2255a8050081a3ead
|
||||||
|
|
||||||
PODFILE CHECKSUM: b1786f878ef1a53893b6a0f9d79d4987b72bc916
|
PODFILE CHECKSUM: b1786f878ef1a53893b6a0f9d79d4987b72bc916
|
||||||
|
|
||||||
COCOAPODS: 1.5.2
|
COCOAPODS: 1.5.3
|
||||||
|
|||||||
@@ -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.
|
pure Objective-C plugins to send messages to the underlying connection.
|
||||||
*/
|
*/
|
||||||
@interface SonarCppBridgingConnection : NSObject <SonarConnection>
|
@interface SonarCppBridgingConnection : NSObject <SonarConnection>
|
||||||
- (instancetype)initWithCppConnection:(std::shared_ptr<facebook::sonar::SonarConnection>)conn;
|
- (instancetype)initWithCppConnection:(std::shared_ptr<facebook::flipper::SonarConnection>)conn;
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -13,10 +13,10 @@
|
|||||||
|
|
||||||
@implementation SonarCppBridgingConnection
|
@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]) {
|
if (self = [super init]) {
|
||||||
conn_ = conn;
|
conn_ = conn;
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
- (void)receive:(NSString *)method withBlock:(SonarReceiver)receiver
|
- (void)receive:(NSString *)method withBlock:(SonarReceiver)receiver
|
||||||
{
|
{
|
||||||
const auto lambda = [receiver](const folly::dynamic &message,
|
const auto lambda = [receiver](const folly::dynamic &message,
|
||||||
std::unique_ptr<facebook::sonar::SonarResponder> responder) {
|
std::unique_ptr<facebook::flipper::SonarResponder> responder) {
|
||||||
@autoreleasepool {
|
@autoreleasepool {
|
||||||
SonarCppBridgingResponder *const objCResponder =
|
SonarCppBridgingResponder *const objCResponder =
|
||||||
[[SonarCppBridgingResponder alloc] initWithCppResponder:std::move(responder)];
|
[[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.
|
pure Objective-C plugins to send messages to the underlying responder.
|
||||||
*/
|
*/
|
||||||
@interface SonarCppBridgingResponder : NSObject <SonarResponder>
|
@interface SonarCppBridgingResponder : NSObject <SonarResponder>
|
||||||
- (instancetype)initWithCppResponder:(std::unique_ptr<facebook::sonar::SonarResponder>)responder;
|
- (instancetype)initWithCppResponder:(std::unique_ptr<facebook::flipper::SonarResponder>)responder;
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -10,10 +10,10 @@
|
|||||||
#import <FBCxxUtils/FBCxxFollyDynamicConvert.h>
|
#import <FBCxxUtils/FBCxxFollyDynamicConvert.h>
|
||||||
|
|
||||||
@implementation SonarCppBridgingResponder {
|
@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) {
|
if (!responder) {
|
||||||
return nil;
|
return nil;
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
#import <SonarKit/SonarPlugin.h>
|
#import <SonarKit/SonarPlugin.h>
|
||||||
|
|
||||||
namespace facebook {
|
namespace facebook {
|
||||||
namespace sonar {
|
namespace flipper {
|
||||||
|
|
||||||
using ObjCPlugin = NSObject<SonarPlugin> *;
|
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
|
that can be passed to SonarClient. This class allows developers to write pure
|
||||||
Objective-C plugins if they want.
|
Objective-C plugins if they want.
|
||||||
*/
|
*/
|
||||||
class SonarCppWrapperPlugin final : public facebook::sonar::SonarPlugin {
|
class SonarCppWrapperPlugin final : public facebook::flipper::SonarPlugin {
|
||||||
public:
|
public:
|
||||||
// Under ARC copying objCPlugin *does* increment its retain count
|
// Under ARC copying objCPlugin *does* increment its retain count
|
||||||
SonarCppWrapperPlugin(ObjCPlugin objCPlugin) : _objCPlugin(objCPlugin) {}
|
SonarCppWrapperPlugin(ObjCPlugin objCPlugin) : _objCPlugin(objCPlugin) {}
|
||||||
|
|
||||||
std::string identifier() const override { return [[_objCPlugin identifier] UTF8String]; }
|
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];
|
SonarCppBridgingConnection *const bridgingConn = [[SonarCppBridgingConnection alloc] initWithCppConnection:conn];
|
||||||
[_objCPlugin didConnect:bridgingConn];
|
[_objCPlugin didConnect:bridgingConn];
|
||||||
@@ -44,5 +44,5 @@ private:
|
|||||||
ObjCPlugin _objCPlugin;
|
ObjCPlugin _objCPlugin;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace sonar
|
} // namespace flipper
|
||||||
} // namespace facebook
|
} // namespace facebook
|
||||||
|
|||||||
@@ -20,10 +20,10 @@
|
|||||||
//#import "SKPortForwardingServer.h"
|
//#import "SKPortForwardingServer.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using WrapperPlugin = facebook::sonar::SonarCppWrapperPlugin;
|
using WrapperPlugin = facebook::flipper::SonarCppWrapperPlugin;
|
||||||
|
|
||||||
@implementation SonarClient {
|
@implementation SonarClient {
|
||||||
facebook::sonar::SonarClient *_cppClient;
|
facebook::flipper::SonarClient *_cppClient;
|
||||||
folly::ScopedEventBaseThread sonarThread;
|
folly::ScopedEventBaseThread sonarThread;
|
||||||
folly::ScopedEventBaseThread connectionThread;
|
folly::ScopedEventBaseThread connectionThread;
|
||||||
#if !TARGET_OS_SIMULATOR
|
#if !TARGET_OS_SIMULATOR
|
||||||
@@ -61,7 +61,7 @@ using WrapperPlugin = facebook::sonar::SonarCppWrapperPlugin;
|
|||||||
deviceName = [NSString stringWithFormat:@"%@ %@", [[UIDevice currentDevice] model], @"Simulator"];
|
deviceName = [NSString stringWithFormat:@"%@ %@", [[UIDevice currentDevice] model], @"Simulator"];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
facebook::sonar::SonarClient::init({
|
facebook::flipper::SonarClient::init({
|
||||||
{
|
{
|
||||||
"localhost",
|
"localhost",
|
||||||
"iOS",
|
"iOS",
|
||||||
@@ -74,7 +74,7 @@ using WrapperPlugin = facebook::sonar::SonarCppWrapperPlugin;
|
|||||||
sonarThread.getEventBase(),
|
sonarThread.getEventBase(),
|
||||||
connectionThread.getEventBase()
|
connectionThread.getEventBase()
|
||||||
});
|
});
|
||||||
_cppClient = facebook::sonar::SonarClient::instance();
|
_cppClient = facebook::flipper::SonarClient::instance();
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
@@ -129,19 +129,19 @@ using WrapperPlugin = facebook::sonar::SonarCppWrapperPlugin;
|
|||||||
- (NSArray *)getStateElements {
|
- (NSArray *)getStateElements {
|
||||||
NSMutableArray<NSDictionary<NSString *, NSString *>*> *const array = [NSMutableArray array];
|
NSMutableArray<NSDictionary<NSString *, NSString *>*> *const array = [NSMutableArray array];
|
||||||
|
|
||||||
for (facebook::sonar::StateElement element: _cppClient->getStateElements()) {
|
for (facebook::flipper::StateElement element: _cppClient->getStateElements()) {
|
||||||
facebook::sonar::State state = element.state_;
|
facebook::flipper::State state = element.state_;
|
||||||
NSString *stateString;
|
NSString *stateString;
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case facebook::sonar::in_progress:
|
case facebook::flipper::in_progress:
|
||||||
stateString = @"⏳ ";
|
stateString = @"⏳ ";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case facebook::sonar::success:
|
case facebook::flipper::success:
|
||||||
stateString = @"✅ ";
|
stateString = @"✅ ";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case facebook::sonar::failed:
|
case facebook::flipper::failed:
|
||||||
stateString = @"❌ ";
|
stateString = @"❌ ";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,6 @@
|
|||||||
|
|
||||||
@interface SonarClient (Testing)
|
@interface SonarClient (Testing)
|
||||||
|
|
||||||
- (instancetype)initWithCppClient:(facebook::sonar::SonarClient *)cppClient;
|
- (instancetype)initWithCppClient:(facebook::flipper::SonarClient *)cppClient;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
#import <SonarKit/CppBridge/SonarCppWrapperPlugin.h>
|
#import <SonarKit/CppBridge/SonarCppWrapperPlugin.h>
|
||||||
#import <SonarKit/SonarPlugin.h>
|
#import <SonarKit/SonarPlugin.h>
|
||||||
|
|
||||||
using facebook::sonar::SonarCppWrapperPlugin;
|
using facebook::flipper::SonarCppWrapperPlugin;
|
||||||
|
|
||||||
@interface DummyPlugin : NSObject <SonarPlugin>
|
@interface DummyPlugin : NSObject <SonarPlugin>
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#include "CertificateUtils.h"
|
#include "CertificateUtils.h"
|
||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
|
|
||||||
using namespace facebook::sonar;
|
using namespace facebook::flipper;
|
||||||
|
|
||||||
static constexpr auto CSR_FILE_NAME = "app.csr";
|
static constexpr auto CSR_FILE_NAME = "app.csr";
|
||||||
static constexpr auto FLIPPER_CA_FILE_NAME = "flipperCA.crt";
|
static constexpr auto FLIPPER_CA_FILE_NAME = "flipperCA.crt";
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
using namespace folly;
|
using namespace folly;
|
||||||
|
|
||||||
namespace facebook {
|
namespace facebook {
|
||||||
namespace sonar {
|
namespace flipper {
|
||||||
|
|
||||||
class ConnectionContextStore {
|
class ConnectionContextStore {
|
||||||
|
|
||||||
@@ -29,5 +29,5 @@ private:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace sonar
|
} // namespace flipper
|
||||||
} //namespace facebook
|
} //namespace facebook
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace facebook {
|
namespace facebook {
|
||||||
namespace sonar {
|
namespace flipper {
|
||||||
|
|
||||||
void log(const std::string& message) {
|
void log(const std::string& message) {
|
||||||
#ifdef __ANDROID__
|
#ifdef __ANDROID__
|
||||||
@@ -16,5 +16,5 @@ namespace sonar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace sonar
|
} // namespace flipper
|
||||||
} // namespace facebook
|
} // namespace facebook
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace facebook {
|
namespace facebook {
|
||||||
namespace sonar {
|
namespace flipper {
|
||||||
|
|
||||||
void log(const std::string& message);
|
void log(const std::string& message);
|
||||||
|
|
||||||
} // namespace sonar
|
} // namespace flipper
|
||||||
} // namespace facebook
|
} // namespace facebook
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
#if FB_SONARKIT_ENABLED
|
#if FB_SONARKIT_ENABLED
|
||||||
|
|
||||||
namespace facebook {
|
namespace facebook {
|
||||||
namespace sonar {
|
namespace flipper {
|
||||||
|
|
||||||
static SonarClient* kInstance;
|
static SonarClient* kInstance;
|
||||||
|
|
||||||
@@ -214,7 +214,7 @@ std::vector<StateElement> SonarClient::getStateElements() {
|
|||||||
return sonarState_->getStateElements();
|
return sonarState_->getStateElements();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace sonar
|
} // namespace flipper
|
||||||
} // namespace facebook
|
} // namespace facebook
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace facebook {
|
namespace facebook {
|
||||||
namespace sonar {
|
namespace flipper {
|
||||||
|
|
||||||
class SonarClient : public SonarWebSocket::Callbacks {
|
class SonarClient : public SonarWebSocket::Callbacks {
|
||||||
public:
|
public:
|
||||||
@@ -100,5 +100,5 @@ class SonarClient : public SonarWebSocket::Callbacks {
|
|||||||
void disconnect(std::shared_ptr<SonarPlugin> plugin);
|
void disconnect(std::shared_ptr<SonarPlugin> plugin);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace sonar
|
} // namespace flipper
|
||||||
} // namespace facebook
|
} // namespace facebook
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace facebook {
|
namespace facebook {
|
||||||
namespace sonar {
|
namespace flipper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Represents a connection between the Desktop and mobile plugins
|
Represents a connection between the Desktop and mobile plugins
|
||||||
@@ -50,5 +50,5 @@ class SonarConnection {
|
|||||||
const SonarReceiver& receiver) = 0;
|
const SonarReceiver& receiver) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace sonar
|
} // namespace flipper
|
||||||
} // namespace facebook
|
} // namespace facebook
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace facebook {
|
namespace facebook {
|
||||||
namespace sonar {
|
namespace flipper {
|
||||||
|
|
||||||
class SonarConnectionImpl : public SonarConnection {
|
class SonarConnectionImpl : public SonarConnection {
|
||||||
public:
|
public:
|
||||||
@@ -57,5 +57,5 @@ class SonarConnectionImpl : public SonarConnection {
|
|||||||
std::map<std::string, SonarReceiver> receivers_;
|
std::map<std::string, SonarReceiver> receivers_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace sonar
|
} // namespace flipper
|
||||||
} // namespace facebook
|
} // namespace facebook
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
namespace facebook {
|
namespace facebook {
|
||||||
namespace sonar {
|
namespace flipper {
|
||||||
|
|
||||||
struct DeviceData {
|
struct DeviceData {
|
||||||
std::string host;
|
std::string host;
|
||||||
@@ -41,5 +41,5 @@ struct SonarInitConfig {
|
|||||||
folly::EventBase* connectionWorker;
|
folly::EventBase* connectionWorker;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace sonar
|
} // namespace flipper
|
||||||
} // namespace facebook
|
} // namespace facebook
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace facebook {
|
namespace facebook {
|
||||||
namespace sonar {
|
namespace flipper {
|
||||||
|
|
||||||
class SonarPlugin {
|
class SonarPlugin {
|
||||||
public:
|
public:
|
||||||
@@ -38,5 +38,5 @@ class SonarPlugin {
|
|||||||
virtual void didDisconnect() = 0;
|
virtual void didDisconnect() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace sonar
|
} // namespace flipper
|
||||||
} // namespace facebook
|
} // namespace facebook
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#include <folly/json.h>
|
#include <folly/json.h>
|
||||||
|
|
||||||
namespace facebook {
|
namespace facebook {
|
||||||
namespace sonar {
|
namespace flipper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SonarResponder is used to asynchronously respond to messages
|
* SonarResponder is used to asynchronously respond to messages
|
||||||
@@ -32,5 +32,5 @@ class SonarResponder {
|
|||||||
virtual void error(const folly::dynamic& response) const = 0;
|
virtual void error(const folly::dynamic& response) const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace sonar
|
} // namespace flipper
|
||||||
} // namespace facebook
|
} // namespace facebook
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
#include <folly/json.h>
|
#include <folly/json.h>
|
||||||
|
|
||||||
namespace facebook {
|
namespace facebook {
|
||||||
namespace sonar {
|
namespace flipper {
|
||||||
|
|
||||||
class SonarResponderImpl : public SonarResponder {
|
class SonarResponderImpl : public SonarResponder {
|
||||||
public:
|
public:
|
||||||
@@ -37,5 +37,5 @@ class SonarResponderImpl : public SonarResponder {
|
|||||||
int64_t responseID_;
|
int64_t responseID_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace sonar
|
} // namespace flipper
|
||||||
} // namespace facebook
|
} // namespace facebook
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
#include "SonarStep.h"
|
#include "SonarStep.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
using namespace facebook::sonar;
|
using namespace facebook::flipper;
|
||||||
|
|
||||||
/* Class responsible for collecting state updates and combining them into a
|
/* Class responsible for collecting state updates and combining them into a
|
||||||
* view of the current state of the sonar client. */
|
* view of the current state of the sonar client. */
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ class SonarStep;
|
|||||||
class SonarStateUpdateListener;
|
class SonarStateUpdateListener;
|
||||||
|
|
||||||
namespace facebook {
|
namespace facebook {
|
||||||
namespace sonar {
|
namespace flipper {
|
||||||
|
|
||||||
enum State { success, in_progress, failed };
|
enum State { success, in_progress, failed };
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ class SonarState {
|
|||||||
SonarState();
|
SonarState();
|
||||||
void setUpdateListener(std::shared_ptr<SonarStateUpdateListener>);
|
void setUpdateListener(std::shared_ptr<SonarStateUpdateListener>);
|
||||||
std::string getState();
|
std::string getState();
|
||||||
std::vector<facebook::sonar::StateElement> getStateElements();
|
std::vector<facebook::flipper::StateElement> getStateElements();
|
||||||
|
|
||||||
/* To record a state update, call start() with the name of the step to get a
|
/* To record a state update, call start() with the name of the step to get a
|
||||||
SonarStep object. Call complete on this to register it successful,
|
SonarStep object. Call complete on this to register it successful,
|
||||||
@@ -54,5 +54,5 @@ class SonarState {
|
|||||||
std::shared_ptr<SonarStateUpdateListener> mListener = nullptr;
|
std::shared_ptr<SonarStateUpdateListener> mListener = nullptr;
|
||||||
std::string log;
|
std::string log;
|
||||||
std::vector<std::string> insertOrder;
|
std::vector<std::string> insertOrder;
|
||||||
std::map<std::string, facebook::sonar::State> stateMap;
|
std::map<std::string, facebook::flipper::State> stateMap;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#include <folly/json.h>
|
#include <folly/json.h>
|
||||||
|
|
||||||
namespace facebook {
|
namespace facebook {
|
||||||
namespace sonar {
|
namespace flipper {
|
||||||
|
|
||||||
class SonarWebSocket {
|
class SonarWebSocket {
|
||||||
public:
|
public:
|
||||||
@@ -59,5 +59,5 @@ class SonarWebSocket::Callbacks {
|
|||||||
virtual void onMessageReceived(const folly::dynamic& message) = 0;
|
virtual void onMessageReceived(const folly::dynamic& message) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace sonar
|
} // namespace flipper
|
||||||
} // namespace facebook
|
} // namespace facebook
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ static constexpr int securePort = 8088;
|
|||||||
static constexpr int insecurePort = 8089;
|
static constexpr int insecurePort = 8089;
|
||||||
|
|
||||||
namespace facebook {
|
namespace facebook {
|
||||||
namespace sonar {
|
namespace flipper {
|
||||||
|
|
||||||
class ConnectionEvents : public rsocket::RSocketConnectionEvents {
|
class ConnectionEvents : public rsocket::RSocketConnectionEvents {
|
||||||
private:
|
private:
|
||||||
@@ -301,5 +301,5 @@ bool SonarWebSocketImpl::isRunningInOwnThread() {
|
|||||||
return sonarEventBase_->isInEventBaseThread();
|
return sonarEventBase_->isInEventBaseThread();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace sonar
|
} // namespace flipper
|
||||||
} // namespace facebook
|
} // namespace facebook
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
|
||||||
namespace facebook {
|
namespace facebook {
|
||||||
namespace sonar {
|
namespace flipper {
|
||||||
|
|
||||||
class ConnectionEvents;
|
class ConnectionEvents;
|
||||||
class ConnectionContextStore;
|
class ConnectionContextStore;
|
||||||
@@ -67,5 +67,5 @@ class SonarWebSocketImpl : public SonarWebSocket {
|
|||||||
std::string getDeviceId();
|
std::string getDeviceId();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace sonar
|
} // namespace flipper
|
||||||
} // namespace facebook
|
} // namespace facebook
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#include <Sonar/ConnectionContextStore.h>
|
#include <Sonar/ConnectionContextStore.h>
|
||||||
|
|
||||||
namespace facebook {
|
namespace facebook {
|
||||||
namespace sonar {
|
namespace flipper {
|
||||||
namespace test {
|
namespace test {
|
||||||
|
|
||||||
class ConnectionContextStoreMock : public ConnectionContextStore {
|
class ConnectionContextStoreMock : public ConnectionContextStore {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace facebook {
|
namespace facebook {
|
||||||
namespace sonar {
|
namespace flipper {
|
||||||
|
|
||||||
class SonarConnectionMock : public SonarConnection {
|
class SonarConnectionMock : public SonarConnection {
|
||||||
public:
|
public:
|
||||||
@@ -33,5 +33,5 @@ class SonarConnectionMock : public SonarConnection {
|
|||||||
std::map<std::string, SonarReceiver> receivers_;
|
std::map<std::string, SonarReceiver> receivers_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace sonar
|
} // namespace flipper
|
||||||
} // namespace facebook
|
} // namespace facebook
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#include <Sonar/SonarPlugin.h>
|
#include <Sonar/SonarPlugin.h>
|
||||||
|
|
||||||
namespace facebook {
|
namespace facebook {
|
||||||
namespace sonar {
|
namespace flipper {
|
||||||
namespace test {
|
namespace test {
|
||||||
|
|
||||||
class SonarPluginMock : public SonarPlugin {
|
class SonarPluginMock : public SonarPlugin {
|
||||||
@@ -58,5 +58,5 @@ class SonarPluginMock : public SonarPlugin {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace test
|
} // namespace test
|
||||||
} // namespace sonar
|
} // namespace flipper
|
||||||
} // namespace facebook
|
} // namespace facebook
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace facebook {
|
namespace facebook {
|
||||||
namespace sonar {
|
namespace flipper {
|
||||||
|
|
||||||
class SonarResponderMock : public SonarResponder {
|
class SonarResponderMock : public SonarResponder {
|
||||||
public:
|
public:
|
||||||
@@ -39,5 +39,5 @@ class SonarResponderMock : public SonarResponder {
|
|||||||
std::vector<folly::dynamic>* errors_;
|
std::vector<folly::dynamic>* errors_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace sonar
|
} // namespace flipper
|
||||||
} // namespace facebook
|
} // namespace facebook
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
#include <Sonar/SonarWebSocket.h>
|
#include <Sonar/SonarWebSocket.h>
|
||||||
|
|
||||||
namespace facebook {
|
namespace facebook {
|
||||||
namespace sonar {
|
namespace flipper {
|
||||||
namespace test {
|
namespace test {
|
||||||
|
|
||||||
class SonarWebSocketMock : public SonarWebSocket {
|
class SonarWebSocketMock : public SonarWebSocket {
|
||||||
@@ -51,5 +51,5 @@ class SonarWebSocketMock : public SonarWebSocket {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace test
|
} // namespace test
|
||||||
} // namespace sonar
|
} // namespace flipper
|
||||||
} // namespace facebook
|
} // namespace facebook
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
namespace facebook {
|
namespace facebook {
|
||||||
namespace sonar {
|
namespace flipper {
|
||||||
namespace test {
|
namespace test {
|
||||||
|
|
||||||
using folly::dynamic;
|
using folly::dynamic;
|
||||||
@@ -290,5 +290,5 @@ TEST(SonarClientTests, testExceptionUnknownApi) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace test
|
} // namespace test
|
||||||
} // namespace sonar
|
} // namespace flipper
|
||||||
} // namespace facebook
|
} // namespace facebook
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
namespace facebook {
|
namespace facebook {
|
||||||
namespace sonar {
|
namespace flipper {
|
||||||
namespace test {
|
namespace test {
|
||||||
|
|
||||||
using folly::EventBase;
|
using folly::EventBase;
|
||||||
@@ -95,5 +95,5 @@ TEST_F(SonarWebSocketImplTerminationTest, testStartedEventBaseDoesntHang) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace test
|
} // namespace test
|
||||||
} // namespace sonar
|
} // namespace flipper
|
||||||
} // namespace facebook
|
} // namespace facebook
|
||||||
|
|||||||
Reference in New Issue
Block a user