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

Unified Diff: blimp/engine/renderer/blob_channel_sender_proxy.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/engine/renderer/blob_channel_sender_proxy.cc
diff --git a/blimp/engine/renderer/blob_channel_sender_proxy.cc b/blimp/engine/renderer/blob_channel_sender_proxy.cc
index efdfeae668bcd02cc3e329944e7a495559337843..6577da68741af76eda2ddf985cb8c4edfeb98d40 100644
--- a/blimp/engine/renderer/blob_channel_sender_proxy.cc
+++ b/blimp/engine/renderer/blob_channel_sender_proxy.cc
@@ -22,7 +22,13 @@ mojom::BlobChannelPtr GetConnectedBlobChannel() {
} // namespace
BlobChannelSenderProxy::BlobChannelSenderProxy()
- : blob_channel_(GetConnectedBlobChannel()) {}
+ : blob_channel_(GetConnectedBlobChannel()), weak_factory_(this) {
+ // TODO(kmarshall): Switch to observer push model (vs. the current pull model)
+ // once cache invalidations are introduced.
Wez 2016/07/01 00:30:20 nit: Either refer to the bug for this TODO, or rem
nyquist 2016/07/15 22:13:46 Yeah, and if there is no bug for it, just file one
Kevin M 2016/07/18 16:58:16 Done.
Kevin M 2016/07/18 16:58:16 Done.
+ blob_channel_->GetCachedBlobIds(
+ base::Bind(&BlobChannelSenderProxy::OnGetCacheStateComplete,
+ weak_factory_.GetWeakPtr()));
+}
BlobChannelSenderProxy::~BlobChannelSenderProxy() {}
@@ -52,5 +58,22 @@ void BlobChannelSenderProxy::DeliverBlob(const std::string& id) {
blob_channel_->DeliverBlob(id);
}
+std::vector<BlobChannelSender::CacheStateEntry>
+BlobChannelSenderProxy::GetCachedBlobIds() const {
+ NOTREACHED();
+ return std::vector<BlobChannelSender::CacheStateEntry>();
+}
+
+void BlobChannelSenderProxy::OnGetCacheStateComplete(
+ mojo::Map<mojo::String, bool> cache_state
+) {
Wez 2016/07/01 00:30:21 nit: This is very strange looking line-wrapping! I
Kevin M 2016/07/18 16:58:16 Re-ran git cl format, formatting is saner. I must'
+ VLOG(1) << "Received cache state from browser (" << cache_state.size()
+ << " items)";
+ replication_state_.clear();
+ for (const auto& next_item : cache_state) {
+ replication_state_[next_item.first] = next_item.second;
+ }
+}
+
} // namespace engine
} // namespace blimp

Powered by Google App Engine
This is Rietveld 408576698