OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BLIMP_NET_BLOB_CHANNEL_BLOB_CHANNEL_SENDER_H_ | 5 #ifndef BLIMP_NET_BLOB_CHANNEL_BLOB_CHANNEL_SENDER_H_ |
6 #define BLIMP_NET_BLOB_CHANNEL_BLOB_CHANNEL_SENDER_H_ | 6 #define BLIMP_NET_BLOB_CHANNEL_BLOB_CHANNEL_SENDER_H_ |
7 | 7 |
8 #include <vector> | |
9 | |
8 #include "blimp/common/blob_cache/blob_cache.h" | 10 #include "blimp/common/blob_cache/blob_cache.h" |
9 #include "blimp/net/blimp_net_export.h" | 11 #include "blimp/net/blimp_net_export.h" |
10 | 12 |
11 namespace blimp { | 13 namespace blimp { |
12 | 14 |
13 class BLIMP_NET_EXPORT BlobChannelSender { | 15 class BLIMP_NET_EXPORT BlobChannelSender { |
14 public: | 16 public: |
17 struct CacheState { | |
Wez
2016/06/21 00:33:33
nit: CacheStateEntry, for consistency w/ the Mojo?
Kevin M
2016/06/21 21:23:52
Done.
| |
18 BlobId id; | |
19 bool is_replicated; | |
20 }; | |
21 | |
15 virtual ~BlobChannelSender() {} | 22 virtual ~BlobChannelSender() {} |
16 | 23 |
24 // Gets the list of cache keys and their replication status in the BlobCache. | |
25 virtual std::vector<CacheState> GetCacheState() const = 0; | |
26 | |
17 // Puts a blob in the local BlobChannel. The blob can then be pushed to the | 27 // Puts a blob in the local BlobChannel. The blob can then be pushed to the |
18 // remote receiver via "DeliverBlob()". | 28 // remote receiver via "DeliverBlob()". |
19 // Does nothing if there is already a blob |id| in the channel. | 29 // Does nothing if there is already a blob |id| in the channel. |
20 virtual void PutBlob(const BlobId& id, BlobDataPtr data) = 0; | 30 virtual void PutBlob(const BlobId& id, BlobDataPtr data) = 0; |
21 | 31 |
22 // Sends the blob |id| to the remote side, if the remote side doesn't already | 32 // Sends the blob |id| to the remote side, if the remote side doesn't already |
23 // have the blob. | 33 // have the blob. |
24 virtual void DeliverBlob(const BlobId& id) = 0; | 34 virtual void DeliverBlob(const BlobId& id) = 0; |
25 }; | 35 }; |
26 | 36 |
27 } // namespace blimp | 37 } // namespace blimp |
28 | 38 |
29 #endif // BLIMP_NET_BLOB_CHANNEL_BLOB_CHANNEL_SENDER_H_ | 39 #endif // BLIMP_NET_BLOB_CHANNEL_BLOB_CHANNEL_SENDER_H_ |
OLD | NEW |