Skip to content

Commit

Permalink
Moved methods' impl to header for simplicity
Browse files Browse the repository at this point in the history
  • Loading branch information
dgquintas committed Aug 19, 2015
1 parent 690e010 commit 5fd6855
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
14 changes: 0 additions & 14 deletions test/cpp/interop/client_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
#include "test/core/security/oauth2_utils.h"
#include "test/cpp/util/create_test_channel.h"

#include "src/core/surface/call.h"
#include "src/cpp/client/secure_credentials.h"

DECLARE_bool(enable_ssl);
Expand Down Expand Up @@ -141,18 +140,5 @@ std::shared_ptr<ChannelInterface> CreateChannelForTestCase(
}
}

InteropClientContextInspector::InteropClientContextInspector(
const ::grpc::ClientContext& context)
: context_(context) {}

grpc_compression_algorithm
InteropClientContextInspector::GetCallCompressionAlgorithm() const {
return grpc_call_get_compression_algorithm(context_.call_);
}

gpr_uint32 InteropClientContextInspector::GetMessageFlags() const {
return grpc_call_get_message_flags(context_.call_);
}

} // namespace testing
} // namespace grpc
14 changes: 11 additions & 3 deletions test/cpp/interop/client_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
#include <grpc++/config.h>
#include <grpc++/channel_interface.h>

#include "src/core/surface/call.h"

namespace grpc {
namespace testing {

Expand All @@ -51,11 +53,17 @@ std::shared_ptr<ChannelInterface> CreateChannelForTestCase(

class InteropClientContextInspector {
public:
InteropClientContextInspector(const ::grpc::ClientContext& context);
InteropClientContextInspector(const ::grpc::ClientContext& context)
: context_(context) {}

// Inspector methods, able to peek inside ClientContext, follow.
grpc_compression_algorithm GetCallCompressionAlgorithm() const;
gpr_uint32 GetMessageFlags() const;
grpc_compression_algorithm GetCallCompressionAlgorithm() const {
return grpc_call_get_compression_algorithm(context_.call_);
}

gpr_uint32 GetMessageFlags() const {
return grpc_call_get_message_flags(context_.call_);
}

private:
const ::grpc::ClientContext& context_;
Expand Down

0 comments on commit 5fd6855

Please sign in to comment.