Chromium Code Reviews| 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) {} | |
|
Wez
2016/05/20 21:46:18
Is there no common no-op callback? e.g. what happe
Kevin M
2016/05/23 20:48:08
Can't find any no-op *completion callbacks*.
Runn
Wez
2016/05/24 01:18:40
*sadcodepanda*
| |
| 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_); | |
|
Wez
2016/05/20 21:46:18
nit: You're going to deref that later on, so you d
Kevin M
2016/05/23 20:48:08
Done.
| |
| 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); | |
|
Wez
2016/05/20 21:46:18
Don't return OK if it's not-implemented; if we fin
Kevin M
2016/05/23 20:48:08
Done.
| |
| 39 } | |
| 40 | |
| 41 } // namespace blimp | |
| OLD | NEW |