Roll forward to cl/328359974

Change-Id: If2b57ecc852aecf7dea454648f485fd7c08e72a9
This commit is contained in:
Alexey Polyudov
2020-08-25 11:27:27 -07:00
parent 6f9228fa6b
commit c673bf6ac0
110 changed files with 4758 additions and 1245 deletions
+5 -4
View File
@@ -227,8 +227,7 @@ EndpointManager::~EndpointManager() {
NEARBY_LOG(INFO, "EndpointManager is down");
}
EndpointManager::FrameProcessor::Handle
EndpointManager::RegisterFrameProcessor(
EndpointManager::FrameProcessor::Handle EndpointManager::RegisterFrameProcessor(
V1Frame::FrameType frame_type, EndpointManager::FrameProcessor* processor) {
const FrameProcessor::Handle handle = processor;
CountDownLatch latch(1);
@@ -318,6 +317,7 @@ void EndpointManager::EnsureWorkersTerminated(const std::string& endpoint_id) {
void EndpointManager::RegisterEndpoint(ClientProxy* client,
const std::string& endpoint_id,
const ConnectionResponseInfo& info,
const ConnectionOptions& options,
std::unique_ptr<EndpointChannel> channel,
const ConnectionListener& listener) {
CountDownLatch latch(1);
@@ -329,7 +329,8 @@ void EndpointManager::RegisterEndpoint(ClientProxy* client,
// We ignore the risk of job not scheduled (and an associated risk of memory
// leak), because this may only happen during service shutdown.
RunOnEndpointManagerThread([this, client, channel = channel.release(),
&endpoint_id, &info, &listener, &latch]() {
&endpoint_id, &info, &options, &listener,
&latch]() {
// Pass ownership of channel to EndpointChannelManager
NEARBY_LOG(INFO, "Registering endpoint with channel manager: id=%s",
endpoint_id.c_str());
@@ -382,7 +383,7 @@ void EndpointManager::RegisterEndpoint(ClientProxy* client,
// It's now time to let the client know of this new connection so that
// they can accept or reject it.
client->OnConnectionInitiated(endpoint_id, info, listener);
client->OnConnectionInitiated(endpoint_id, info, options, listener);
latch.CountDown();
});
latch.Await();