Chromium Code Reviews| Index: blimp/client/core/compositor/blob_manager.h |
| diff --git a/blimp/client/core/compositor/blob_manager.h b/blimp/client/core/compositor/blob_manager.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..76b57bfc7bbd22acf8b12cd1d5514dd3b4b733cc |
| --- /dev/null |
| +++ b/blimp/client/core/compositor/blob_manager.h |
| @@ -0,0 +1,52 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef BLIMP_CLIENT_CORE_COMPOSITOR_BLOB_MANAGER_H_ |
| +#define BLIMP_CLIENT_CORE_COMPOSITOR_BLOB_MANAGER_H_ |
| + |
| +#include <memory> |
| + |
| +#include "base/macros.h" |
| +#include "blimp/client/core/compositor/blob_image_serialization_processor.h" |
| +#include "blimp/client/core/compositor/decoding_image_generator.h" |
| +#include "blimp/net/blimp_message_processor.h" |
| + |
| +namespace blimp { |
| + |
| +class BlobChannelReceiver; |
| + |
| +namespace client { |
| + |
| +// BlobManager processes incoming BlobChannel message from the engine and holds |
| +// cache of Blob payloads. |
| +class BlobManager : public BlimpMessageProcessor { |
|
David Trainor- moved to gerrit
2016/09/02 00:56:47
You're right... BlobChannelFeature makes sense for
xingliu
2016/09/02 02:13:40
Done.
|
| + public: |
| + explicit BlobManager( |
| + BlobImageSerializationProcessor::ErrorDelegate* delegate); |
| + ~BlobManager() override; |
| + |
| + protected: |
| + // The receiver that does the actual blob processing, protected for test. |
| + std::unique_ptr<BlobChannelReceiver> blob_receiver_; |
| + |
| + private: |
| + // BlimpMessageProcessor implementation. |
| + void ProcessMessage(std::unique_ptr<BlimpMessage> message, |
| + const net::CompletionCallback& callback) override; |
| + |
| + // Receives blob BlimpMessages and relays them to BlobChannelReceiver. |
| + // Owned by BlobChannelReceiver, therefore stored as a raw pointer here. |
| + BlimpMessageProcessor* incoming_msg_processor_ = nullptr; |
| + |
| + // Retrieves and decodes image data from |blob_receiver_|. Must outlive |
| + // |blob_receiver_|. |
| + BlobImageSerializationProcessor blob_image_processor_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(BlobManager); |
| +}; |
| + |
| +} // namespace client |
| +} // namespace blimp |
| + |
| +#endif // BLIMP_CLIENT_CORE_COMPOSITOR_BLOB_MANAGER_H_ |