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

Side by Side Diff: blimp/net/grpc_client_transport.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_CLIENT_TRANSPORT_H_
6 #define BLIMP_NET_GRPC_CLIENT_TRANSPORT_H_
7
8 #include <memory>
9 #include <string>
10
11 #include "base/callback.h"
12 #include "base/macros.h"
13 #include "blimp/common/assignment_options.h"
14 #include "blimp/net/blimp_net_export.h"
15 #include "blimp/net/blimp_transport.h"
16 #include "net/base/completion_callback.h"
17
18 namespace grpc {
19 class Client;
20 }
21
22 namespace blimp {
23
24 class GrpcClientStream;
25 class GrpcConnection;
26
27 // Class that interfaces a |BlimpTransport| to a |GrpcClientStream| through a
28 // |GrpcConnection|.
29 class BLIMP_NET_EXPORT GrpcClientTransport : public BlimpTransport {
30 public:
31 // Creates a new |GrpcClientStream| based on the given assignment options.
32 explicit GrpcClientTransport(const AssignmentOptions& assignment_options);
33
34 // Connects using the |GrpcClientStream| and calls |callback| on the IO
35 // thread on connection success.
36 void Connect(const net::CompletionCallback& callback) override;
37
38 // Creates a new |GrpcConnection| and transfers ownership to caller.
39 std::unique_ptr<BlimpConnection> MakeConnection() override;
40
41 const char* GetName() const override;
42 ~GrpcClientTransport() override;
43
44 private:
45 AssignmentOptions assignment_options_;
46 std::unique_ptr<GrpcConnection> grpc_connection_;
47 };
48
49 } // namespace blimp
50
51 #endif // BLIMP_NET_GRPC_CLIENT_TRANSPORT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698