| Index: blimp/net/grpc_client_transport.h
|
| diff --git a/blimp/net/grpc_client_transport.h b/blimp/net/grpc_client_transport.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..4ba4a0abc9405fc8d80a50316ad89684842c74c0
|
| --- /dev/null
|
| +++ b/blimp/net/grpc_client_transport.h
|
| @@ -0,0 +1,50 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef BLIMP_NET_GRPC_CLIENT_TRANSPORT_H_
|
| +#define BLIMP_NET_GRPC_CLIENT_TRANSPORT_H_
|
| +
|
| +#include <memory>
|
| +#include <string>
|
| +
|
| +#include "base/callback.h"
|
| +#include "base/macros.h"
|
| +#include "blimp/common/public/session/assignment_options.h"
|
| +#include "blimp/net/blimp_net_export.h"
|
| +#include "blimp/net/blimp_transport.h"
|
| +#include "net/base/completion_callback.h"
|
| +
|
| +namespace grpc {
|
| +class Client;
|
| +}
|
| +
|
| +namespace blimp {
|
| +
|
| +class GrpcClientStream;
|
| +class GrpcConnection;
|
| +
|
| +// Class that interfaces a BlimpTransport to a GrpcClientStream through a
|
| +// GrpcConnection.
|
| +class BLIMP_NET_EXPORT GrpcClientTransport : public BlimpTransport {
|
| + public:
|
| + explicit GrpcClientTransport(const AssignmentOptions& assignment_options);
|
| +
|
| + // Creates and connects using the GrpcClientStream and calls |callback| on
|
| + // the IO thread on connection success.
|
| + void Connect(const net::CompletionCallback& callback) override;
|
| +
|
| + // Creates a new GrpcConnection and transfers ownership to caller.
|
| + std::unique_ptr<BlimpConnection> MakeConnection() override;
|
| +
|
| + const char* GetName() const override;
|
| + ~GrpcClientTransport() override;
|
| +
|
| + private:
|
| + AssignmentOptions assignment_options_;
|
| + std::unique_ptr<GrpcConnection> grpc_connection_;
|
| +};
|
| +
|
| +} // namespace blimp
|
| +
|
| +#endif // BLIMP_NET_GRPC_CLIENT_TRANSPORT_H_
|
|
|