diff --git a/android/src/main/cpp/sonar.cpp b/android/src/main/cpp/sonar.cpp index d1acd2496..27c05bc74 100644 --- a/android/src/main/cpp/sonar.cpp +++ b/android/src/main/cpp/sonar.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include @@ -62,11 +62,11 @@ class JEventBase : public jni::HybridClass { folly::EventBase eventBase_; }; -class JSonarObject : public jni::JavaClass { +class JFlipperObject : public jni::JavaClass { public: constexpr static auto kJavaDescriptor = "Lcom/facebook/sonar/core/SonarObject;"; - static jni::local_ref create(const folly::dynamic& json) { + static jni::local_ref create(const folly::dynamic& json) { return newInstance(folly::toJson(json)); } @@ -76,11 +76,11 @@ class JSonarObject : public jni::JavaClass { } }; -class JSonarArray : public jni::JavaClass { +class JFlipperArray : public jni::JavaClass { public: constexpr static auto kJavaDescriptor = "Lcom/facebook/sonar/core/SonarArray;"; - static jni::local_ref create(const folly::dynamic& json) { + static jni::local_ref create(const folly::dynamic& json) { return newInstance(folly::toJson(json)); } @@ -90,75 +90,75 @@ class JSonarArray : public jni::JavaClass { } }; -class JSonarResponder : public jni::JavaClass { +class JFlipperResponder : public jni::JavaClass { public: - constexpr static auto kJavaDescriptor = "Lcom/facebook/sonar/core/SonarResponder;"; + constexpr static auto kJavaDescriptor = "Lcom/facebook/sonar/core/FlipperResponder;"; }; -class JSonarResponderImpl : public jni::HybridClass { +class JFlipperResponderImpl : public jni::HybridClass { public: constexpr static auto kJavaDescriptor = "Lcom/facebook/sonar/android/SonarResponderImpl;"; static void registerNatives() { registerHybrid({ - makeNativeMethod("successObject", JSonarResponderImpl::successObject), - makeNativeMethod("successArray", JSonarResponderImpl::successArray), - makeNativeMethod("error", JSonarResponderImpl::error), + makeNativeMethod("successObject", JFlipperResponderImpl::successObject), + makeNativeMethod("successArray", JFlipperResponderImpl::successArray), + makeNativeMethod("error", JFlipperResponderImpl::error), }); } - void successObject(jni::alias_ref json) { + void successObject(jni::alias_ref json) { _responder->success(json ? folly::parseJson(json->toJsonString()) : folly::dynamic::object()); } - void successArray(jni::alias_ref json) { + void successArray(jni::alias_ref json) { _responder->success(json ? folly::parseJson(json->toJsonString()) : folly::dynamic::object()); } - void error(jni::alias_ref json) { + void error(jni::alias_ref json) { _responder->error(json ? folly::parseJson(json->toJsonString()) : folly::dynamic::object()); } private: friend HybridBase; - std::shared_ptr _responder; + std::shared_ptr _responder; - JSonarResponderImpl(std::shared_ptr responder): _responder(std::move(responder)) {} + JFlipperResponderImpl(std::shared_ptr responder): _responder(std::move(responder)) {} }; -class JSonarReceiver : public jni::JavaClass { +class JFlipperReceiver : public jni::JavaClass { public: constexpr static auto kJavaDescriptor = "Lcom/facebook/sonar/core/SonarReceiver;"; - void receive(const folly::dynamic params, std::shared_ptr responder) const { - static const auto method = javaClassStatic()->getMethod, jni::alias_ref)>("onReceive"); - method(self(), JSonarObject::create(std::move(params)), JSonarResponderImpl::newObjectCxxArgs(responder)); + void receive(const folly::dynamic params, std::shared_ptr responder) const { + static const auto method = javaClassStatic()->getMethod, jni::alias_ref)>("onReceive"); + method(self(), JFlipperObject::create(std::move(params)), JFlipperResponderImpl::newObjectCxxArgs(responder)); } }; -class JSonarConnection : public jni::JavaClass { +class JFlipperConnection : public jni::JavaClass { public: constexpr static auto kJavaDescriptor = "Lcom/facebook/sonar/core/SonarConnection;"; }; -class JSonarConnectionImpl : public jni::HybridClass { +class JFlipperConnectionImpl : public jni::HybridClass { public: constexpr static auto kJavaDescriptor = "Lcom/facebook/sonar/android/SonarConnectionImpl;"; static void registerNatives() { registerHybrid({ - makeNativeMethod("sendObject", JSonarConnectionImpl::sendObject), - makeNativeMethod("sendArray", JSonarConnectionImpl::sendArray), - makeNativeMethod("reportError", JSonarConnectionImpl::reportError), - makeNativeMethod("receive", JSonarConnectionImpl::receive), + makeNativeMethod("sendObject", JFlipperConnectionImpl::sendObject), + makeNativeMethod("sendArray", JFlipperConnectionImpl::sendArray), + makeNativeMethod("reportError", JFlipperConnectionImpl::reportError), + makeNativeMethod("receive", JFlipperConnectionImpl::receive), }); } - void sendObject(const std::string method, jni::alias_ref json) { + void sendObject(const std::string method, jni::alias_ref json) { _connection->send(std::move(method), json ? folly::parseJson(json->toJsonString()) : folly::dynamic::object()); } - void sendArray(const std::string method, jni::alias_ref json) { + void sendArray(const std::string method, jni::alias_ref json) { _connection->send(std::move(method), json ? folly::parseJson(json->toJsonString()) : folly::dynamic::object()); } @@ -166,9 +166,9 @@ class JSonarConnectionImpl : public jni::HybridClasserror(throwable->toString(), throwable->getStackTrace()->toString()); } - void receive(const std::string method, jni::alias_ref receiver) { + void receive(const std::string method, jni::alias_ref receiver) { auto global = make_global(receiver); - _connection->receive(std::move(method), [global] (const folly::dynamic& params, std::unique_ptr responder) { + _connection->receive(std::move(method), [global] (const folly::dynamic& params, std::unique_ptr responder) { global->receive(params, std::move(responder)); }); } @@ -177,10 +177,10 @@ class JSonarConnectionImpl : public jni::HybridClass _connection; - JSonarConnectionImpl(std::shared_ptr connection): _connection(std::move(connection)) {} + JFlipperConnectionImpl(std::shared_ptr connection): _connection(std::move(connection)) {} }; -class JSonarPlugin : public jni::JavaClass { +class JFlipperPlugin : public jni::JavaClass { public: constexpr static auto kJavaDescriptor = "Lcom/facebook/sonar/core/SonarPlugin;"; @@ -190,8 +190,8 @@ class JSonarPlugin : public jni::JavaClass { } void didConnect(std::shared_ptr conn) { - static const auto method = javaClassStatic()->getMethod)>("onConnect"); - method(self(), JSonarConnectionImpl::newObjectCxxArgs(conn)); + static const auto method = javaClassStatic()->getMethod)>("onConnect"); + method(self(), JFlipperConnectionImpl::newObjectCxxArgs(conn)); } void didDisconnect() { @@ -200,7 +200,7 @@ class JSonarPlugin : public jni::JavaClass { } }; -class JSonarStateUpdateListener : public jni::JavaClass { +class JFlipperStateUpdateListener : public jni::JavaClass { public: constexpr static auto kJavaDescriptor = "Lcom/facebook/sonar/core/SonarStateUpdateListener;"; @@ -222,18 +222,18 @@ class JSonarStateUpdateListener : public jni::JavaClass stateListener); + AndroidFlipperStateUpdateListener(jni::alias_ref stateListener); void onUpdate(); private: - jni::global_ref jStateListener; + jni::global_ref jStateListener; }; -class JSonarPluginWrapper : public SonarPlugin { +class JFlipperPluginWrapper : public SonarPlugin { public: - jni::global_ref jplugin; + jni::global_ref jplugin; virtual std::string identifier() const override { return jplugin->identifier(); @@ -247,7 +247,7 @@ class JSonarPluginWrapper : public SonarPlugin { jplugin->didDisconnect(); } - JSonarPluginWrapper(jni::global_ref plugin): jplugin(plugin) {} + JFlipperPluginWrapper(jni::global_ref plugin): jplugin(plugin) {} }; struct JStateSummary : public jni::JavaClass { @@ -265,27 +265,27 @@ public: }; -class JSonarClient : public jni::HybridClass { +class JFlipperClient : public jni::HybridClass { public: constexpr static auto kJavaDescriptor = "Lcom/facebook/sonar/android/SonarClientImpl;"; static void registerNatives() { registerHybrid({ - makeNativeMethod("init", JSonarClient::init), - makeNativeMethod("getInstance", JSonarClient::getInstance), - makeNativeMethod("start", JSonarClient::start), - makeNativeMethod("stop", JSonarClient::stop), - makeNativeMethod("addPlugin", JSonarClient::addPlugin), - makeNativeMethod("removePlugin", JSonarClient::removePlugin), - makeNativeMethod("subscribeForUpdates", JSonarClient::subscribeForUpdates), - makeNativeMethod("unsubscribe", JSonarClient::unsubscribe), - makeNativeMethod("getPlugin", JSonarClient::getPlugin), - makeNativeMethod("getState", JSonarClient::getState), - makeNativeMethod("getStateSummary", JSonarClient::getStateSummary), + makeNativeMethod("init", JFlipperClient::init), + makeNativeMethod("getInstance", JFlipperClient::getInstance), + makeNativeMethod("start", JFlipperClient::start), + makeNativeMethod("stop", JFlipperClient::stop), + makeNativeMethod("addPlugin", JFlipperClient::addPlugin), + makeNativeMethod("removePlugin", JFlipperClient::removePlugin), + makeNativeMethod("subscribeForUpdates", JFlipperClient::subscribeForUpdates), + makeNativeMethod("unsubscribe", JFlipperClient::unsubscribe), + makeNativeMethod("getPlugin", JFlipperClient::getPlugin), + makeNativeMethod("getState", JFlipperClient::getState), + makeNativeMethod("getStateSummary", JFlipperClient::getStateSummary), }); } - static jni::alias_ref getInstance(jni::alias_ref) { + static jni::alias_ref getInstance(jni::alias_ref) { static auto client = make_global(newObjectCxxArgs()); return client; } @@ -298,19 +298,19 @@ class JSonarClient : public jni::HybridClass { SonarClient::instance()->stop(); } - void addPlugin(jni::alias_ref plugin) { - auto wrapper = std::make_shared(make_global(plugin)); + void addPlugin(jni::alias_ref plugin) { + auto wrapper = std::make_shared(make_global(plugin)); SonarClient::instance()->addPlugin(wrapper); } - void removePlugin(jni::alias_ref plugin) { + void removePlugin(jni::alias_ref plugin) { auto client = SonarClient::instance(); client->removePlugin(client->getPlugin(plugin->identifier())); } - void subscribeForUpdates(jni::alias_ref stateListener) { + void subscribeForUpdates(jni::alias_ref stateListener) { auto client = SonarClient::instance(); - mStateListener = std::make_shared(stateListener); + mStateListener = std::make_shared(stateListener); client->setStateListener(mStateListener); } @@ -339,10 +339,10 @@ class JSonarClient : public jni::HybridClass { return summary; } - jni::alias_ref getPlugin(const std::string& identifier) { + jni::alias_ref getPlugin(const std::string& identifier) { auto plugin = SonarClient::instance()->getPlugin(identifier); if (plugin) { - auto wrapper = std::static_pointer_cast(plugin); + auto wrapper = std::static_pointer_cast(plugin); return wrapper->jplugin; } else { return nullptr; @@ -379,24 +379,24 @@ class JSonarClient : public jni::HybridClass { private: friend HybridBase; std::shared_ptr mStateListener = nullptr; - JSonarClient() {} + JFlipperClient() {} }; } // namespace jint JNI_OnLoad(JavaVM* vm, void*) { return jni::initialize(vm, [] { - JSonarClient::registerNatives(); - JSonarConnectionImpl::registerNatives(); - JSonarResponderImpl::registerNatives(); + JFlipperClient::registerNatives(); + JFlipperConnectionImpl::registerNatives(); + JFlipperResponderImpl::registerNatives(); JEventBase::registerNatives(); }); } -AndroidSonarStateUpdateListener::AndroidSonarStateUpdateListener(jni::alias_ref stateListener) { +AndroidFlipperStateUpdateListener::AndroidFlipperStateUpdateListener(jni::alias_ref stateListener) { jStateListener = jni::make_global(stateListener); } -void AndroidSonarStateUpdateListener::onUpdate() { +void AndroidFlipperStateUpdateListener::onUpdate() { jStateListener->onUpdate(); } diff --git a/android/src/main/java/com/facebook/sonar/core/SonarResponder.java b/android/src/main/java/com/facebook/sonar/core/SonarResponder.java index 3af6d4b2a..185763ea8 100644 --- a/android/src/main/java/com/facebook/sonar/core/SonarResponder.java +++ b/android/src/main/java/com/facebook/sonar/core/SonarResponder.java @@ -8,7 +8,7 @@ package com.facebook.sonar.core; /** - * SonarResponder is used to asyncronously response to a messaged recieved from the Sonar desktop + * FlipperResponder is used to asyncronously response to a messaged recieved from the Sonar desktop * app. The Sonar Responder will automatically wrap the response in an approriate object depending * on if it is an error or not. */ diff --git a/docs/create-plugin.md b/docs/create-plugin.md index 5fd61115f..9a00c3679 100644 --- a/docs/create-plugin.md +++ b/docs/create-plugin.md @@ -66,7 +66,7 @@ Using the `SonarConnection` object you can register a receiver of a desktop meth ```java connection.receive("getData", new SonarReceiver() { @Override - public void onReceive(SonarObject params, SonarResponder responder) throws Exception { + public void onReceive(SonarObject params, FlipperResponder responder) throws Exception { responder.success( new SonarObject.Builder() .put("data", MyData.get()) @@ -87,7 +87,7 @@ connection.receive("getData", new SonarReceiver() { - (void)didConnect:(SonarConnection*)connection { - [connection receive:@"getData" withBlock:^(NSDictionary *params, SonarResponder *responder) { + [connection receive:@"getData" withBlock:^(NSDictionary *params, FlipperResponder *responder) { [responder success:@{ @"data":[MyData get], }]; @@ -104,7 +104,7 @@ connection.receive("getData", new SonarReceiver() { ```c++ void MySonarPlugin::didConnect(std::shared_ptr conn) { conn->receive("getData", [](const folly::dynamic ¶ms, - std::unique_ptr responder) { + std::unique_ptr responder) { dynamic response = folly::dynamic::object("data", getMyData()); responder->success(response); }); diff --git a/iOS/SonarKit.podspec b/iOS/SonarKit.podspec index b7670e154..39f42297c 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,SonarClient,SonarPlugin,SonarConnection,SonarResponder,SKMacros}.h' + 'iOS/SonarKit/**/{FlipperStateUpdateListener,SonarClient,SonarPlugin,SonarConnection,FlipperResponder,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.xcodeproj/project.pbxproj b/iOS/SonarKit.xcodeproj/project.pbxproj index c40fcc470..a70b3158b 100644 --- a/iOS/SonarKit.xcodeproj/project.pbxproj +++ b/iOS/SonarKit.xcodeproj/project.pbxproj @@ -100,7 +100,7 @@ 53D4C50A20A5B72800613A96 /* SonarClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 53D19A1120A4BAB900A371E3 /* SonarClient.h */; }; 53D4C50B20A5B72800613A96 /* SonarConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 53D19A1820A4BAB900A371E3 /* SonarConnection.h */; }; 53D4C50C20A5B72800613A96 /* SonarPlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 53D19A1620A4BAB900A371E3 /* SonarPlugin.h */; }; - 53D4C50D20A5B72800613A96 /* SonarResponder.h in Headers */ = {isa = PBXBuildFile; fileRef = 53D19A1320A4BAB900A371E3 /* SonarResponder.h */; }; + 53D4C50D20A5B72800613A96 /* FlipperResponder.h in Headers */ = {isa = PBXBuildFile; fileRef = 53D19A1320A4BAB900A371E3 /* FlipperResponder.h */; }; 53D4C50F20A5B72800613A96 /* SKPortForwardingServer.h in Headers */ = {isa = PBXBuildFile; fileRef = 53D19A1B20A4BABA00A371E3 /* SKPortForwardingServer.h */; }; 53D4C51020A5B72800613A96 /* SKPortForwardingCommon.h in Headers */ = {isa = PBXBuildFile; fileRef = 53D19A1C20A4BABA00A371E3 /* SKPortForwardingCommon.h */; }; 53D4C51220A5B89900613A96 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 53D4C51120A5B89900613A96 /* Foundation.framework */; }; @@ -195,7 +195,7 @@ 53D19A1020A4BAB900A371E3 /* SKMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SKMacros.h; sourceTree = ""; }; 53D19A1120A4BAB900A371E3 /* SonarClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SonarClient.h; sourceTree = ""; }; 53D19A1220A4BAB900A371E3 /* SonarClient.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SonarClient.mm; sourceTree = ""; }; - 53D19A1320A4BAB900A371E3 /* SonarResponder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SonarResponder.h; sourceTree = ""; }; + 53D19A1320A4BAB900A371E3 /* FlipperResponder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FlipperResponder.h; sourceTree = ""; }; 53D19A1420A4BAB900A371E3 /* SonarUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SonarUtil.m; sourceTree = ""; }; 53D19A1620A4BAB900A371E3 /* SonarPlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SonarPlugin.h; sourceTree = ""; }; 53D19A1820A4BAB900A371E3 /* SonarConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SonarConnection.h; sourceTree = ""; }; @@ -427,7 +427,7 @@ 53D19A1220A4BAB900A371E3 /* SonarClient.mm */, 53D19A1820A4BAB900A371E3 /* SonarConnection.h */, 53D19A1620A4BAB900A371E3 /* SonarPlugin.h */, - 53D19A1320A4BAB900A371E3 /* SonarResponder.h */, + 53D19A1320A4BAB900A371E3 /* FlipperResponder.h */, 53D19A1420A4BAB900A371E3 /* SonarUtil.m */, 53D19A1920A4BABA00A371E3 /* Utilities */, 53D19A0920A4BA3600A371E3 /* Info.plist */, @@ -504,7 +504,7 @@ 537A854221123223004A52BB /* SKSwizzle.h in Headers */, 537A853321123223004A52BB /* SKComponentHostingViewDescriptor.h in Headers */, 537A853221123223004A52BB /* SonarKitLayoutComponentKitSupport.h in Headers */, - 53D4C50D20A5B72800613A96 /* SonarResponder.h in Headers */, + 53D4C50D20A5B72800613A96 /* FlipperResponder.h in Headers */, 537A853D21123223004A52BB /* SKHighlightOverlay.h in Headers */, 537A854C21123223004A52BB /* SonarKitLayoutPlugin.h in Headers */, 537A850E21123223004A52BB /* SonarKitNetworkPlugin.h in Headers */, diff --git a/iOS/SonarKit/CppBridge/SonarCppBridgingConnection.mm b/iOS/SonarKit/CppBridge/SonarCppBridgingConnection.mm index fd3162fea..1dc97803e 100644 --- a/iOS/SonarKit/CppBridge/SonarCppBridgingConnection.mm +++ b/iOS/SonarKit/CppBridge/SonarCppBridgingConnection.mm @@ -34,7 +34,7 @@ - (void)receive:(NSString *)method withBlock:(SonarReceiver)receiver { const auto lambda = [receiver](const folly::dynamic &message, - std::unique_ptr responder) { + std::unique_ptr responder) { @autoreleasepool { SonarCppBridgingResponder *const objCResponder = [[SonarCppBridgingResponder alloc] initWithCppResponder:std::move(responder)]; diff --git a/iOS/SonarKit/CppBridge/SonarCppBridgingResponder.h b/iOS/SonarKit/CppBridge/SonarCppBridgingResponder.h index 66637bcb1..cb73569a7 100644 --- a/iOS/SonarKit/CppBridge/SonarCppBridgingResponder.h +++ b/iOS/SonarKit/CppBridge/SonarCppBridgingResponder.h @@ -5,7 +5,7 @@ * file in the root directory of this source tree. * */ -#import +#import #import /** @@ -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 -- (instancetype)initWithCppResponder:(std::unique_ptr)responder; +- (instancetype)initWithCppResponder:(std::unique_ptr)responder; @end diff --git a/iOS/SonarKit/CppBridge/SonarCppBridgingResponder.mm b/iOS/SonarKit/CppBridge/SonarCppBridgingResponder.mm index 051cf0a43..8a1bd0f23 100644 --- a/iOS/SonarKit/CppBridge/SonarCppBridgingResponder.mm +++ b/iOS/SonarKit/CppBridge/SonarCppBridgingResponder.mm @@ -10,10 +10,10 @@ #import @implementation SonarCppBridgingResponder { - std::unique_ptr responder_; + std::unique_ptr responder_; } -- (instancetype)initWithCppResponder:(std::unique_ptr)responder +- (instancetype)initWithCppResponder:(std::unique_ptr)responder { if (!responder) { return nil; diff --git a/xplat/Sonar/SonarResponder.h b/xplat/Sonar/FlipperResponder.h similarity index 81% rename from xplat/Sonar/SonarResponder.h rename to xplat/Sonar/FlipperResponder.h index d81eae485..ad47727c5 100644 --- a/xplat/Sonar/SonarResponder.h +++ b/xplat/Sonar/FlipperResponder.h @@ -14,12 +14,12 @@ namespace facebook { namespace flipper { /** - * SonarResponder is used to asynchronously respond to messages + * FlipperResponder is used to asynchronously respond to messages * received from the Sonar desktop app. */ -class SonarResponder { +class FlipperResponder { public: - virtual ~SonarResponder(){}; + virtual ~FlipperResponder(){}; /** * Deliver a successful response to the Sonar desktop app. @@ -32,5 +32,5 @@ class SonarResponder { virtual void error(const folly::dynamic& response) const = 0; }; -} // namespace flipper +} // namespace sonar } // namespace facebook diff --git a/xplat/Sonar/SonarConnection.h b/xplat/Sonar/SonarConnection.h index 941efc0f1..f8352e3b1 100644 --- a/xplat/Sonar/SonarConnection.h +++ b/xplat/Sonar/SonarConnection.h @@ -8,7 +8,7 @@ #pragma once -#include +#include #include #include #include @@ -23,7 +23,7 @@ with corresponding identifiers. class SonarConnection { public: using SonarReceiver = std::function< - void(const folly::dynamic&, std::unique_ptr)>; + void(const folly::dynamic&, std::unique_ptr)>; virtual ~SonarConnection() {} diff --git a/xplat/Sonar/SonarConnectionImpl.h b/xplat/Sonar/SonarConnectionImpl.h index 2905d7545..b463254b3 100644 --- a/xplat/Sonar/SonarConnectionImpl.h +++ b/xplat/Sonar/SonarConnectionImpl.h @@ -24,7 +24,7 @@ class SonarConnectionImpl : public SonarConnection { void call( const std::string& method, const folly::dynamic& params, - std::unique_ptr responder) { + std::unique_ptr responder) { if (receivers_.find(method) == receivers_.end()) { throw std::out_of_range("receiver " + method + " not found."); } diff --git a/xplat/Sonar/SonarResponderImpl.h b/xplat/Sonar/SonarResponderImpl.h index 8668cd915..629e84cf3 100644 --- a/xplat/Sonar/SonarResponderImpl.h +++ b/xplat/Sonar/SonarResponderImpl.h @@ -8,14 +8,14 @@ #pragma once -#include +#include #include #include namespace facebook { namespace flipper { -class SonarResponderImpl : public SonarResponder { +class SonarResponderImpl : public FlipperResponder { public: SonarResponderImpl(SonarWebSocket* socket, int64_t responseID) : socket_(socket), responseID_(responseID) {} diff --git a/xplat/SonarTestLib/SonarResponderMock.h b/xplat/SonarTestLib/SonarResponderMock.h index f00ae72b4..be390efb9 100644 --- a/xplat/SonarTestLib/SonarResponderMock.h +++ b/xplat/SonarTestLib/SonarResponderMock.h @@ -8,14 +8,14 @@ #pragma once -#include +#include #include #include namespace facebook { namespace flipper { -class SonarResponderMock : public SonarResponder { +class SonarResponderMock : public FlipperResponder { public: SonarResponderMock( std::vector* successes = nullptr, diff --git a/xplat/SonarTests/SonarClientTests.cpp b/xplat/SonarTests/SonarClientTests.cpp index 9384d2ca3..cacc16ad6 100644 --- a/xplat/SonarTests/SonarClientTests.cpp +++ b/xplat/SonarTests/SonarClientTests.cpp @@ -207,7 +207,7 @@ TEST(SonarClientTests, testExecute) { const auto connectionCallback = [](std::shared_ptr conn) { const auto receiver = [](const dynamic ¶ms, - std::unique_ptr responder) { + std::unique_ptr responder) { dynamic payload = dynamic::object("message", "yes_i_hear_u"); responder->success(payload); }; @@ -236,7 +236,7 @@ TEST(SonarClientTests, testExecuteWithParams) { const auto connectionCallback = [&](std::shared_ptr conn) { const auto receiver = [](const dynamic ¶ms, - std::unique_ptr responder) { + std::unique_ptr responder) { const auto &first = params["first"].asString(); const auto &second = params["second"].asString(); std::map m{{"dog", "woof"}, {"cat", "meow"}};