Chromium Code Reviews| 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_ |