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

Side by Side Diff: blimp/net/grpc_engine_transport.cc

Issue 2462183002: GRPC Stream implementation of HeliumStream
Patch Set: 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 unified diff | Download patch
OLDNEW
(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_engine_transport.h"
6
7 #include <queue>
8 #include <string>
9 #include <utility>
10
11 #include <grpc++/security/server_credentials.h>
12 #include <grpc++/server.h>
13 #include <grpc++/server_builder.h>
14 #include <grpc++/server_context.h>
15 #include <grpc/grpc.h>
16
17 #include "base/command_line.h"
18 #include "base/memory/ptr_util.h"
19 #include "base/synchronization/lock.h"
20 #include "base/threading/thread_task_runner_handle.h"
21 #include "blimp/common/logging.h"
22 #include "blimp/common/proto/blimp_message.pb.h"
23 #include "blimp/common/proto/helium_service.grpc.pb.h"
24 #include "blimp/net/blimp_message_processor.h"
25 #include "blimp/net/blimp_message_pump.h"
26 #include "blimp/net/grpc_connection.h"
27 #include "blimp/net/grpc_engine_stream.h"
28 #include "net/base/net_errors.h"
29
30 #include "content/public/browser/browser_thread.h"
31
32 namespace blimp {
33
34 GrpcEngineTransport::GrpcEngineTransport(const std::string& ip_address)
35 : BlimpEngineTransport(), ip_address_(ip_address) {
36 DVLOG(1) << "gRPC Engine Initialized @ " << ip_address;
37 }
38
39 void GrpcEngineTransport::Connect(const net::CompletionCallback& callback) {
40 grpc_connection_ = base::MakeUnique<GrpcConnection>(
41 base::MakeUnique<GrpcEngineStream>(ip_address_, callback));
42 }
43
44 std::unique_ptr<BlimpConnection> GrpcEngineTransport::MakeConnection() {
45 DVLOG(1) << "Grpc Engine finished setup";
46 return std::move(grpc_connection_);
47 }
48
49 const char* GrpcEngineTransport::GetName() const {
50 return "GRPC";
51 }
52
53 void GrpcEngineTransport::GetLocalAddress(net::IPEndPoint* address) const {
54 // DCHECK(server_socket_);
55 // server_socket_->GetLocalAddress(address);
56 }
57
58 GrpcEngineTransport::~GrpcEngineTransport() {}
59
60 } // namespace blimp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698