Skip to content

Commit 5bc9294

Browse files
ftsuicopybara-github
authored andcommitted
Update discovery_cache comments.
PiperOrigin-RevId: 703558387
1 parent 8148400 commit 5bc9294

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

sharing/nearby_sharing_service_impl.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,8 @@ void NearbySharingServiceImpl::RegisterSendSurface(
469469
return;
470470
}
471471

472-
// Send items in discovery_cache as disabled.
472+
// All share targets in discovery_cache have received_disabled set to
473+
// true, send them to new send send surface in discovered events..
473474
for (const auto& item : discovery_cache_) {
474475
LOG(INFO) << "Reporting receive_disabled discovery cache target "
475476
<< item.second.share_target.ToString()
@@ -3274,6 +3275,8 @@ bool NearbySharingServiceImpl::FindDuplicateInDiscoveryCache(
32743275
"changed from: "
32753276
<< share_target.id << " to " << it->second.share_target.id
32763277
<< ". New endpoint_id: " << endpoint_id;
3278+
// Share targets in discovery cache have receive_disabled set to true.
3279+
// Copy only the id field from cache entry,
32773280
share_target.id = it->second.share_target.id;
32783281
discovery_cache_.erase(it);
32793282
outgoing_share_target_map_.insert_or_assign(endpoint_id, share_target);

sharing/nearby_sharing_service_impl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,7 @@ class NearbySharingServiceImpl
524524
absl::flat_hash_map<int64_t, OutgoingShareSession>
525525
outgoing_share_session_map_;
526526
// A map of Endpoint id to DiscoveryCacheEntry.
527+
// All ShareTargets in discovery cache have received_disabled set to true.
527528
absl::flat_hash_map<std::string, DiscoveryCacheEntry> discovery_cache_;
528529
// For metrics. The IDs of ShareTargets that are cancelled while trying to
529530
// establish an outgoing connection.

0 commit comments

Comments
 (0)