Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef BLIMP_NET_BLOB_CHANNEL_BLOB_CHANNEL_SENDER_H_ | |
| 6 #define BLIMP_NET_BLOB_CHANNEL_BLOB_CHANNEL_SENDER_H_ | |
| 7 | |
| 8 #include <set> | |
| 9 #include <string> | |
| 10 #include <vector> | |
| 11 | |
| 12 #include "base/macros.h" | |
| 13 #include "base/memory/weak_ptr.h" | |
|
Wez
2016/04/15 17:15:16
You don't seem to use WeakPtr.
Kevin M
2016/04/15 22:42:57
Done.
| |
| 14 #include "base/observer_list.h" | |
|
Wez
2016/04/15 17:15:17
Nor observer lists.
Kevin M
2016/04/15 22:42:57
Done.
| |
| 15 #include "base/threading/thread_checker.h" | |
| 16 #include "blimp/net/blimp_message_processor.h" | |
|
Wez
2016/04/15 17:15:16
Nor BlimpMessageProcessor.
Kevin M
2016/04/15 22:42:57
Done.
| |
| 17 #include "blimp/net/blimp_net_export.h" | |
| 18 | |
| 19 namespace blimp { | |
| 20 | |
| 21 class BlobCache; | |
| 22 class BlobSenderBindings; | |
| 23 | |
| 24 class BLIMP_NET_EXPORT BlobChannelSender { | |
|
nyquist
2016/04/15 17:12:52
Should there be a short comment explaining this cl
Kevin M
2016/04/15 22:42:57
Done.
| |
| 25 public: | |
| 26 BlobChannelSender(BlobCache* cache, BlobSenderBindings* bindings); | |
|
Wez
2016/04/15 17:15:16
Ownership of bare-pointer parameters needs to be c
Kevin M
2016/04/15 22:42:57
Clarified ownership (or lack thereof.)
Addressed
| |
| 27 ~BlobChannelSender(); | |
| 28 | |
| 29 // Stores a blob inside the BlobCache. | |
|
Wez
2016/04/15 17:15:16
That's an implementation detail, surely? Conceptu
Kevin M
2016/04/15 22:42:57
It puts the blob into the channel, where it can be
| |
| 30 // Must be called on the main thread. | |
|
Wez
2016/04/15 17:15:16
There is no "main thread", nor any concept of thre
Kevin M
2016/04/15 22:42:57
Done.
| |
| 31 void Put(const std::string& id, std::unique_ptr<std::vector<uint8_t>> data); | |
| 32 | |
| 33 // Sends the blob |id| to the remote side. | |
| 34 // Must be called on the main thread. | |
| 35 void Push(const std::string& id); | |
| 36 | |
| 37 private: | |
| 38 BlobCache* cache_; | |
| 39 BlobSenderBindings* bindings_; | |
| 40 | |
| 41 // A listing of the cache items in the receiver's cache. | |
| 42 // Used for suppressing redundant data transfers. | |
|
Wez
2016/04/15 17:15:16
This tells me what it's for, but not what it actua
Kevin M
2016/04/15 22:42:57
Done.
| |
| 43 // TODO(kmarshall): Replace with a Bloom filter. | |
|
Wez
2016/04/15 17:15:16
nit: Remove this TODO; we will _probably_ want to
Kevin M
2016/04/15 22:42:57
Done.
| |
| 44 std::set<std::string> client_cache_state_; | |
|
Wez
2016/04/15 17:15:16
This name doesn't help me understand what this set
Kevin M
2016/04/15 22:42:57
Done. "receiver_cache_contents_"
| |
| 45 | |
| 46 base::ThreadChecker thread_checker_; | |
| 47 | |
| 48 DISALLOW_COPY_AND_ASSIGN(BlobChannelSender); | |
| 49 }; | |
| 50 | |
| 51 } // namespace blimp | |
| 52 | |
| 53 #endif // BLIMP_NET_BLOB_CHANNEL_BLOB_CHANNEL_SENDER_H_ | |
| OLD | NEW |