Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3009)

Unified Diff: blimp/net/blob_channel/blob_channel_sender_impl.cc

Issue 2056993003: Add Mojo IPC for seeding new Renderer with Browser's cached blob state. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@blobchannel-master
Patch Set: Mojo mapz Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..da7dfb757d7a40272f593185cde7be1f73861e9b 100644
--- a/blimp/net/blob_channel/blob_channel_sender_impl.cc
+++ b/blimp/net/blob_channel/blob_channel_sender_impl.cc
@@ -19,6 +19,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& next_item_str : cache_state) {
Wez 2016/07/01 00:30:21 nit: Why not cache_entry, or just cached_id or blo
Kevin M 2016/07/18 16:58:16 Done.
+ CacheStateEntry next_output;
+ next_output.id = next_item_str;
+ next_output.was_delivered = receiver_cache_contents_.find(next_item_str) !=
+ receiver_cache_contents_.end();
+ output.push_back(next_output);
+ }
+ return output;
+}
+
void BlobChannelSenderImpl::PutBlob(const BlobId& id, BlobDataPtr data) {
DCHECK(data);
DCHECK(!id.empty());

Powered by Google App Engine
This is Rietveld 408576698