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 #include "blimp/net/blob_channel/helium_blob_sender_delegate.h" |
| 6 |
| 7 #include "blimp/common/create_blimp_message.h" |
| 8 #include "blimp/common/proto/blimp_message.pb.h" |
| 9 #include "blimp/common/proto/blob_channel.pb.h" |
| 10 #include "net/base/net_errors.h" |
| 11 |
| 12 namespace blimp { |
| 13 namespace { |
| 14 |
| 15 void DoNothingCompletionCallback(int) {} |
| 16 |
| 17 } // namespace |
| 18 |
| 19 HeliumBlobSenderDelegate::HeliumBlobSenderDelegate() {} |
| 20 |
| 21 HeliumBlobSenderDelegate::~HeliumBlobSenderDelegate() {} |
| 22 |
| 23 void HeliumBlobSenderDelegate::DeliverBlob(const BlobId& id, BlobDataPtr data) { |
| 24 DCHECK(outgoing_processor_); |
| 25 |
| 26 std::unique_ptr<BlobChannelMessage> message(new BlobChannelMessage); |
| 27 message->set_type(BlobChannelMessage::TRANSFER_BLOB); |
| 28 message->set_payload(&data->data[0], data->data.size()); |
| 29 message->set_blob_id(id); |
| 30 outgoing_processor_->ProcessMessage(CreateBlimpMessage(std::move(message)), |
| 31 base::Bind(&DoNothingCompletionCallback)); |
| 32 } |
| 33 |
| 34 void HeliumBlobSenderDelegate::ProcessMessage( |
| 35 std::unique_ptr<BlimpMessage> message, |
| 36 const net::CompletionCallback& callback) { |
| 37 NOTIMPLEMENTED(); |
| 38 callback.Run(net::OK); |
| 39 } |
| 40 |
| 41 } // namespace blimp |
OLD | NEW |