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

Side by Side Diff: blimp/client/core/compositor/blob_manager.cc

Issue 2300493002: Move glue code of blob channel to blimp_client_context_impl. (Closed)
Patch Set: More polish on comments. 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 unified diff | Download patch
OLDNEW
(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 #include "blimp/client/core/compositor/blob_manager.h"
6 #include "blimp/common/blob_cache/in_memory_blob_cache.h"
7 #include "blimp/net/blob_channel/blob_channel_receiver.h"
8 #include "blimp/net/blob_channel/helium_blob_receiver_delegate.h"
9 #include "blimp/net/browser_connection_handler.h"
10
11 namespace blimp {
12 namespace client {
13
14 BlobManager::BlobManager(
15 BlobImageSerializationProcessor::ErrorDelegate* delegate) {
16 std::unique_ptr<HeliumBlobReceiverDelegate> blob_delegate =
17 base::MakeUnique<HeliumBlobReceiverDelegate>();
18
19 // Set incoming blob message processor.
20 incoming_msg_processor_ = blob_delegate.get();
21
22 // Set BlobChannelReceiver that does the actual blob processing.
23 blob_receiver_ = BlobChannelReceiver::Create(
24 base::WrapUnique(new InMemoryBlobCache), std::move(blob_delegate));
25 blob_image_processor_.set_blob_receiver(blob_receiver_.get());
26
27 // Set image decode error delegate.
28 DCHECK(delegate);
29 blob_image_processor_.set_error_delegate(delegate);
30 }
31
32 BlobManager::~BlobManager() {}
33
34 void BlobManager::ProcessMessage(std::unique_ptr<BlimpMessage> message,
35 const net::CompletionCallback& callback) {
36 DCHECK(incoming_msg_processor_);
37
38 // Forward the message to |incoming_msg_processor_|.
39 incoming_msg_processor_->ProcessMessage(std::move(message), callback);
40 }
41
42 } // namespace client
43 } // namespace blimp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698