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

Side by Side Diff: blimp/net/grpc_connection.h

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 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 #ifndef BLIMP_NET_GRPC_CONNECTION_H_
6 #define BLIMP_NET_GRPC_CONNECTION_H_
7
8 #include <memory>
9
10 #include "base/macros.h"
11
12 #include "blimp/net/blimp_connection.h"
13 #include "blimp/net/blimp_net_export.h"
14
15 namespace blimp {
16
17 class BlimpMessage;
18 class BlimpMessageProcessor;
19 class GrpcIncomingForwarder;
20 class GrpcOutgoingForwarder;
21 class GrpcStream;
22
23 // TODO(perumaal): Remove this class after Helium transport layer is setup.
24 // A |BlimpConnection| that wraps around a |GrpcClientStream| or a
25 // |GrpcEngineStream| converting |HeliumMessage| to/from |BlimpMessage|. This is
26 // an interim solution until we have the full Helium protocol in place. It still
27 // uses the actual |HeliumStream| interfaces to talk to the gRPC layer so the
28 // actual code in those gRPC-related classes will outlive this class.
29 class BLIMP_NET_EXPORT GrpcConnection : public BlimpConnection {
30 public:
31 explicit GrpcConnection(std::unique_ptr<GrpcStream> stream_delegate);
32 BlimpMessageProcessor* GetOutgoingMessageProcessor() override;
33 void SetIncomingMessageProcessor(BlimpMessageProcessor* processor) override;
34 ~GrpcConnection() override;
35
36 private:
37 std::unique_ptr<GrpcStream> stream_;
38
39 // Forwarders that convert from |BlimpMessage|s to |HeliumMessage|s (and vice
40 // versa).
41 std::unique_ptr<GrpcOutgoingForwarder> outgoing_forwarder_;
42 std::unique_ptr<GrpcIncomingForwarder> incoming_forwarder_;
43 };
44
45 } // namespace blimp
46
47 #endif // BLIMP_NET_GRPC_CONNECTION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698