Update import

This commit is contained in:
vczh
2026-06-18 02:21:28 -07:00
parent 0a9880c045
commit aa97acc8c1
6 changed files with 3162 additions and 1714 deletions
+34
View File
@@ -2048,6 +2048,40 @@ void GacUIUnitTest_LogDiffs(const WString& appName, UnitTestRemoteProtocol& unit
GacUIUnitTest_WriteSnapshotFileIfChanged(snapshotFile, textLog); GacUIUnitTest_WriteSnapshotFileIfChanged(snapshotFile, textLog);
} }
namespace vl::presentation::remoteprotocol::channeling
{
class UnitTestChannelServer
: public Object
, public virtual inter_process::INetworkProtocolServer
{
private:
bool stopped = true;
public:
inter_process::WaitForClientResult OnClientConnected(inter_process::INetworkProtocolConnection* connection) override
{
return inter_process::WaitForClientResult::Reject;
}
void Start() override
{
stopped = false;
}
void Stop() override
{
stopped = true;
}
bool IsStopped() override
{
return stopped;
}
};
using GuiRemoteProtocolChannelServer = GuiRemoteProtocolNetworkChannelServer<UnitTestChannelServer>;
}
void GacUIUnitTest_Start(const WString& appName, Nullable<UnitTestScreenConfig> config) void GacUIUnitTest_Start(const WString& appName, Nullable<UnitTestScreenConfig> config)
{ {
UnitTestScreenConfig globalConfig; UnitTestScreenConfig globalConfig;
-31
View File
@@ -22848,40 +22848,9 @@ ChannelPackageSemantic
extern void JsonChannelUnpack(Ptr<glr::json::JsonObject> package, ChannelPackageInfo& info, Ptr<glr::json::JsonNode>& arguments); extern void JsonChannelUnpack(Ptr<glr::json::JsonObject> package, ChannelPackageInfo& info, Ptr<glr::json::JsonNode>& arguments);
extern void JsonChannelUnpack(Ptr<glr::json::JsonNode> package, ChannelPackageInfo& info, Ptr<glr::json::JsonNode>& arguments); extern void JsonChannelUnpack(Ptr<glr::json::JsonNode> package, ChannelPackageInfo& info, Ptr<glr::json::JsonNode>& arguments);
class GuiRemoteProtocolLocalChannelServerBase
: public Object
, public virtual inter_process::INetworkProtocolServer
{
private:
bool stopped = true;
public:
inter_process::WaitForClientResult OnClientConnected(inter_process::INetworkProtocolConnection* connection) override
{
return inter_process::WaitForClientResult::Reject;
}
void Start() override
{
stopped = false;
}
void Stop() override
{
stopped = true;
}
bool IsStopped() override
{
return stopped;
}
};
template<typename TServerBase> template<typename TServerBase>
using GuiRemoteProtocolNetworkChannelServer = inter_process::NetworkProtocolChannelServer<JsonPackage, glr::json::JsonNodeListSerializer, TServerBase>; using GuiRemoteProtocolNetworkChannelServer = inter_process::NetworkProtocolChannelServer<JsonPackage, glr::json::JsonNodeListSerializer, TServerBase>;
using GuiRemoteProtocolChannelServer = GuiRemoteProtocolNetworkChannelServer<GuiRemoteProtocolLocalChannelServerBase>;
class GuiRemoteProtocolChannelClient class GuiRemoteProtocolChannelClient
: public inter_process::NetworkProtocolChannelClient<JsonPackage, glr::json::JsonNodeListSerializer> : public inter_process::NetworkProtocolChannelClient<JsonPackage, glr::json::JsonNodeListSerializer>
{ {
+10 -4
View File
@@ -1992,8 +1992,9 @@ HttpClient::~HttpClient()
void HttpClient::InstallCallback(INetworkProtocolCallback* _callback) void HttpClient::InstallCallback(INetworkProtocolCallback* _callback)
{ {
CHECK_ERROR(!callback || !_callback, L"HttpClient::InstallCallback only accepts one callback at a time.");
callback = _callback; callback = _callback;
CHECK_ERROR(callback, L"HttpClient::InstallCallback needs a valid INetworkProtocolCallback."); if (!callback) return;
callback->OnInstalled(this); callback->OnInstalled(this);
} }
@@ -2921,13 +2922,17 @@ WString HttpServerConnection::SubmitResponse(PHTTP_REQUEST pRequest)
void HttpServerConnection::InstallCallback(INetworkProtocolCallback* _callback) void HttpServerConnection::InstallCallback(INetworkProtocolCallback* _callback)
{ {
CHECK_ERROR(_callback, L"HttpServerConnection::InstallCallback needs a valid INetworkProtocolCallback."); CHECK_ERROR(!callback || !_callback, L"HttpServerConnection::InstallCallback only accepts one callback at a time.");
_callback->OnInstalled(this); if (_callback)
{
_callback->OnInstalled(this);
}
List<WString> strings; List<WString> strings;
SPIN_LOCK(lockQueuedStrings) SPIN_LOCK(lockQueuedStrings)
{ {
callback = _callback; callback = _callback;
if (!callback) return;
strings = std::move(queuedStrings); strings = std::move(queuedStrings);
} }
for (const auto& str : strings) for (const auto& str : strings)
@@ -4070,8 +4075,9 @@ NamedPipeConnection::~NamedPipeConnection()
void NamedPipeConnection::InstallCallback(INetworkProtocolCallback* _callback) void NamedPipeConnection::InstallCallback(INetworkProtocolCallback* _callback)
{ {
CHECK_ERROR(!callback || !_callback, L"NamedPipeConnection::InstallCallback only accepts one callback at a time.");
callback = _callback; callback = _callback;
CHECK_ERROR(callback, L"NamedPipeConnection::InstallCallback needs a valid INetworkProtocolCallback."); if (!callback) return;
callback->OnInstalled(this); callback->OnInstalled(this);
} }
+4 -3
View File
@@ -1663,10 +1663,10 @@ INetworkProtocolServer
public: public:
/// <summary> /// <summary>
/// Install the callback to the connection. /// Install the callback to the connection.
/// If multiple text messages are received before installing the callback, all text messages will be pushed to the callback right away. /// Uninstall by passing nullptr.
/// This function can only be called once to install a callback, and no uninstallation is supported. /// Only one callback can be installed at a time.
/// </summary> /// </summary>
/// <param name="callback">The callback object. It should not be null.</param> /// <param name="callback">The callback object.</param>
virtual void InstallCallback(INetworkProtocolCallback* callback) = 0; virtual void InstallCallback(INetworkProtocolCallback* callback) = 0;
/// <summary> /// <summary>
@@ -2476,6 +2476,7 @@ NetworkProtocolChannelClient
{ {
npClient->GetConnection()->Stop(); npClient->GetConnection()->Stop();
} }
npClient->GetConnection()->InstallCallback(nullptr);
} }
void WaitForServer() override void WaitForServer() override
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff