Chromium Code Reviews| 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 "base/macros.h" | |
| 9 | |
| 10 #include "blimp/net/blimp_connection.h" | |
| 11 #include "blimp/net/blimp_message_processor.h" | |
| 12 | |
| 13 namespace blimp { | |
| 14 | |
| 15 using BlimpMessageData = base::RefCountedData<BlimpMessage>; | |
| 16 class GrpcIncomingForwarder; | |
| 17 class GrpcOutgoingForwarder; | |
| 18 class GrpcStream; | |
| 19 | |
| 20 // TODO(perumaal): Remove this class after Helium transport layer is setup. | |
| 21 class GrpcConnection : public BlimpConnection { | |
| 22 public: | |
| 23 explicit GrpcConnection(std::unique_ptr<GrpcStream> stream_delegate); | |
| 24 | |
| 25 BlimpMessageProcessor* GetOutgoingMessageProcessor() override; | |
| 26 | |
| 27 void SetIncomingMessageProcessor(BlimpMessageProcessor* processor) override; | |
| 28 | |
| 29 ~GrpcConnection() override; | |
| 30 | |
| 31 private: | |
| 32 std::unique_ptr<GrpcStream> stream_; | |
| 33 | |
| 34 // Forwarders that convert from |BlimpMessage|s to |HeliumMessage|s (and vice | |
|
Kevin M
2016/10/31 21:33:25
converting => wrapping?
| |
| 35 // versa). | |
| 36 std::unique_ptr<GrpcOutgoingForwarder> outgoing_forwarder_; | |
| 37 std::unique_ptr<GrpcIncomingForwarder> incoming_forwarder_; | |
| 38 }; | |
| 39 | |
| 40 } // namespace blimp | |
| 41 | |
| 42 #endif // BLIMP_NET_GRPC_CONNECTION_H_ | |
| OLD | NEW |