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 #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 |
| 25 // A |BlimpConnection| that wraps around a |GrpcClientStream| or a |
| 26 // |GrpcEngineStream| converting |HeliumWrapper| to/from |BlimpMessage|. This is |
| 27 // an interim solution until we have the full Helium protocol in place. It still |
| 28 // uses the actual |HeliumStream| interfaces to talk to the gRPC layer so the |
| 29 // actual code in those gRPC-related classes will outlive this class. |
| 30 class BLIMP_NET_EXPORT GrpcConnection : public BlimpConnection { |
| 31 public: |
| 32 explicit GrpcConnection(std::unique_ptr<GrpcStream> stream_delegate); |
| 33 ~GrpcConnection() override; |
| 34 |
| 35 BlimpMessageProcessor* GetOutgoingMessageProcessor() override; |
| 36 void SetIncomingMessageProcessor(BlimpMessageProcessor* processor) override; |
| 37 |
| 38 |
| 39 private: |
| 40 std::unique_ptr<GrpcStream> stream_; |
| 41 |
| 42 // Forwarders that convert from |BlimpMessage|s to |HeliumMessage|s (and vice |
| 43 // versa). |
| 44 std::unique_ptr<GrpcOutgoingForwarder> outgoing_forwarder_; |
| 45 std::unique_ptr<GrpcIncomingForwarder> incoming_forwarder_; |
| 46 }; |
| 47 |
| 48 } // namespace blimp |
| 49 |
| 50 #endif // BLIMP_NET_GRPC_CONNECTION_H_ |
OLD | NEW |