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

Unified Diff: blimp/engine/mojo/blob_channel_service.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: STL containers yay Created 4 years, 5 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
« no previous file with comments | « blimp/engine/mojo/blob_channel_service.h ('k') | blimp/engine/renderer/blob_channel_sender_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/engine/mojo/blob_channel_service.cc
diff --git a/blimp/engine/mojo/blob_channel_service.cc b/blimp/engine/mojo/blob_channel_service.cc
index a717d960d1555ce040022d0aed73dcdad23d652d..d51c9249b7afe8046b5de7d6faeeef98222a35d5 100644
--- a/blimp/engine/mojo/blob_channel_service.cc
+++ b/blimp/engine/mojo/blob_channel_service.cc
@@ -4,8 +4,12 @@
#include "blimp/engine/mojo/blob_channel_service.h"
+#include <string>
+#include <unordered_map>
#include <utility>
+#include <vector>
+#include "base/memory/ptr_util.h"
#include "blimp/net/blob_channel/blob_channel_sender.h"
#include "mojo/public/cpp/system/buffer.h"
@@ -21,7 +25,17 @@ BlobChannelService::BlobChannelService(BlobChannelSender* blob_channel_sender,
BlobChannelService::~BlobChannelService() {}
-void BlobChannelService::PutBlob(const mojo::String& id,
+void BlobChannelService::GetCachedBlobIds(
+ const BlobChannelService::GetCachedBlobIdsCallback& response_callback) {
+ VLOG(1) << "BlobChannel::GetCachedBlobIds called.";
+ std::unordered_map<std::string, bool> cache_state;
+ for (const auto& next_entry : blob_channel_sender_->GetCachedBlobIds()) {
+ cache_state[next_entry.id] = next_entry.was_delivered;
+ }
+ response_callback.Run(std::move(cache_state));
+}
+
+void BlobChannelService::PutBlob(const std::string& id,
mojo::ScopedSharedBufferHandle data,
uint32_t size) {
// Map |data| into the address space and copy out its contents.
@@ -43,7 +57,7 @@ void BlobChannelService::PutBlob(const mojo::String& id,
blob_channel_sender_->PutBlob(id, std::move(new_blob));
}
-void BlobChannelService::DeliverBlob(const mojo::String& id) {
+void BlobChannelService::DeliverBlob(const std::string& id) {
blob_channel_sender_->DeliverBlob(id);
}
« no previous file with comments | « blimp/engine/mojo/blob_channel_service.h ('k') | blimp/engine/renderer/blob_channel_sender_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698