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