diff options
Diffstat (limited to 'src/cpp')
-rw-r--r-- | src/cpp/client/channel.cc | 8 | ||||
-rw-r--r-- | src/cpp/client/channel.h | 8 | ||||
-rw-r--r-- | src/cpp/client/credentials.cc | 2 | ||||
-rw-r--r-- | src/cpp/proto/proto_utils.cc | 6 | ||||
-rw-r--r-- | src/cpp/proto/proto_utils.h | 3 | ||||
-rw-r--r-- | src/cpp/server/async_server_context.cc | 3 | ||||
-rw-r--r-- | src/cpp/server/server_context_impl.cc | 4 | ||||
-rw-r--r-- | src/cpp/server/server_credentials.cc | 1 | ||||
-rw-r--r-- | src/cpp/server/server_rpc_handler.cc | 12 | ||||
-rw-r--r-- | src/cpp/stream/stream_context.cc | 3 | ||||
-rw-r--r-- | src/cpp/stream/stream_context.h | 13 | ||||
-rw-r--r-- | src/cpp/util/status.cc | 1 |
12 files changed, 33 insertions, 31 deletions
diff --git a/src/cpp/client/channel.cc b/src/cpp/client/channel.cc index bcda4ed40c..ddda8c22d6 100644 --- a/src/cpp/client/channel.cc +++ b/src/cpp/client/channel.cc @@ -172,10 +172,10 @@ Status Channel::StartBlockingRpc(const RpcMethod& method, return status; } -StreamContextInterface* Channel::CreateStream(const RpcMethod& method, - ClientContext* context, - const google::protobuf::Message* request, - google::protobuf::Message* result) { +StreamContextInterface* Channel::CreateStream( + const RpcMethod& method, ClientContext* context, + const google::protobuf::Message* request, + google::protobuf::Message* result) { grpc_call* call = grpc_channel_create_call( c_channel_, method.name(), target_.c_str(), context->RawDeadline()); context->set_call(call); diff --git a/src/cpp/client/channel.h b/src/cpp/client/channel.h index 621e58539b..8de1180ac2 100644 --- a/src/cpp/client/channel.h +++ b/src/cpp/client/channel.h @@ -58,10 +58,10 @@ class Channel : public ChannelInterface { const google::protobuf::Message& request, google::protobuf::Message* result) override; - StreamContextInterface* CreateStream(const RpcMethod& method, - ClientContext* context, - const google::protobuf::Message* request, - google::protobuf::Message* result) override; + StreamContextInterface* CreateStream( + const RpcMethod& method, ClientContext* context, + const google::protobuf::Message* request, + google::protobuf::Message* result) override; private: const grpc::string target_; diff --git a/src/cpp/client/credentials.cc b/src/cpp/client/credentials.cc index cac1d3d106..d81cf9f4d0 100644 --- a/src/cpp/client/credentials.cc +++ b/src/cpp/client/credentials.cc @@ -31,7 +31,6 @@ * */ - #include <string> #include <grpc/grpc_security.h> @@ -112,7 +111,6 @@ std::unique_ptr<Credentials> CredentialsFactory::IAMCredentials( return cpp_creds; } - // Combines two credentials objects into a composite credentials. std::unique_ptr<Credentials> CredentialsFactory::ComposeCredentials( const std::unique_ptr<Credentials>& creds1, diff --git a/src/cpp/proto/proto_utils.cc b/src/cpp/proto/proto_utils.cc index 255d1461a9..3b94dc3c07 100644 --- a/src/cpp/proto/proto_utils.cc +++ b/src/cpp/proto/proto_utils.cc @@ -40,7 +40,8 @@ namespace grpc { -bool SerializeProto(const google::protobuf::Message& msg, grpc_byte_buffer** bp) { +bool SerializeProto(const google::protobuf::Message& msg, + grpc_byte_buffer** bp) { grpc::string msg_str; bool success = msg.SerializeToString(&msg_str); if (success) { @@ -52,7 +53,8 @@ bool SerializeProto(const google::protobuf::Message& msg, grpc_byte_buffer** bp) return success; } -bool DeserializeProto(grpc_byte_buffer* buffer, google::protobuf::Message* msg) { +bool DeserializeProto(grpc_byte_buffer* buffer, + google::protobuf::Message* msg) { grpc::string msg_string; grpc_byte_buffer_reader* reader = grpc_byte_buffer_reader_create(buffer); gpr_slice slice; diff --git a/src/cpp/proto/proto_utils.h b/src/cpp/proto/proto_utils.h index 11471f1acb..ea472f9c51 100644 --- a/src/cpp/proto/proto_utils.h +++ b/src/cpp/proto/proto_utils.h @@ -46,7 +46,8 @@ namespace grpc { // Serialize the msg into a buffer created inside the function. The caller // should destroy the returned buffer when done with it. If serialization fails, // false is returned and buffer is left unchanged. -bool SerializeProto(const google::protobuf::Message& msg, grpc_byte_buffer** buffer); +bool SerializeProto(const google::protobuf::Message& msg, + grpc_byte_buffer** buffer); // The caller keeps ownership of buffer and msg. bool DeserializeProto(grpc_byte_buffer* buffer, google::protobuf::Message* msg); diff --git a/src/cpp/server/async_server_context.cc b/src/cpp/server/async_server_context.cc index f44678b569..298936dec9 100644 --- a/src/cpp/server/async_server_context.cc +++ b/src/cpp/server/async_server_context.cc @@ -48,8 +48,7 @@ AsyncServerContext::AsyncServerContext( host_(host), absolute_deadline_(absolute_deadline), request_(nullptr), - call_(call) { -} + call_(call) {} AsyncServerContext::~AsyncServerContext() { grpc_call_destroy(call_); } diff --git a/src/cpp/server/server_context_impl.cc b/src/cpp/server/server_context_impl.cc index 13f2a3ae1a..467cc80e05 100644 --- a/src/cpp/server/server_context_impl.cc +++ b/src/cpp/server/server_context_impl.cc @@ -33,6 +33,4 @@ #include "src/cpp/server/server_context_impl.h" -namespace grpc { - -} // namespace grpc +namespace grpc {} // namespace grpc diff --git a/src/cpp/server/server_credentials.cc b/src/cpp/server/server_credentials.cc index f9ca1622ba..5d899b1cd9 100644 --- a/src/cpp/server/server_credentials.cc +++ b/src/cpp/server/server_credentials.cc @@ -31,7 +31,6 @@ * */ - #include <grpc/grpc_security.h> #include <grpc++/server_credentials.h> diff --git a/src/cpp/server/server_rpc_handler.cc b/src/cpp/server/server_rpc_handler.cc index b7b29c2406..42f8b755b6 100644 --- a/src/cpp/server/server_rpc_handler.cc +++ b/src/cpp/server/server_rpc_handler.cc @@ -60,8 +60,10 @@ void ServerRpcHandler::StartRpc() { async_server_context_->Accept(cq_.cq()); // Allocate request and response. - std::unique_ptr<google::protobuf::Message> request(method_->AllocateRequestProto()); - std::unique_ptr<google::protobuf::Message> response(method_->AllocateResponseProto()); + std::unique_ptr<google::protobuf::Message> request( + method_->AllocateRequestProto()); + std::unique_ptr<google::protobuf::Message> response( + method_->AllocateResponseProto()); // Read request async_server_context_->StartRead(request.get()); @@ -86,8 +88,10 @@ void ServerRpcHandler::StartRpc() { } else { // Allocate request and response. // TODO(yangg) maybe not allocate both when not needed? - std::unique_ptr<google::protobuf::Message> request(method_->AllocateRequestProto()); - std::unique_ptr<google::protobuf::Message> response(method_->AllocateResponseProto()); + std::unique_ptr<google::protobuf::Message> request( + method_->AllocateRequestProto()); + std::unique_ptr<google::protobuf::Message> response( + method_->AllocateResponseProto()); StreamContext stream_context(*method_, async_server_context_->call(), cq_.cq(), request.get(), response.get()); diff --git a/src/cpp/stream/stream_context.cc b/src/cpp/stream/stream_context.cc index 6c424b937e..7936a30dfd 100644 --- a/src/cpp/stream/stream_context.cc +++ b/src/cpp/stream/stream_context.cc @@ -61,7 +61,8 @@ StreamContext::StreamContext(const RpcMethod& method, ClientContext* context, // Server only ctor StreamContext::StreamContext(const RpcMethod& method, grpc_call* call, grpc_completion_queue* cq, - google::protobuf::Message* request, google::protobuf::Message* result) + google::protobuf::Message* request, + google::protobuf::Message* result) : is_client_(false), method_(&method), call_(call), diff --git a/src/cpp/stream/stream_context.h b/src/cpp/stream/stream_context.h index 6c31095042..f70fe6daa3 100644 --- a/src/cpp/stream/stream_context.h +++ b/src/cpp/stream/stream_context.h @@ -51,7 +51,8 @@ class RpcMethod; class StreamContext : public StreamContextInterface { public: StreamContext(const RpcMethod& method, ClientContext* context, - const google::protobuf::Message* request, google::protobuf::Message* result); + const google::protobuf::Message* request, + google::protobuf::Message* result); StreamContext(const RpcMethod& method, grpc_call* call, grpc_completion_queue* cq, google::protobuf::Message* request, google::protobuf::Message* result); @@ -81,11 +82,11 @@ class StreamContext : public StreamContextInterface { grpc_completion_queue* cq() { return cq_; } bool is_client_; - const RpcMethod* method_; // not owned - grpc_call* call_; // not owned - grpc_completion_queue* cq_; // not owned - google::protobuf::Message* request_; // first request, not owned - google::protobuf::Message* result_; // last response, not owned + const RpcMethod* method_; // not owned + grpc_call* call_; // not owned + grpc_completion_queue* cq_; // not owned + google::protobuf::Message* request_; // first request, not owned + google::protobuf::Message* result_; // last response, not owned bool peer_halfclosed_; bool self_halfclosed_; diff --git a/src/cpp/util/status.cc b/src/cpp/util/status.cc index 66be26da07..e7ca41b752 100644 --- a/src/cpp/util/status.cc +++ b/src/cpp/util/status.cc @@ -31,7 +31,6 @@ * */ - #include <grpc++/status.h> namespace grpc { |