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

Unified Diff: blimp/net/grpc_client_transport.cc

Issue 2462183002: GRPC Stream implementation of HeliumStream
Patch Set: Fixed a few minor comments Created 4 years, 1 month 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/grpc_client_transport.cc
diff --git a/blimp/net/grpc_client_transport.cc b/blimp/net/grpc_client_transport.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b8270c1c38d46b827132057184ed0333688fef8a
--- /dev/null
+++ b/blimp/net/grpc_client_transport.cc
@@ -0,0 +1,45 @@
+// 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/grpc_client_transport.h"
+
+#include <queue>
+#include <string>
+#include <utility>
+
+#include "base/command_line.h"
+#include "base/memory/ptr_util.h"
+#include "base/synchronization/lock.h"
+#include "base/threading/thread_task_runner_handle.h"
+#include "blimp/common/logging.h"
+#include "blimp/common/proto/blimp_message.pb.h"
+#include "blimp/net/blimp_message_processor.h"
+#include "blimp/net/blimp_message_pump.h"
+#include "blimp/net/grpc_client_stream.h"
+#include "blimp/net/grpc_connection.h"
+#include "net/base/net_errors.h"
+
+namespace blimp {
+
+GrpcClientTransport::GrpcClientTransport(
+ const AssignmentOptions& assignment_options)
+ : BlimpTransport(), assignment_options_(assignment_options) {}
+
+void GrpcClientTransport::Connect(const net::CompletionCallback& callback) {
+ grpc_connection_ = base::MakeUnique<GrpcConnection>(
+ base::MakeUnique<GrpcClientStream>(assignment_options_, callback));
+}
+
+std::unique_ptr<BlimpConnection> GrpcClientTransport::MakeConnection() {
+ DVLOG(1) << "Grpc Client finished setup";
+ return std::move(grpc_connection_);
+}
+
+const char* GrpcClientTransport::GetName() const {
+ return "GRPCClient";
+}
+
+GrpcClientTransport::~GrpcClientTransport() {}
+
+} // namespace blimp

Powered by Google App Engine
This is Rietveld 408576698