interceptor_common.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2018 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 #ifndef GRPCPP_IMPL_CODEGEN_INTERCEPTOR_COMMON_H
20 #define GRPCPP_IMPL_CODEGEN_INTERCEPTOR_COMMON_H
21 
22 // IWYU pragma: private
23 
24 #include <array>
25 #include <functional>
26 
33 
34 namespace grpc {
35 namespace internal {
36 
39  public:
41  for (auto i = static_cast<experimental::InterceptionHookPoints>(0);
44  static_cast<size_t>(i) + 1)) {
45  hooks_[static_cast<size_t>(i)] = false;
46  }
47  }
48 
50 
53  return hooks_[static_cast<size_t>(type)];
54  }
55 
56  void Proceed() override {
57  if (call_->client_rpc_info() != nullptr) {
58  return ProceedClient();
59  }
61  ProceedServer();
62  }
63 
64  void Hijack() override {
65  // Only the client can hijack when sending down initial metadata
66  GPR_CODEGEN_ASSERT(!reverse_ && ops_ != nullptr &&
67  call_->client_rpc_info() != nullptr);
68  // It is illegal to call Hijack twice
70  auto* rpc_info = call_->client_rpc_info();
71  rpc_info->hijacked_ = true;
72  rpc_info->hijacked_interceptor_ = current_interceptor_index_;
76  rpc_info->RunInterceptor(this, current_interceptor_index_);
77  }
78 
80  hooks_[static_cast<size_t>(type)] = true;
81  }
82 
85  if (*orig_send_message_ != nullptr) {
86  GPR_CODEGEN_ASSERT(serializer_(*orig_send_message_).ok());
87  *orig_send_message_ = nullptr;
88  }
89  return send_message_;
90  }
91 
92  const void* GetSendMessage() override {
94  return *orig_send_message_;
95  }
96 
97  void ModifySendMessage(const void* message) override {
100  }
101 
102  bool GetSendMessageStatus() override { return !*fail_send_message_; }
103 
104  std::multimap<std::string, std::string>* GetSendInitialMetadata() override {
105  return send_initial_metadata_;
106  }
107 
108  Status GetSendStatus() override {
109  return Status(static_cast<StatusCode>(*code_), *error_message_,
110  *error_details_);
111  }
112 
113  void ModifySendStatus(const Status& status) override {
114  *code_ = static_cast<grpc_status_code>(status.error_code());
115  *error_details_ = status.error_details();
116  *error_message_ = status.error_message();
117  }
118 
119  std::multimap<std::string, std::string>* GetSendTrailingMetadata() override {
121  }
122 
123  void* GetRecvMessage() override { return recv_message_; }
124 
125  std::multimap<grpc::string_ref, grpc::string_ref>* GetRecvInitialMetadata()
126  override {
127  return recv_initial_metadata_->map();
128  }
129 
130  Status* GetRecvStatus() override { return recv_status_; }
131 
132  void FailHijackedSendMessage() override {
133  GPR_CODEGEN_ASSERT(hooks_[static_cast<size_t>(
135  *fail_send_message_ = true;
136  }
137 
138  std::multimap<grpc::string_ref, grpc::string_ref>* GetRecvTrailingMetadata()
139  override {
140  return recv_trailing_metadata_->map();
141  }
142 
143  void SetSendMessage(ByteBuffer* buf, const void** msg,
144  bool* fail_send_message,
145  std::function<Status(const void*)> serializer) {
146  send_message_ = buf;
148  fail_send_message_ = fail_send_message;
149  serializer_ = serializer;
150  }
151 
153  std::multimap<std::string, std::string>* metadata) {
155  }
156 
158  std::string* error_message) {
159  code_ = code;
160  error_details_ = error_details;
161  error_message_ = error_message;
162  }
163 
165  std::multimap<std::string, std::string>* metadata) {
167  }
168 
169  void SetRecvMessage(void* message, bool* hijacked_recv_message_failed) {
171  hijacked_recv_message_failed_ = hijacked_recv_message_failed;
172  }
173 
176  }
177 
179 
182  }
183 
184  std::unique_ptr<ChannelInterface> GetInterceptedChannel() override {
185  auto* info = call_->client_rpc_info();
186  if (info == nullptr) {
187  return std::unique_ptr<ChannelInterface>(nullptr);
188  }
189  // The intercepted channel starts from the interceptor just after the
190  // current interceptor
191  return std::unique_ptr<ChannelInterface>(new InterceptedChannel(
192  info->channel(), current_interceptor_index_ + 1));
193  }
194 
195  void FailHijackedRecvMessage() override {
196  GPR_CODEGEN_ASSERT(hooks_[static_cast<size_t>(
199  }
200 
201  // Clears all state
202  void ClearState() {
203  reverse_ = false;
205  ClearHookPoints();
206  }
207 
208  // Prepares for Post_recv operations
209  void SetReverse() {
210  reverse_ = true;
212  ClearHookPoints();
213  }
214 
215  // This needs to be set before interceptors are run
216  void SetCall(Call* call) { call_ = call; }
217 
218  // This needs to be set before interceptors are run using RunInterceptors().
219  // Alternatively, RunInterceptors(std::function<void(void)> f) can be used.
221 
222  // SetCall should have been called before this.
223  // Returns true if the interceptors list is empty
225  auto* client_rpc_info = call_->client_rpc_info();
226  if (client_rpc_info != nullptr) {
227  return client_rpc_info->interceptors_.empty();
228  }
229 
230  auto* server_rpc_info = call_->server_rpc_info();
231  return server_rpc_info == nullptr || server_rpc_info->interceptors_.empty();
232  }
233 
234  // This should be used only by subclasses of CallOpSetInterface. SetCall and
235  // SetCallOpSetInterface should have been called before this. After all the
236  // interceptors are done running, either ContinueFillOpsAfterInterception or
237  // ContinueFinalizeOpsAfterInterception will be called. Note that neither of
238  // them is invoked if there were no interceptors registered.
241  auto* client_rpc_info = call_->client_rpc_info();
242  if (client_rpc_info != nullptr) {
243  if (client_rpc_info->interceptors_.empty()) {
244  return true;
245  } else {
247  return false;
248  }
249  }
250 
251  auto* server_rpc_info = call_->server_rpc_info();
252  if (server_rpc_info == nullptr || server_rpc_info->interceptors_.empty()) {
253  return true;
254  }
256  return false;
257  }
258 
259  // Returns true if no interceptors are run. Returns false otherwise if there
260  // are interceptors registered. After the interceptors are done running \a f
261  // will be invoked. This is to be used only by BaseAsyncRequest and
262  // SyncRequest.
263  bool RunInterceptors(std::function<void(void)> f) {
264  // This is used only by the server for initial call request
265  GPR_CODEGEN_ASSERT(reverse_ == true);
267  auto* server_rpc_info = call_->server_rpc_info();
268  if (server_rpc_info == nullptr || server_rpc_info->interceptors_.empty()) {
269  return true;
270  }
271  callback_ = std::move(f);
273  return false;
274  }
275 
276  private:
278  auto* rpc_info = call_->client_rpc_info();
279  if (!reverse_) {
281  } else {
282  if (rpc_info->hijacked_) {
283  current_interceptor_index_ = rpc_info->hijacked_interceptor_;
284  } else {
285  current_interceptor_index_ = rpc_info->interceptors_.size() - 1;
286  }
287  }
288  rpc_info->RunInterceptor(this, current_interceptor_index_);
289  }
290 
292  auto* rpc_info = call_->server_rpc_info();
293  if (!reverse_) {
295  } else {
296  current_interceptor_index_ = rpc_info->interceptors_.size() - 1;
297  }
298  rpc_info->RunInterceptor(this, current_interceptor_index_);
299  }
300 
301  void ProceedClient() {
302  auto* rpc_info = call_->client_rpc_info();
303  if (rpc_info->hijacked_ && !reverse_ &&
304  current_interceptor_index_ == rpc_info->hijacked_interceptor_ &&
306  // We now need to provide hijacked recv ops to this interceptor
307  ClearHookPoints();
310  rpc_info->RunInterceptor(this, current_interceptor_index_);
311  return;
312  }
313  if (!reverse_) {
315  // We are going down the stack of interceptors
316  if (current_interceptor_index_ < rpc_info->interceptors_.size()) {
317  if (rpc_info->hijacked_ &&
318  current_interceptor_index_ > rpc_info->hijacked_interceptor_) {
319  // This is a hijacked RPC and we are done with hijacking
321  } else {
322  rpc_info->RunInterceptor(this, current_interceptor_index_);
323  }
324  } else {
325  // we are done running all the interceptors without any hijacking
327  }
328  } else {
329  // We are going up the stack of interceptors
330  if (current_interceptor_index_ > 0) {
331  // Continue running interceptors
333  rpc_info->RunInterceptor(this, current_interceptor_index_);
334  } else {
335  // we are done running all the interceptors without any hijacking
337  }
338  }
339  }
340 
341  void ProceedServer() {
342  auto* rpc_info = call_->server_rpc_info();
343  if (!reverse_) {
345  if (current_interceptor_index_ < rpc_info->interceptors_.size()) {
346  return rpc_info->RunInterceptor(this, current_interceptor_index_);
347  } else if (ops_) {
349  }
350  } else {
351  // We are going up the stack of interceptors
352  if (current_interceptor_index_ > 0) {
353  // Continue running interceptors
355  return rpc_info->RunInterceptor(this, current_interceptor_index_);
356  } else if (ops_) {
358  }
359  }
361  callback_();
362  }
363 
365  for (auto i = static_cast<experimental::InterceptionHookPoints>(0);
368  static_cast<size_t>(i) + 1)) {
369  hooks_[static_cast<size_t>(i)] = false;
370  }
371  }
372 
374  static_cast<size_t>(
377 
378  size_t current_interceptor_index_ = 0; // Current iterator
379  bool reverse_ = false;
381  Call* call_ = nullptr; // The Call object is present along with CallOpSet
382  // object/callback
385 
387  bool* fail_send_message_ = nullptr;
388  const void** orig_send_message_ = nullptr;
390 
391  std::multimap<std::string, std::string>* send_initial_metadata_;
392 
396 
397  std::multimap<std::string, std::string>* send_trailing_metadata_ = nullptr;
398 
399  void* recv_message_ = nullptr;
401 
403 
404  Status* recv_status_ = nullptr;
405 
407 };
408 
409 // A special implementation of InterceptorBatchMethods to send a Cancel
410 // notification down the interceptor stack
413  public:
417  }
418 
419  void Proceed() override {
420  // This is a no-op. For actual continuation of the RPC simply needs to
421  // return from the Intercept method
422  }
423 
424  void Hijack() override {
425  // Only the client can hijack when sending down initial metadata
426  GPR_CODEGEN_ASSERT(false &&
427  "It is illegal to call Hijack on a method which has a "
428  "Cancel notification");
429  }
430 
432  GPR_CODEGEN_ASSERT(false &&
433  "It is illegal to call GetSendMessage on a method which "
434  "has a Cancel notification");
435  return nullptr;
436  }
437 
438  bool GetSendMessageStatus() override {
440  false &&
441  "It is illegal to call GetSendMessageStatus on a method which "
442  "has a Cancel notification");
443  return false;
444  }
445 
446  const void* GetSendMessage() override {
448  false &&
449  "It is illegal to call GetOriginalSendMessage on a method which "
450  "has a Cancel notification");
451  return nullptr;
452  }
453 
454  void ModifySendMessage(const void* /*message*/) override {
456  false &&
457  "It is illegal to call ModifySendMessage on a method which "
458  "has a Cancel notification");
459  }
460 
461  std::multimap<std::string, std::string>* GetSendInitialMetadata() override {
462  GPR_CODEGEN_ASSERT(false &&
463  "It is illegal to call GetSendInitialMetadata on a "
464  "method which has a Cancel notification");
465  return nullptr;
466  }
467 
468  Status GetSendStatus() override {
469  GPR_CODEGEN_ASSERT(false &&
470  "It is illegal to call GetSendStatus on a method which "
471  "has a Cancel notification");
472  return Status();
473  }
474 
475  void ModifySendStatus(const Status& /*status*/) override {
476  GPR_CODEGEN_ASSERT(false &&
477  "It is illegal to call ModifySendStatus on a method "
478  "which has a Cancel notification");
479  }
480 
481  std::multimap<std::string, std::string>* GetSendTrailingMetadata() override {
482  GPR_CODEGEN_ASSERT(false &&
483  "It is illegal to call GetSendTrailingMetadata on a "
484  "method which has a Cancel notification");
485  return nullptr;
486  }
487 
488  void* GetRecvMessage() override {
489  GPR_CODEGEN_ASSERT(false &&
490  "It is illegal to call GetRecvMessage on a method which "
491  "has a Cancel notification");
492  return nullptr;
493  }
494 
495  std::multimap<grpc::string_ref, grpc::string_ref>* GetRecvInitialMetadata()
496  override {
497  GPR_CODEGEN_ASSERT(false &&
498  "It is illegal to call GetRecvInitialMetadata on a "
499  "method which has a Cancel notification");
500  return nullptr;
501  }
502 
503  Status* GetRecvStatus() override {
504  GPR_CODEGEN_ASSERT(false &&
505  "It is illegal to call GetRecvStatus on a method which "
506  "has a Cancel notification");
507  return nullptr;
508  }
509 
510  std::multimap<grpc::string_ref, grpc::string_ref>* GetRecvTrailingMetadata()
511  override {
512  GPR_CODEGEN_ASSERT(false &&
513  "It is illegal to call GetRecvTrailingMetadata on a "
514  "method which has a Cancel notification");
515  return nullptr;
516  }
517 
518  std::unique_ptr<ChannelInterface> GetInterceptedChannel() override {
519  GPR_CODEGEN_ASSERT(false &&
520  "It is illegal to call GetInterceptedChannel on a "
521  "method which has a Cancel notification");
522  return std::unique_ptr<ChannelInterface>(nullptr);
523  }
524 
525  void FailHijackedRecvMessage() override {
526  GPR_CODEGEN_ASSERT(false &&
527  "It is illegal to call FailHijackedRecvMessage on a "
528  "method which has a Cancel notification");
529  }
530 
531  void FailHijackedSendMessage() override {
532  GPR_CODEGEN_ASSERT(false &&
533  "It is illegal to call FailHijackedSendMessage on a "
534  "method which has a Cancel notification");
535  }
536 };
537 } // namespace internal
538 } // namespace grpc
539 
540 #endif // GRPCPP_IMPL_CODEGEN_INTERCEPTOR_COMMON_H
grpc::internal::InterceptorBatchMethodsImpl::SetSendTrailingMetadata
void SetSendTrailingMetadata(std::multimap< std::string, std::string > *metadata)
Definition: interceptor_common.h:164
grpc::internal::InterceptorBatchMethodsImpl::ClearState
void ClearState()
Definition: interceptor_common.h:202
grpc::status
auto status
Definition: cpp/client/credentials_test.cc:200
grpc::internal::InterceptorBatchMethodsImpl::code_
grpc_status_code * code_
Definition: interceptor_common.h:393
grpc::internal::InterceptorBatchMethodsImpl::hooks_
std::array< bool, static_cast< size_t > experimental::InterceptionHookPoints::NUM_INTERCEPTION_HOOKS)> hooks_
Definition: interceptor_common.h:376
grpc::internal::InterceptorBatchMethodsImpl::GetSerializedSendMessage
ByteBuffer * GetSerializedSendMessage() override
Definition: interceptor_common.h:83
grpc::internal::InterceptorBatchMethodsImpl::SetRecvMessage
void SetRecvMessage(void *message, bool *hijacked_recv_message_failed)
Definition: interceptor_common.h:169
bool
bool
Definition: setup_once.h:312
grpc::internal::InterceptorBatchMethodsImpl::GetSendInitialMetadata
std::multimap< std::string, std::string > * GetSendInitialMetadata() override
Definition: interceptor_common.h:104
metadata
Definition: cq_verifier.cc:48
grpc::internal::InterceptorBatchMethodsImpl::ModifySendMessage
void ModifySendMessage(const void *message) override
Definition: interceptor_common.h:97
grpc
Definition: grpcpp/alarm.h:33
grpc::internal::CancelInterceptorBatchMethods::GetSendMessage
const void * GetSendMessage() override
Definition: interceptor_common.h:446
grpc::internal::InterceptorBatchMethodsImpl::orig_send_message_
const void ** orig_send_message_
Definition: interceptor_common.h:388
grpc::internal::InterceptorBatchMethodsImpl::recv_status_
Status * recv_status_
Definition: interceptor_common.h:404
grpc::internal::InterceptedChannel
Definition: intercepted_channel.h:37
grpc::experimental::InterceptionHookPoints::PRE_RECV_MESSAGE
@ PRE_RECV_MESSAGE
buf
voidpf void * buf
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:136
grpc::internal::CallOpSetInterface
Definition: call_op_set_interface.h:36
grpc::internal::InterceptorBatchMethodsImpl::InterceptorBatchMethodsImpl
InterceptorBatchMethodsImpl()
Definition: interceptor_common.h:40
grpc::internal::CancelInterceptorBatchMethods::FailHijackedRecvMessage
void FailHijackedRecvMessage() override
Definition: interceptor_common.h:525
array
PHP_PROTO_OBJECT_FREE_END PHP_PROTO_OBJECT_DTOR_END intern array
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/array.c:111
grpc::internal::InterceptorBatchMethodsImpl::ProceedClient
void ProceedClient()
Definition: interceptor_common.h:301
metadata
struct metadata metadata
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
grpc_status_code
grpc_status_code
Definition: include/grpc/impl/codegen/status.h:28
grpc::internal::InterceptorBatchMethodsImpl::recv_initial_metadata_
MetadataMap * recv_initial_metadata_
Definition: interceptor_common.h:402
grpc::experimental::ClientRpcInfo::interceptors_
std::vector< std::unique_ptr< experimental::Interceptor > > interceptors_
Definition: impl/codegen/client_interceptor.h:175
grpc::internal::CancelInterceptorBatchMethods::FailHijackedSendMessage
void FailHijackedSendMessage() override
Definition: interceptor_common.h:531
grpc::internal::InterceptorBatchMethodsImpl
Definition: interceptor_common.h:37
grpc::internal::InterceptorBatchMethodsImpl::ProceedServer
void ProceedServer()
Definition: interceptor_common.h:341
grpc::internal::InterceptorBatchMethodsImpl::GetInterceptedChannel
std::unique_ptr< ChannelInterface > GetInterceptedChannel() override
Definition: interceptor_common.h:184
server_interceptor.h
grpc::internal::InterceptorBatchMethodsImpl::GetRecvMessage
void * GetRecvMessage() override
Definition: interceptor_common.h:123
grpc::internal::InterceptorBatchMethodsImpl::current_interceptor_index_
size_t current_interceptor_index_
Definition: interceptor_common.h:378
grpc::internal::CancelInterceptorBatchMethods
Definition: interceptor_common.h:411
grpc::internal::InterceptorBatchMethodsImpl::send_message_
ByteBuffer * send_message_
Definition: interceptor_common.h:386
map
zval * map
Definition: php/ext/google/protobuf/encode_decode.c:480
grpc::internal::InterceptorBatchMethodsImpl::AddInterceptionHookPoint
void AddInterceptionHookPoint(experimental::InterceptionHookPoints type)
Definition: interceptor_common.h:79
grpc::internal::CancelInterceptorBatchMethods::GetSendMessageStatus
bool GetSendMessageStatus() override
Definition: interceptor_common.h:438
grpc::internal::InterceptorBatchMethodsImpl::send_initial_metadata_
std::multimap< std::string, std::string > * send_initial_metadata_
Definition: interceptor_common.h:391
message
char * message
Definition: libuv/docs/code/tty-gravity/main.c:12
grpc::internal::InterceptorBatchMethodsImpl::RunClientInterceptors
void RunClientInterceptors()
Definition: interceptor_common.h:277
grpc_status._async.code
code
Definition: grpcio_status/grpc_status/_async.py:34
grpc::internal::InterceptorBatchMethodsImpl::GetRecvStatus
Status * GetRecvStatus() override
Definition: interceptor_common.h:130
grpc::internal::InterceptorBatchMethodsImpl::GetSendMessageStatus
bool GetSendMessageStatus() override
Definition: interceptor_common.h:102
call
FilterStackCall * call
Definition: call.cc:750
grpc::internal::CancelInterceptorBatchMethods::GetSendTrailingMetadata
std::multimap< std::string, std::string > * GetSendTrailingMetadata() override
Definition: interceptor_common.h:481
grpc::experimental::InterceptionHookPoints::PRE_SEND_CANCEL
@ PRE_SEND_CANCEL
grpc::internal::InterceptorBatchMethodsImpl::GetSendMessage
const void * GetSendMessage() override
Definition: interceptor_common.h:92
grpc_types.h
grpc::internal::InterceptorBatchMethodsImpl::recv_message_
void * recv_message_
Definition: interceptor_common.h:399
grpc::internal::InterceptorBatchMethodsImpl::RunServerInterceptors
void RunServerInterceptors()
Definition: interceptor_common.h:291
grpc::internal::CancelInterceptorBatchMethods::Hijack
void Hijack() override
Definition: interceptor_common.h:424
absl::move
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
Definition: abseil-cpp/absl/utility/utility.h:221
grpc::internal::InterceptorBatchMethodsImpl::ops_
CallOpSetInterface * ops_
Definition: interceptor_common.h:383
grpc.StatusCode
Definition: src/python/grpcio/grpc/__init__.py:232
grpc::internal::InterceptorBatchMethodsImpl::SetRecvInitialMetadata
void SetRecvInitialMetadata(MetadataMap *map)
Definition: interceptor_common.h:174
grpc::internal::InterceptorBatchMethodsImpl::send_trailing_metadata_
std::multimap< std::string, std::string > * send_trailing_metadata_
Definition: interceptor_common.h:397
grpc::internal::InterceptorBatchMethodsImpl::fail_send_message_
bool * fail_send_message_
Definition: interceptor_common.h:387
grpc::internal::InterceptorBatchMethodsImpl::SetRecvTrailingMetadata
void SetRecvTrailingMetadata(MetadataMap *map)
Definition: interceptor_common.h:180
grpc::internal::Call::server_rpc_info
experimental::ServerRpcInfo * server_rpc_info() const
Definition: include/grpcpp/impl/codegen/call.h:80
grpc::internal::InterceptorBatchMethodsImpl::Proceed
void Proceed() override
Definition: interceptor_common.h:56
grpc::internal::InterceptorBatchMethodsImpl::SetReverse
void SetReverse()
Definition: interceptor_common.h:209
grpc::internal::InterceptorBatchMethodsImpl::QueryInterceptionHookPoint
bool QueryInterceptionHookPoint(experimental::InterceptionHookPoints type) override
Definition: interceptor_common.h:51
grpc::internal::InterceptorBatchMethodsImpl::recv_trailing_metadata_
MetadataMap * recv_trailing_metadata_
Definition: interceptor_common.h:406
grpc::internal::InterceptorBatchMethodsImpl::hijacked_recv_message_failed_
bool * hijacked_recv_message_failed_
Definition: interceptor_common.h:400
grpc::ByteBuffer
A sequence of bytes.
Definition: include/grpcpp/impl/codegen/byte_buffer.h:61
grpc::internal::InterceptorBatchMethodsImpl::RunInterceptors
bool RunInterceptors(std::function< void(void)> f)
Definition: interceptor_common.h:263
grpc::internal::InterceptorBatchMethodsImpl::FailHijackedSendMessage
void FailHijackedSendMessage() override
Definition: interceptor_common.h:132
grpc::internal::MetadataMap
Definition: grpcpp/impl/codegen/metadata_map.h:35
grpc::internal::CancelInterceptorBatchMethods::GetRecvStatus
Status * GetRecvStatus() override
Definition: interceptor_common.h:503
grpc::internal::Call::client_rpc_info
experimental::ClientRpcInfo * client_rpc_info() const
Definition: include/grpcpp/impl/codegen/call.h:76
grpc::internal::InterceptorBatchMethodsImpl::RunInterceptors
bool RunInterceptors()
Definition: interceptor_common.h:239
grpc::internal::CallOpSetInterface::SetHijackingState
virtual void SetHijackingState()=0
grpc::internal::CancelInterceptorBatchMethods::GetRecvInitialMetadata
std::multimap< grpc::string_ref, grpc::string_ref > * GetRecvInitialMetadata() override
Definition: interceptor_common.h:495
call_op_set_interface.h
grpc::internal::CancelInterceptorBatchMethods::QueryInterceptionHookPoint
bool QueryInterceptionHookPoint(experimental::InterceptionHookPoints type) override
Definition: interceptor_common.h:414
grpc::internal::Call
Straightforward wrapping of the C call object.
Definition: include/grpcpp/impl/codegen/call.h:37
grpc::internal::InterceptorBatchMethodsImpl::SetSendInitialMetadata
void SetSendInitialMetadata(std::multimap< std::string, std::string > *metadata)
Definition: interceptor_common.h:152
grpc::internal::InterceptorBatchMethodsImpl::SetCall
void SetCall(Call *call)
Definition: interceptor_common.h:216
grpc::internal::InterceptorBatchMethodsImpl::callback_
std::function< void(void)> callback_
Definition: interceptor_common.h:384
msg
std::string msg
Definition: client_interceptors_end2end_test.cc:372
grpc::experimental::InterceptorBatchMethods
Definition: impl/codegen/interceptor.h:98
grpc::internal::InterceptorBatchMethodsImpl::~InterceptorBatchMethodsImpl
~InterceptorBatchMethodsImpl() override
Definition: interceptor_common.h:49
grpc::internal::InterceptorBatchMethodsImpl::SetRecvStatus
void SetRecvStatus(Status *status)
Definition: interceptor_common.h:178
client_interceptor.h
grpc::internal::InterceptorBatchMethodsImpl::GetSendStatus
Status GetSendStatus() override
Returns the status to be sent. Valid for PRE_SEND_STATUS interceptions.
Definition: interceptor_common.h:108
grpc::experimental::InterceptionHookPoints::NUM_INTERCEPTION_HOOKS
@ NUM_INTERCEPTION_HOOKS
grpc::experimental::InterceptionHookPoints::PRE_SEND_MESSAGE
@ PRE_SEND_MESSAGE
grpc::internal::InterceptorBatchMethodsImpl::error_message_
std::string * error_message_
Definition: interceptor_common.h:395
grpc::internal::CancelInterceptorBatchMethods::Proceed
void Proceed() override
Definition: interceptor_common.h:419
grpc::internal::InterceptorBatchMethodsImpl::GetRecvInitialMetadata
std::multimap< grpc::string_ref, grpc::string_ref > * GetRecvInitialMetadata() override
Definition: interceptor_common.h:125
grpc::internal::InterceptorBatchMethodsImpl::Hijack
void Hijack() override
Definition: interceptor_common.h:64
grpc::internal::InterceptorBatchMethodsImpl::ClearHookPoints
void ClearHookPoints()
Definition: interceptor_common.h:364
grpc::internal::CancelInterceptorBatchMethods::GetRecvMessage
void * GetRecvMessage() override
Definition: interceptor_common.h:488
grpc::internal::InterceptorBatchMethodsImpl::InterceptorsListEmpty
bool InterceptorsListEmpty()
Definition: interceptor_common.h:224
grpc::internal::InterceptorBatchMethodsImpl::call_
Call * call_
Definition: interceptor_common.h:381
grpc::internal::InterceptorBatchMethodsImpl::GetRecvTrailingMetadata
std::multimap< grpc::string_ref, grpc::string_ref > * GetRecvTrailingMetadata() override
Definition: interceptor_common.h:138
grpc::internal::CancelInterceptorBatchMethods::ModifySendMessage
void ModifySendMessage(const void *) override
Definition: interceptor_common.h:454
grpc::experimental::ClientRpcInfo::hijacked_
bool hijacked_
Definition: impl/codegen/client_interceptor.h:176
grpc::protobuf::util::Status
GRPC_CUSTOM_UTIL_STATUS Status
Definition: include/grpcpp/impl/codegen/config_protobuf.h:93
grpc::Status
Definition: include/grpcpp/impl/codegen/status.h:35
grpc::internal::CancelInterceptorBatchMethods::GetSendStatus
Status GetSendStatus() override
Returns the status to be sent. Valid for PRE_SEND_STATUS interceptions.
Definition: interceptor_common.h:468
grpc::internal::InterceptorBatchMethodsImpl::SetSendStatus
void SetSendStatus(grpc_status_code *code, std::string *error_details, std::string *error_message)
Definition: interceptor_common.h:157
grpc::internal::InterceptorBatchMethodsImpl::reverse_
bool reverse_
Definition: interceptor_common.h:379
grpc::internal::CallOpSetInterface::ContinueFinalizeResultAfterInterception
virtual void ContinueFinalizeResultAfterInterception()=0
grpc::internal::InterceptorBatchMethodsImpl::SetCallOpSetInterface
void SetCallOpSetInterface(CallOpSetInterface *ops)
Definition: interceptor_common.h:220
GPR_CODEGEN_ASSERT
#define GPR_CODEGEN_ASSERT(x)
Codegen specific version of GPR_ASSERT.
Definition: grpcpp/impl/codegen/core_codegen_interface.h:151
intercepted_channel.h
grpc::internal::CancelInterceptorBatchMethods::GetSendInitialMetadata
std::multimap< std::string, std::string > * GetSendInitialMetadata() override
Definition: interceptor_common.h:461
internal
Definition: benchmark/test/output_test_helper.cc:20
grpc::internal::InterceptorBatchMethodsImpl::SetSendMessage
void SetSendMessage(ByteBuffer *buf, const void **msg, bool *fail_send_message, std::function< Status(const void *)> serializer)
Definition: interceptor_common.h:143
grpc::internal::CallOpSetInterface::ContinueFillOpsAfterInterception
virtual void ContinueFillOpsAfterInterception()=0
grpc::internal::CancelInterceptorBatchMethods::GetRecvTrailingMetadata
std::multimap< grpc::string_ref, grpc::string_ref > * GetRecvTrailingMetadata() override
Definition: interceptor_common.h:510
grpc::internal::CancelInterceptorBatchMethods::GetSerializedSendMessage
ByteBuffer * GetSerializedSendMessage() override
Definition: interceptor_common.h:431
asyncio_get_stats.type
type
Definition: asyncio_get_stats.py:37
code
Definition: bloaty/third_party/zlib/contrib/infback9/inftree9.h:24
function
std::function< bool(GrpcTool *, int, const char **, const CliCredentials &, GrpcToolOutputCallback)> function
Definition: grpc_tool.cc:250
grpc::internal::MetadataMap::map
std::multimap< grpc::string_ref, grpc::string_ref > * map()
Definition: grpcpp/impl/codegen/metadata_map.h:68
grpc::internal::InterceptorBatchMethodsImpl::ran_hijacking_interceptor_
bool ran_hijacking_interceptor_
Definition: interceptor_common.h:380
grpc::internal::InterceptorBatchMethodsImpl::ModifySendStatus
void ModifySendStatus(const Status &status) override
Definition: interceptor_common.h:113
grpc::internal::CancelInterceptorBatchMethods::ModifySendStatus
void ModifySendStatus(const Status &) override
Definition: interceptor_common.h:475
grpc::internal::InterceptorBatchMethodsImpl::serializer_
std::function< Status(const void *)> serializer_
Definition: interceptor_common.h:389
ops
static grpc_op ops[6]
Definition: test/core/fling/client.cc:39
grpc::experimental::ServerRpcInfo::interceptors_
std::vector< std::unique_ptr< experimental::Interceptor > > interceptors_
Definition: impl/codegen/server_interceptor.h:132
grpc::experimental::InterceptionHookPoints
InterceptionHookPoints
Definition: impl/codegen/interceptor.h:59
grpc::internal::InterceptorBatchMethodsImpl::error_details_
std::string * error_details_
Definition: interceptor_common.h:394
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
grpc::internal::CancelInterceptorBatchMethods::GetInterceptedChannel
std::unique_ptr< ChannelInterface > GetInterceptedChannel() override
Definition: interceptor_common.h:518
grpc::internal::InterceptorBatchMethodsImpl::GetSendTrailingMetadata
std::multimap< std::string, std::string > * GetSendTrailingMetadata() override
Definition: interceptor_common.h:119
call.h
grpc::internal::InterceptorBatchMethodsImpl::FailHijackedRecvMessage
void FailHijackedRecvMessage() override
Definition: interceptor_common.h:195


grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:00:21