diff options
Diffstat (limited to 'src/core/lib/surface')
-rw-r--r-- | src/core/lib/surface/completion_queue.cc | 8 | ||||
-rw-r--r-- | src/core/lib/surface/server.cc | 24 |
2 files changed, 16 insertions, 16 deletions
diff --git a/src/core/lib/surface/completion_queue.cc b/src/core/lib/surface/completion_queue.cc index aa5808da4c..e3eef6ca50 100644 --- a/src/core/lib/surface/completion_queue.cc +++ b/src/core/lib/surface/completion_queue.cc @@ -780,10 +780,11 @@ typedef struct { bool first_loop; } cq_is_finished_arg; -class ExecCtxNext : public grpc_core::ExecCtx { +class ExecCtxNext final : public grpc_core::ExecCtx { public: ExecCtxNext(void* arg) : ExecCtx(0), check_ready_to_finish_arg_(arg) {} + private: bool CheckReadyToFinish() override { cq_is_finished_arg* a = (cq_is_finished_arg*)check_ready_to_finish_arg_; grpc_completion_queue* cq = a->cq; @@ -811,7 +812,6 @@ class ExecCtxNext : public grpc_core::ExecCtx { return !a->first_loop && a->deadline < grpc_core::ExecCtx::Get()->Now(); } - private: void* check_ready_to_finish_arg_; }; @@ -1035,10 +1035,11 @@ static void del_plucker(grpc_completion_queue* cq, void* tag, GPR_UNREACHABLE_CODE(return ); } -class ExecCtxPluck : public grpc_core::ExecCtx { +class ExecCtxPluck final : public grpc_core::ExecCtx { public: ExecCtxPluck(void* arg) : ExecCtx(0), check_ready_to_finish_arg_(arg) {} + private: bool CheckReadyToFinish() override { cq_is_finished_arg* a = (cq_is_finished_arg*)check_ready_to_finish_arg_; grpc_completion_queue* cq = a->cq; @@ -1072,7 +1073,6 @@ class ExecCtxPluck : public grpc_core::ExecCtx { return !a->first_loop && a->deadline < grpc_core::ExecCtx::Get()->Now(); } - private: void* check_ready_to_finish_arg_; }; diff --git a/src/core/lib/surface/server.cc b/src/core/lib/surface/server.cc index f1d428f0a1..ee98cf2693 100644 --- a/src/core/lib/surface/server.cc +++ b/src/core/lib/surface/server.cc @@ -44,24 +44,23 @@ #include "src/core/lib/transport/metadata.h" #include "src/core/lib/transport/static_metadata.h" -typedef struct listener { +grpc_core::TraceFlag grpc_server_channel_trace(false, "server_channel"); + +namespace { +struct listener { void* arg; void (*start)(grpc_server* server, void* arg, grpc_pollset** pollsets, size_t pollset_count); void (*destroy)(grpc_server* server, void* arg, grpc_closure* closure); struct listener* next; grpc_closure destroy_done; -} listener; +}; -typedef struct call_data call_data; -typedef struct channel_data channel_data; -typedef struct registered_method registered_method; +enum requested_call_type { BATCH_CALL, REGISTERED_CALL }; -typedef enum { BATCH_CALL, REGISTERED_CALL } requested_call_type; +struct registered_method; -grpc_core::TraceFlag grpc_server_channel_trace(false, "server_channel"); - -typedef struct requested_call { +struct requested_call { gpr_mpscq_node request_link; /* must be first */ requested_call_type type; size_t cq_idx; @@ -81,15 +80,15 @@ typedef struct requested_call { grpc_byte_buffer** optional_payload; } registered; } data; -} requested_call; +}; -typedef struct channel_registered_method { +struct channel_registered_method { registered_method* server_registered_method; uint32_t flags; bool has_host; grpc_slice method; grpc_slice host; -} channel_registered_method; +}; struct channel_data { grpc_server* server; @@ -176,6 +175,7 @@ typedef struct { grpc_channel** channels; size_t num_channels; } channel_broadcaster; +} // namespace struct grpc_server { grpc_channel_args* channel_args; |