Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1163)

Unified Diff: blimp/client/core/compositor/blob_channel_feature.cc

Issue 2300493002: Move glue code of blob channel to blimp_client_context_impl. (Closed)
Patch Set: Merge conflicts. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: blimp/client/core/compositor/blob_channel_feature.cc
diff --git a/blimp/client/core/compositor/blob_channel_feature.cc b/blimp/client/core/compositor/blob_channel_feature.cc
new file mode 100644
index 0000000000000000000000000000000000000000..65d8ee289978cb953ddf8a4f460d3c184a4b378e
--- /dev/null
+++ b/blimp/client/core/compositor/blob_channel_feature.cc
@@ -0,0 +1,45 @@
+// 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.
+
+#include "blimp/client/core/compositor/blob_channel_feature.h"
+
+#include "blimp/common/blob_cache/in_memory_blob_cache.h"
+#include "blimp/common/proto/blimp_message.pb.h"
+#include "blimp/net/blob_channel/blob_channel_receiver.h"
+#include "blimp/net/blob_channel/helium_blob_receiver_delegate.h"
+
+namespace blimp {
+namespace client {
+
+BlobChannelFeature::BlobChannelFeature(
+ BlobImageSerializationProcessor::ErrorDelegate* delegate) {
+ std::unique_ptr<HeliumBlobReceiverDelegate> blob_delegate =
+ base::MakeUnique<HeliumBlobReceiverDelegate>();
+
+ // Set incoming blob message processor.
+ incoming_msg_processor_ = blob_delegate.get();
+
+ // Set BlobChannelReceiver that does the actual blob processing.
+ blob_receiver_ = BlobChannelReceiver::Create(
+ base::MakeUnique<InMemoryBlobCache>(), std::move(blob_delegate));
+ blob_image_processor_.set_blob_receiver(blob_receiver_.get());
+
+ // Set image decode error delegate.
+ DCHECK(delegate);
+ blob_image_processor_.set_error_delegate(delegate);
+}
+
+BlobChannelFeature::~BlobChannelFeature() = default;
+
+void BlobChannelFeature::ProcessMessage(
+ std::unique_ptr<BlimpMessage> message,
+ const net::CompletionCallback& callback) {
+ DCHECK(incoming_msg_processor_);
+
+ // Forward the message to |incoming_msg_processor_|.
+ incoming_msg_processor_->ProcessMessage(std::move(message), callback);
+}
+
+} // namespace client
+} // namespace blimp
« no previous file with comments | « blimp/client/core/compositor/blob_channel_feature.h ('k') | blimp/client/core/compositor/blob_channel_feature_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698