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

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: . 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
« 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 0234df60698b3a2c2628537b7e66cfd9ae44bfd9..413c19c94de269c54f7ee6143ba15ecbb69182a2 100644
--- a/blimp/engine/mojo/blob_channel_service.cc
+++ b/blimp/engine/mojo/blob_channel_service.cc
@@ -4,6 +4,8 @@
#include "blimp/engine/mojo/blob_channel_service.h"
+#include <vector>
+
#include "blimp/net/blob_channel/blob_channel_sender.h"
namespace blimp {
@@ -18,6 +20,23 @@ BlobChannelService::BlobChannelService(BlobChannelSender* blob_channel_sender,
BlobChannelService::~BlobChannelService() {}
+void BlobChannelService::GetCachedBlobIds(
+ const BlobChannelService::GetCachedBlobIdsCallback& callback) {
+ VLOG(1) << "BlobChannel::GetCachedBlobIds called.";
+
+ // Pass the Mojo representation of the cache state to |callback|.
+ std::vector<BlobChannelSender::CacheStateEntry> cache_state =
+ blob_channel_sender_->GetCachedBlobIds();
+ auto output = mojo::Array<mojom::CacheStateEntryPtr>::New(cache_state.size());
+ for (size_t i = 0; i < cache_state.size(); ++i) {
+ mojom::CacheStateEntryPtr converted(mojom::CacheStateEntry::New());
+ converted->id.Swap(&cache_state[i].id);
+ converted->was_delivered = cache_state[i].was_delivered;
dcheng 2016/06/25 00:55:55 Would it make sense to write a typemap for this ra
+ output[i] = std::move(converted);
+ }
+ callback.Run(std::move(output));
+}
+
void BlobChannelService::PutBlob(const mojo::String& id,
const mojo::String& data) {
blob_channel_sender_->PutBlob(id, new BlobData(data));
« 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