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

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

Issue 2632803002: Remove all blimp network code. (Closed)
Patch Set: merge from origin/master for good measure Created 3 years, 11 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_receiver_delegate.cc
diff --git a/blimp/net/blob_channel/helium_blob_receiver_delegate.cc b/blimp/net/blob_channel/helium_blob_receiver_delegate.cc
deleted file mode 100644
index b433b79e3b0f2d6f08f47ca136c07b9c59cab1cc..0000000000000000000000000000000000000000
--- a/blimp/net/blob_channel/helium_blob_receiver_delegate.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-// 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_receiver_delegate.h"
-
-#include "blimp/common/blob_cache/blob_cache.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 {
-
-HeliumBlobReceiverDelegate::HeliumBlobReceiverDelegate() {}
-
-HeliumBlobReceiverDelegate::~HeliumBlobReceiverDelegate() {}
-
-void HeliumBlobReceiverDelegate::SetReceiver(BlobChannelReceiver* receiver) {
- DCHECK(receiver);
- receiver_ = receiver;
-}
-
-void HeliumBlobReceiverDelegate::ProcessMessage(
- std::unique_ptr<BlimpMessage> message,
- const net::CompletionCallback& callback) {
- if (!message->has_blob_channel()) {
- DLOG(WARNING) << "BlobChannel message has no |blob_channel| submessage.";
- callback.Run(net::ERR_INVALID_ARGUMENT);
- return;
- }
-
- // Take a mutable pointer to the blob_channel message so that we can re-use
- // its allocated buffers.
- BlobChannelMessage* blob_msg = message->mutable_blob_channel();
- if (blob_msg->type_case() != BlobChannelMessage::TypeCase::kTransferBlob) {
- callback.Run(net::ERR_NOT_IMPLEMENTED);
- return;
- }
-
- if (blob_msg->transfer_blob().blob_id().empty()) {
- callback.Run(net::ERR_INVALID_ARGUMENT);
- return;
- }
-
- // Create a temporarily non-const BlobData so that we may efficiently reuse
- // the allocated payload string via string::swap().
- scoped_refptr<BlobData> blob_data(new BlobData);
- blob_data->data.swap(*blob_msg->mutable_transfer_blob()->mutable_payload());
- receiver_->OnBlobReceived(blob_msg->transfer_blob().blob_id(), blob_data);
-
- callback.Run(net::OK);
-}
-
-} // namespace blimp
« no previous file with comments | « blimp/net/blob_channel/helium_blob_receiver_delegate.h ('k') | blimp/net/blob_channel/helium_blob_sender_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698