Index: blimp/net/blob_channel/blob_channel_sender_impl.cc |
diff --git a/blimp/net/blob_channel/blob_channel_sender_impl.cc b/blimp/net/blob_channel/blob_channel_sender_impl.cc |
index 4279980f7dd330e3b6e9a93267d2d0b88816d56b..84dec6ccac70d8164800d56a0addeccfaab74349 100644 |
--- a/blimp/net/blob_channel/blob_channel_sender_impl.cc |
+++ b/blimp/net/blob_channel/blob_channel_sender_impl.cc |
@@ -4,6 +4,9 @@ |
#include "blimp/net/blob_channel/blob_channel_sender_impl.h" |
+#include <utility> |
+ |
+#include "base/stl_util.h" |
#include "base/strings/string_number_conversions.h" |
#include "blimp/common/blob_cache/blob_cache.h" |
#include "blimp/common/blob_cache/id_util.h" |
@@ -19,6 +22,21 @@ BlobChannelSenderImpl::BlobChannelSenderImpl(std::unique_ptr<BlobCache> cache, |
BlobChannelSenderImpl::~BlobChannelSenderImpl() {} |
+std::vector<BlobChannelSender::CacheStateEntry> |
+BlobChannelSenderImpl::GetCachedBlobIds() const { |
+ const auto cache_state = cache_->GetCachedBlobIds(); |
+ std::vector<CacheStateEntry> output; |
+ output.reserve(cache_state.size()); |
+ for (const std::string& cached_id : cache_state) { |
+ CacheStateEntry next_output; |
+ next_output.id = cached_id; |
+ next_output.was_delivered = |
+ ContainsKey(receiver_cache_contents_, cached_id); |
+ output.push_back(next_output); |
+ } |
+ return output; |
+} |
+ |
void BlobChannelSenderImpl::PutBlob(const BlobId& id, BlobDataPtr data) { |
DCHECK(data); |
DCHECK(!id.empty()); |