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

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: wez 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..ac18fcfc4b3e477da979c84804c1ab2fd59002ad
--- /dev/null
+++ b/blimp/net/blob_channel/helium_blob_sender_delegate.cc
@@ -0,0 +1,40 @@
+// 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) {}
+
+} // namespace
+
+HeliumBlobSenderDelegate::HeliumBlobSenderDelegate() {}
+
+HeliumBlobSenderDelegate::~HeliumBlobSenderDelegate() {}
+
+void HeliumBlobSenderDelegate::DeliverBlob(const BlobId& id, BlobDataPtr data) {
+ BlobChannelMessage* blob_message;
+ std::unique_ptr<BlimpMessage> message = CreateBlimpMessage(&blob_message);
+ blob_message->mutable_transfer_blob()->set_payload(&data->data[0],
+ data->data.size());
+ blob_message->mutable_transfer_blob()->set_blob_id(id);
+ outgoing_processor_->ProcessMessage(std::move(message),
+ base::Bind(&DoNothingCompletionCallback));
+}
+
+void HeliumBlobSenderDelegate::ProcessMessage(
+ std::unique_ptr<BlimpMessage> message,
+ const net::CompletionCallback& callback) {
+ NOTIMPLEMENTED();
+ callback.Run(net::ERR_NOT_IMPLEMENTED);
+}
+
+} // namespace blimp

Powered by Google App Engine
This is Rietveld 408576698