diff options
author | Yang Gao <yangg@google.com> | 2015-03-03 09:48:06 -0800 |
---|---|---|
committer | Yang Gao <yangg@google.com> | 2015-03-03 09:48:06 -0800 |
commit | 7694c35d5f9c85ea844755d35f7d78d76e38348c (patch) | |
tree | e34309aa27b3519ed4885454751c1a1e50735a52 /src | |
parent | 4e233a1a4653699bda751ef38923c7d755093d2c (diff) |
Global replace google::protobuf::Message with grpc::protobuf::Message, all tests passed
Diffstat (limited to 'src')
-rw-r--r-- | src/cpp/client/client_unary_call.cc | 4 | ||||
-rw-r--r-- | src/cpp/common/call.cc | 4 | ||||
-rw-r--r-- | src/cpp/proto/proto_utils.cc | 4 | ||||
-rw-r--r-- | src/cpp/proto/proto_utils.h | 11 | ||||
-rw-r--r-- | src/cpp/server/async_server_context.cc | 4 | ||||
-rw-r--r-- | src/cpp/server/server.cc | 10 |
6 files changed, 17 insertions, 20 deletions
diff --git a/src/cpp/client/client_unary_call.cc b/src/cpp/client/client_unary_call.cc index 684b3cbadb..5c179de9d8 100644 --- a/src/cpp/client/client_unary_call.cc +++ b/src/cpp/client/client_unary_call.cc @@ -44,8 +44,8 @@ namespace grpc { // Wrapper that performs a blocking unary call Status BlockingUnaryCall(ChannelInterface *channel, const RpcMethod &method, ClientContext *context, - const google::protobuf::Message &request, - google::protobuf::Message *result) { + const grpc::protobuf::Message &request, + grpc::protobuf::Message *result) { CompletionQueue cq; Call call(channel->CreateCall(method, context, &cq)); CallOpBuffer buf; diff --git a/src/cpp/common/call.cc b/src/cpp/common/call.cc index f3a691114d..b2b6c62785 100644 --- a/src/cpp/common/call.cc +++ b/src/cpp/common/call.cc @@ -163,11 +163,11 @@ void CallOpBuffer::AddSendInitialMetadata(ClientContext* ctx) { AddSendInitialMetadata(&ctx->send_initial_metadata_); } -void CallOpBuffer::AddSendMessage(const google::protobuf::Message& message) { +void CallOpBuffer::AddSendMessage(const grpc::protobuf::Message& message) { send_message_ = &message; } -void CallOpBuffer::AddRecvMessage(google::protobuf::Message* message) { +void CallOpBuffer::AddRecvMessage(grpc::protobuf::Message* message) { recv_message_ = message; recv_message_->Clear(); } diff --git a/src/cpp/proto/proto_utils.cc b/src/cpp/proto/proto_utils.cc index 69a6bb080e..e6badd5d6e 100644 --- a/src/cpp/proto/proto_utils.cc +++ b/src/cpp/proto/proto_utils.cc @@ -40,7 +40,7 @@ namespace grpc { -bool SerializeProto(const google::protobuf::Message &msg, +bool SerializeProto(const grpc::protobuf::Message &msg, grpc_byte_buffer **bp) { grpc::string msg_str; bool success = msg.SerializeToString(&msg_str); @@ -54,7 +54,7 @@ bool SerializeProto(const google::protobuf::Message &msg, } bool DeserializeProto(grpc_byte_buffer *buffer, - google::protobuf::Message *msg) { + grpc::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 a0af4d6465..7a1b1f8b7c 100644 --- a/src/cpp/proto/proto_utils.h +++ b/src/cpp/proto/proto_utils.h @@ -34,23 +34,20 @@ #ifndef GRPC_INTERNAL_CPP_PROTO_PROTO_UTILS_H #define GRPC_INTERNAL_CPP_PROTO_PROTO_UTILS_H +#include <grpc++/config.h> + struct grpc_byte_buffer; -namespace google { -namespace protobuf { -class Message; -} -} 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, +bool SerializeProto(const grpc::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); +bool DeserializeProto(grpc_byte_buffer *buffer, grpc::protobuf::Message *msg); } // namespace grpc diff --git a/src/cpp/server/async_server_context.cc b/src/cpp/server/async_server_context.cc index 5f8c2ba10f..bee75497b8 100644 --- a/src/cpp/server/async_server_context.cc +++ b/src/cpp/server/async_server_context.cc @@ -58,14 +58,14 @@ void AsyncServerContext::Accept(grpc_completion_queue *cq) { call_, GRPC_WRITE_BUFFER_HINT) == GRPC_CALL_OK); } -bool AsyncServerContext::StartRead(google::protobuf::Message *request) { +bool AsyncServerContext::StartRead(grpc::protobuf::Message *request) { GPR_ASSERT(request); request_ = request; grpc_call_error err = grpc_call_start_read_old(call_, this); return err == GRPC_CALL_OK; } -bool AsyncServerContext::StartWrite(const google::protobuf::Message &response, +bool AsyncServerContext::StartWrite(const grpc::protobuf::Message &response, int flags) { grpc_byte_buffer *buffer = nullptr; if (!SerializeProto(response, &buffer)) { diff --git a/src/cpp/server/server.cc b/src/cpp/server/server.cc index 97bf0f1a6e..17b97f6ecf 100644 --- a/src/cpp/server/server.cc +++ b/src/cpp/server/server.cc @@ -117,8 +117,8 @@ class Server::SyncRequest GRPC_FINAL : public CompletionQueueTag { } void Run() { - std::unique_ptr<google::protobuf::Message> req; - std::unique_ptr<google::protobuf::Message> res; + std::unique_ptr<grpc::protobuf::Message> req; + std::unique_ptr<grpc::protobuf::Message> res; if (has_request_payload_) { req.reset(method_->AllocateRequestProto()); if (!DeserializeProto(request_payload_, req.get())) { @@ -298,7 +298,7 @@ void Server::PerformOpsOnCall(CallOpBuffer* buf, Call* call) { class Server::AsyncRequest GRPC_FINAL : public CompletionQueueTag { public: AsyncRequest(Server* server, void* registered_method, ServerContext* ctx, - ::google::protobuf::Message* request, + grpc::protobuf::Message* request, ServerAsyncStreamingInterface* stream, CompletionQueue* cq, void* tag) : tag_(tag), @@ -352,7 +352,7 @@ class Server::AsyncRequest GRPC_FINAL : public CompletionQueueTag { private: void* const tag_; - ::google::protobuf::Message* const request_; + grpc::protobuf::Message* const request_; ServerAsyncStreamingInterface* const stream_; CompletionQueue* const cq_; ServerContext* const ctx_; @@ -364,7 +364,7 @@ class Server::AsyncRequest GRPC_FINAL : public CompletionQueueTag { }; void Server::RequestAsyncCall(void* registered_method, ServerContext* context, - ::google::protobuf::Message* request, + grpc::protobuf::Message* request, ServerAsyncStreamingInterface* stream, CompletionQueue* cq, void* tag) { new AsyncRequest(this, registered_method, context, request, stream, cq, tag); |