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/grpc_client_transport.h" |
| 6 |
| 7 #include <queue> |
| 8 #include <string> |
| 9 #include <utility> |
| 10 |
| 11 #include "base/command_line.h" |
| 12 #include "base/memory/ptr_util.h" |
| 13 #include "base/synchronization/lock.h" |
| 14 #include "base/threading/thread_task_runner_handle.h" |
| 15 #include "blimp/common/logging.h" |
| 16 #include "blimp/common/proto/blimp_message.pb.h" |
| 17 #include "blimp/net/blimp_message_processor.h" |
| 18 #include "blimp/net/blimp_message_pump.h" |
| 19 #include "blimp/net/grpc_client_stream.h" |
| 20 #include "blimp/net/grpc_connection.h" |
| 21 #include "net/base/net_errors.h" |
| 22 |
| 23 namespace blimp { |
| 24 |
| 25 GrpcClientTransport::GrpcClientTransport( |
| 26 const AssignmentOptions& assignment_options) |
| 27 : BlimpTransport(), assignment_options_(assignment_options) {} |
| 28 |
| 29 void GrpcClientTransport::Connect(const net::CompletionCallback& callback) { |
| 30 grpc_connection_ = base::MakeUnique<GrpcConnection>( |
| 31 base::MakeUnique<GrpcClientStream>(assignment_options_, callback)); |
| 32 } |
| 33 |
| 34 std::unique_ptr<BlimpConnection> GrpcClientTransport::MakeConnection() { |
| 35 DVLOG(1) << "Grpc Client finished setup"; |
| 36 return std::move(grpc_connection_); |
| 37 } |
| 38 |
| 39 const char* GrpcClientTransport::GetName() const { |
| 40 return "GRPCClient"; |
| 41 } |
| 42 |
| 43 GrpcClientTransport::~GrpcClientTransport() {} |
| 44 |
| 45 } // namespace blimp |
OLD | NEW |