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

Unified Diff: blimp/net/blob_channel/blob_channel_bindings.h

Issue 1891083002: Blimp: Add BlobChannelReceiver and bindings interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@blobchannel-sender
Patch Set: moar bindings commentz! Created 4 years, 8 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_bindings.h
diff --git a/blimp/net/blob_channel/blob_channel_bindings.h b/blimp/net/blob_channel/blob_channel_bindings.h
index 0f05f06e09e0f4038d1272250c0e0d3f887bc5c8..47c39f782399bae46fd86185bd4c2996b7d089cb 100644
--- a/blimp/net/blob_channel/blob_channel_bindings.h
+++ b/blimp/net/blob_channel/blob_channel_bindings.h
@@ -5,6 +5,7 @@
#ifndef BLIMP_NET_BLOB_CHANNEL_BLOB_CHANNEL_BINDINGS_H_
#define BLIMP_NET_BLOB_CHANNEL_BLOB_CHANNEL_BINDINGS_H_
+#include <memory>
#include <string>
#include <vector>
@@ -21,6 +22,22 @@ class BlobSenderBindings {
const std::vector<uint8_t>& data) = 0;
};
+class BlobReceiverBindings {
+ public:
+ class Delegate {
Wez 2016/04/15 17:27:43 Why is this callback wrapped in a class and called
Kevin M 2016/04/15 23:53:43 The delegate dispatches events for a single client
+ public:
+ // Invoked when a blob arrives asynchronously.
+ virtual void OnBlobReceived(const std::string& id,
+ std::unique_ptr<std::vector<uint8_t>> data) = 0;
+ };
+
+ // Requests the blob |id| from the sender. The delegate method
+ // OnBlobReceived() is triggered if and when the blob arrives.
+ virtual void Get(const std::string& id) = 0;
+
+ virtual void SetDelegate(Delegate* delegate) = 0;
+};
+
} // namespace blimp
#endif // BLIMP_NET_BLOB_CHANNEL_BLOB_CHANNEL_BINDINGS_H_

Powered by Google App Engine
This is Rietveld 408576698