aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cpp/common/channel_filter.h
diff options
context:
space:
mode:
authorGravatar Mark D. Roth <roth@google.com>2016-11-28 17:42:53 +0000
committerGravatar Mark D. Roth <roth@google.com>2016-11-28 17:42:53 +0000
commite85477646c5b6ec159715a7e8d9ebaaf6d451777 (patch)
treeb2535fb4f06b24e32d6688bdcd65294432bbde6b /src/cpp/common/channel_filter.h
parentc1087883579714691dc5cb3a66445da497c1a08c (diff)
Fix build problems.
Diffstat (limited to 'src/cpp/common/channel_filter.h')
-rw-r--r--src/cpp/common/channel_filter.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/cpp/common/channel_filter.h b/src/cpp/common/channel_filter.h
index e420efc71c..6bda74b9be 100644
--- a/src/cpp/common/channel_filter.h
+++ b/src/cpp/common/channel_filter.h
@@ -220,6 +220,9 @@ class ChannelData {
if (peer_) gpr_free((void *)peer_);
}
+ /// Initializes the call data.
+ virtual grpc_error *Init() { return GRPC_ERROR_NONE; }
+
/// Caller does NOT take ownership of result.
const char *peer() const { return peer_; }
@@ -276,15 +279,17 @@ class ChannelFilter final {
public:
static const size_t channel_data_size = sizeof(ChannelDataType);
- static void InitChannelElement(grpc_exec_ctx *exec_ctx,
- grpc_channel_element *elem,
- grpc_channel_element_args *args) {
+ static grpc_error *InitChannelElement(grpc_exec_ctx *exec_ctx,
+ grpc_channel_element *elem,
+ grpc_channel_element_args *args) {
const char *peer =
args->optional_transport
? grpc_transport_get_peer(exec_ctx, args->optional_transport)
: nullptr;
// Construct the object in the already-allocated memory.
- new (elem->channel_data) ChannelDataType(*args->channel_args, peer);
+ ChannelDataType* channel_data =
+ new (elem->channel_data) ChannelDataType(*args->channel_args, peer);
+ return channel_data->Init();
}
static void DestroyChannelElement(grpc_exec_ctx *exec_ctx,