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

Unified Diff: blimp/net/blob_channel/helium_blob_sender_delegate.cc

Issue 1970463004: Blimp: Add BlobChannel Helium messages and delegate impls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: haibinlu feedback Created 4 years, 7 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/net/blob_channel/helium_blob_sender_delegate.cc
diff --git a/blimp/net/blob_channel/helium_blob_sender_delegate.cc b/blimp/net/blob_channel/helium_blob_sender_delegate.cc
new file mode 100644
index 0000000000000000000000000000000000000000..7f4fc9d215f2f34aa01fead8fb2758845b2b8e43
--- /dev/null
+++ b/blimp/net/blob_channel/helium_blob_sender_delegate.cc
@@ -0,0 +1,41 @@
+// 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/net/blob_channel/helium_blob_sender_delegate.h"
+
+#include "blimp/common/create_blimp_message.h"
+#include "blimp/common/proto/blimp_message.pb.h"
+#include "blimp/common/proto/blob_channel.pb.h"
+#include "net/base/net_errors.h"
+
+namespace blimp {
+namespace {
+
+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*
+
+} // namespace
+
+HeliumBlobSenderDelegate::HeliumBlobSenderDelegate() {}
+
+HeliumBlobSenderDelegate::~HeliumBlobSenderDelegate() {}
+
+void HeliumBlobSenderDelegate::DeliverBlob(const BlobId& id, BlobDataPtr data) {
+ 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.
+
+ std::unique_ptr<BlobChannelMessage> message(new BlobChannelMessage);
+ message->set_type(BlobChannelMessage::TRANSFER_BLOB);
+ message->set_payload(&data->data[0], data->data.size());
+ message->set_blob_id(id);
+ outgoing_processor_->ProcessMessage(CreateBlimpMessage(std::move(message)),
+ base::Bind(&DoNothingCompletionCallback));
+}
+
+void HeliumBlobSenderDelegate::ProcessMessage(
+ std::unique_ptr<BlimpMessage> message,
+ const net::CompletionCallback& callback) {
+ NOTIMPLEMENTED();
+ 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.
+}
+
+} // namespace blimp

Powered by Google App Engine
This is Rietveld 408576698