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_CLIENT_CORE_COMPOSITOR_BLOB_CHANNEL_FEATURE_H_ | |
6 #define BLIMP_CLIENT_CORE_COMPOSITOR_BLOB_CHANNEL_FEATURE_H_ | |
7 | |
8 #include <memory> | |
9 | |
10 #include "base/macros.h" | |
11 #include "blimp/client/core/compositor/blob_image_serialization_processor.h" | |
12 #include "blimp/net/blimp_message_processor.h" | |
13 | |
14 namespace blimp { | |
15 | |
16 class BlobChannelReceiver; | |
17 | |
18 namespace client { | |
19 | |
20 // BlobChannelFeature processes incoming BlobChannel message from the engine and | |
21 // holds the cache of Blob payloads. | |
22 class BlobChannelFeature : public BlimpMessageProcessor { | |
23 public: | |
24 explicit BlobChannelFeature( | |
25 BlobImageSerializationProcessor::ErrorDelegate* delegate); | |
26 ~BlobChannelFeature() override; | |
27 | |
28 protected: | |
29 // The receiver that does the actual blob processing, protected for test. | |
30 std::unique_ptr<BlobChannelReceiver> blob_receiver_; | |
31 | |
32 private: | |
33 // BlimpMessageProcessor implementation. | |
34 void ProcessMessage(std::unique_ptr<BlimpMessage> message, | |
35 const net::CompletionCallback& callback) override; | |
36 | |
37 // Receives blob BlimpMessages and relays blob data to BlobChannelReceiver. | |
38 // Owned by BlobChannelReceiver, therefore stored as a raw pointer here. | |
39 BlimpMessageProcessor* incoming_msg_processor_ = nullptr; | |
40 | |
41 // Retrieves and decodes image data from |blob_receiver_|. Must outlive | |
42 // |blob_receiver_|. | |
43 BlobImageSerializationProcessor blob_image_processor_; | |
44 | |
45 DISALLOW_COPY_AND_ASSIGN(BlobChannelFeature); | |
46 }; | |
47 | |
48 } // namespace client | |
49 } // namespace blimp | |
50 | |
51 #endif // BLIMP_CLIENT_CORE_COMPOSITOR_BLOB_CHANNEL_FEATURE_H_ | |
OLD | NEW |