Rename SonarInitConfig
Summary: Part of sonar -> flipper rename Reviewed By: priteshrnandgaonkar Differential Revision: D9908472 fbshipit-source-id: f2e694b5abfa22a745ee4719d24d6aad8af6ee2a
This commit is contained in:
committed by
Facebook Github Bot
parent
9889df3f3c
commit
574c05c41d
@@ -3,7 +3,7 @@
|
||||
#include <string>
|
||||
#include <folly/io/async/SSLContext.h>
|
||||
#include <folly/dynamic.h>
|
||||
#include "SonarInitConfig.h"
|
||||
#include "FlipperInitConfig.h"
|
||||
|
||||
using namespace folly;
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ static FlipperClient* kInstance;
|
||||
|
||||
using folly::dynamic;
|
||||
|
||||
void FlipperClient::init(SonarInitConfig config) {
|
||||
void FlipperClient::init(FlipperInitConfig config) {
|
||||
auto state = std::make_shared<SonarState>();
|
||||
auto context = std::make_shared<ConnectionContextStore>(config.deviceData);
|
||||
kInstance =
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "FlipperConnectionImpl.h"
|
||||
#include "SonarInitConfig.h"
|
||||
#include "FlipperInitConfig.h"
|
||||
#include "SonarPlugin.h"
|
||||
#include "SonarState.h"
|
||||
#include "SonarWebSocket.h"
|
||||
@@ -27,7 +27,7 @@ class FlipperClient : public SonarWebSocket::Callbacks {
|
||||
Call before accessing instance with FlipperClient::instance(). This will set up
|
||||
all the state needed to establish a Sonar connection.
|
||||
*/
|
||||
static void init(SonarInitConfig config);
|
||||
static void init(FlipperInitConfig config);
|
||||
|
||||
/**
|
||||
Standard accessor for the shared FlipperClient instance. This returns a
|
||||
|
||||
@@ -24,7 +24,7 @@ struct DeviceData {
|
||||
std::string privateAppDirectory;
|
||||
};
|
||||
|
||||
struct SonarInitConfig {
|
||||
struct FlipperInitConfig {
|
||||
/**
|
||||
Map of client specific configuration data such as app name, device name, etc.
|
||||
*/
|
||||
@@ -77,7 +77,7 @@ class Responder : public rsocket::RSocketResponder {
|
||||
}
|
||||
};
|
||||
|
||||
SonarWebSocketImpl::SonarWebSocketImpl(SonarInitConfig config, std::shared_ptr<SonarState> state, std::shared_ptr<ConnectionContextStore> contextStore)
|
||||
SonarWebSocketImpl::SonarWebSocketImpl(FlipperInitConfig config, std::shared_ptr<SonarState> state, std::shared_ptr<ConnectionContextStore> contextStore)
|
||||
: deviceData_(config.deviceData), sonarState_(state), sonarEventBase_(config.callbackWorker), connectionEventBase_(config.connectionWorker), contextStore_(contextStore) {
|
||||
CHECK_THROW(config.callbackWorker, std::invalid_argument);
|
||||
CHECK_THROW(config.connectionWorker, std::invalid_argument);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "SonarInitConfig.h"
|
||||
#include "FlipperInitConfig.h"
|
||||
#include "SonarWebSocket.h"
|
||||
#include "SonarState.h"
|
||||
#include <folly/Executor.h>
|
||||
@@ -28,7 +28,7 @@ class SonarWebSocketImpl : public SonarWebSocket {
|
||||
friend Responder;
|
||||
|
||||
public:
|
||||
SonarWebSocketImpl(SonarInitConfig config, std::shared_ptr<SonarState> state, std::shared_ptr<ConnectionContextStore> contextStore);
|
||||
SonarWebSocketImpl(FlipperInitConfig config, std::shared_ptr<SonarState> state, std::shared_ptr<ConnectionContextStore> contextStore);
|
||||
|
||||
~SonarWebSocketImpl();
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ protected:
|
||||
|
||||
TEST_F(SonarWebSocketImplTerminationTest, testNullEventBaseGetsRejected) {
|
||||
try {
|
||||
auto instance = std::make_shared<SonarWebSocketImpl>(SonarInitConfig {
|
||||
auto instance = std::make_shared<SonarWebSocketImpl>(FlipperInitConfig {
|
||||
DeviceData {},
|
||||
nullptr,
|
||||
new EventBase()
|
||||
@@ -45,7 +45,7 @@ TEST_F(SonarWebSocketImplTerminationTest, testNullEventBaseGetsRejected) {
|
||||
// Pass test
|
||||
}
|
||||
try {
|
||||
auto instance = std::make_shared<SonarWebSocketImpl>(SonarInitConfig {
|
||||
auto instance = std::make_shared<SonarWebSocketImpl>(FlipperInitConfig {
|
||||
DeviceData {},
|
||||
new EventBase(),
|
||||
nullptr
|
||||
@@ -60,7 +60,7 @@ TEST_F(SonarWebSocketImplTerminationTest, testNullEventBaseGetsRejected) {
|
||||
}
|
||||
|
||||
TEST_F(SonarWebSocketImplTerminationTest, testNonStartedEventBaseDoesntHang) {
|
||||
auto config = SonarInitConfig {
|
||||
auto config = FlipperInitConfig {
|
||||
DeviceData {},
|
||||
new EventBase(),
|
||||
new EventBase()
|
||||
@@ -78,7 +78,7 @@ TEST_F(SonarWebSocketImplTerminationTest, testStartedEventBaseDoesntHang) {
|
||||
auto connectionThread = std::thread([connectionEventBase](){
|
||||
connectionEventBase->loopForever();
|
||||
});
|
||||
auto config = SonarInitConfig {
|
||||
auto config = FlipperInitConfig {
|
||||
DeviceData {},
|
||||
sonarEventBase,
|
||||
connectionEventBase
|
||||
|
||||
Reference in New Issue
Block a user