wire_reader_impl.cc
Go to the documentation of this file.
1 // Copyright 2021 gRPC authors.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
16 
18 
19 #ifndef GRPC_NO_BINDER
20 
21 #include <functional>
22 #include <limits>
23 #include <string>
24 #include <utility>
25 #include <vector>
26 
27 #include "absl/memory/memory.h"
28 #include "absl/status/statusor.h"
29 
30 #include <grpc/support/log.h>
31 
35 
36 #define RETURN_IF_ERROR(expr) \
37  do { \
38  const absl::Status status = (expr); \
39  if (!status.ok()) return status; \
40  } while (0)
41 
42 namespace grpc_binder {
43 namespace {
44 
45 const int32_t kWireFormatVersion = 1;
46 const char kAuthorityMetadataKey[] = ":authority";
47 
48 absl::StatusOr<Metadata> parse_metadata(ReadableParcel* reader) {
49  int num_header;
50  RETURN_IF_ERROR(reader->ReadInt32(&num_header));
51  gpr_log(GPR_INFO, "num_header = %d", num_header);
52  if (num_header < 0) {
53  return absl::InvalidArgumentError("num_header cannot be negative");
54  }
55  std::vector<std::pair<std::string, std::string>> ret;
56  for (int i = 0; i < num_header; i++) {
57  int count;
58  RETURN_IF_ERROR(reader->ReadInt32(&count));
59  gpr_log(GPR_INFO, "count = %d", count);
60  std::string key{};
61  if (count > 0) RETURN_IF_ERROR(reader->ReadByteArray(&key));
62  gpr_log(GPR_INFO, "key = %s", key.c_str());
63  RETURN_IF_ERROR(reader->ReadInt32(&count));
64  gpr_log(GPR_INFO, "count = %d", count);
66  if (count > 0) RETURN_IF_ERROR(reader->ReadByteArray(&value));
67  gpr_log(GPR_INFO, "value = %s", value.c_str());
68  ret.emplace_back(key, value);
69  }
70  return ret;
71 }
72 
73 } // namespace
74 
76  std::shared_ptr<TransportStreamReceiver> transport_stream_receiver,
77  bool is_client,
78  std::shared_ptr<grpc::experimental::binder::SecurityPolicy> security_policy,
79  std::function<void()> on_destruct_callback)
80  : transport_stream_receiver_(std::move(transport_stream_receiver)),
81  is_client_(is_client),
82  security_policy_(security_policy),
83  on_destruct_callback_(on_destruct_callback) {
84  gpr_log(GPR_INFO, "%s mu_ = %p", __func__, &mu_);
85 }
86 
90  }
91 }
92 
93 std::shared_ptr<WireWriter> WireReaderImpl::SetupTransport(
94  std::unique_ptr<Binder> binder) {
95  gpr_log(GPR_INFO, "Setting up transport");
96  if (!is_client_) {
97  SendSetupTransport(binder.get());
98  {
100  connected_ = true;
101  wire_writer_ = std::make_shared<WireWriterImpl>(std::move(binder));
102  }
103  return wire_writer_;
104  } else {
105  SendSetupTransport(binder.get());
106  auto other_end_binder = RecvSetupTransport();
107  {
108  grpc_core::MutexLock lock(&mu_);
109  connected_ = true;
110  wire_writer_ =
111  std::make_shared<WireWriterImpl>(std::move(other_end_binder));
112  }
113  return wire_writer_;
114  }
115 }
116 
118  binder->Initialize();
119  gpr_log(GPR_INFO, "prepare transaction = %d",
120  binder->PrepareTransaction().ok());
121  WritableParcel* writable_parcel = binder->GetWritableParcel();
122  gpr_log(GPR_INFO, "write int32 = %d",
123  writable_parcel->WriteInt32(kWireFormatVersion).ok());
124  // The lifetime of the transaction receiver is the same as the wire writer's.
125  // The transaction receiver is responsible for not calling the on-transact
126  // callback when it's dead.
127  // Give TransactionReceiver a Ref() since WireReader cannot be destructed
128  // during callback execution. TransactionReceiver should make sure that the
129  // callback owns a Ref() when it's being invoked.
131  /*wire_reader_ref=*/Ref(),
132  [this](transaction_code_t code, ReadableParcel* readable_parcel,
133  int uid) {
134  return this->ProcessTransaction(code, readable_parcel, uid);
135  });
136 
137  gpr_log(GPR_INFO, "tx_receiver = %p", tx_receiver_->GetRawBinder());
138  gpr_log(GPR_INFO, "AParcel_writeStrongBinder = %d",
139  writable_parcel->WriteBinder(tx_receiver_.get()).ok());
140  gpr_log(GPR_INFO, "AIBinder_transact = %d",
142 }
143 
144 std::unique_ptr<Binder> WireReaderImpl::RecvSetupTransport() {
145  // TODO(b/191941760): avoid blocking, handle wire_writer_noti lifetime
146  // better
147  gpr_log(GPR_INFO, "start waiting for noti");
149  gpr_log(GPR_INFO, "end waiting for noti");
151 }
152 
154  ReadableParcel* parcel,
155  int uid) {
156  gpr_log(GPR_INFO, __func__);
157  gpr_log(GPR_INFO, "tx code = %u", code);
158  if (code >= static_cast<unsigned>(kFirstCallId)) {
159  gpr_log(GPR_INFO, "This is probably a Streaming Tx");
160  return ProcessStreamingTransaction(code, parcel);
161  }
162 
163  if (!(code >= static_cast<transaction_code_t>(
165  code <= static_cast<transaction_code_t>(
168  "Received unknown control message. Shutdown transport gracefully.");
169  // TODO(waynetu): Shutdown transport gracefully.
170  return absl::OkStatus();
171  }
172 
173  {
174  grpc_core::MutexLock lock(&mu_);
176  !connected_) {
177  return absl::InvalidArgumentError("Transports not connected yet");
178  }
179  }
180 
181  // TODO(mingcl): See if we want to check the security policy for every RPC
182  // call or just during transport setup.
183 
184  switch (BinderTransportTxCode(code)) {
186  grpc_core::MutexLock lock(&mu_);
187  if (recvd_setup_transport_) {
189  "Already received a SETUP_TRANSPORT request");
190  }
191  recvd_setup_transport_ = true;
192 
193  gpr_log(GPR_ERROR, "calling uid = %d", uid);
194  if (!security_policy_->IsAuthorized(uid)) {
196  "UID " + std::to_string(uid) +
197  " is not allowed to connect to this "
198  "transport according to security policy.");
199  }
200 
201  int version;
202  RETURN_IF_ERROR(parcel->ReadInt32(&version));
203  gpr_log(GPR_INFO, "The other end respond with version = %d", version);
204  // We only support this single lowest possible version, so server must
205  // respond that version too.
206  if (version != kWireFormatVersion) {
208  "The other end respond with version = %d, but we requested "
209  "version %d, trying to continue anyway",
210  version, kWireFormatVersion);
211  }
212  std::unique_ptr<Binder> binder{};
213  RETURN_IF_ERROR(parcel->ReadBinder(&binder));
214  if (!binder) {
215  return absl::InternalError("Read NULL binder from the parcel");
216  }
217  binder->Initialize();
218  other_end_binder_ = std::move(binder);
220  break;
221  }
224  "Received SHUTDOWN_TRANSPORT request but not implemented yet.");
225  return absl::UnimplementedError("SHUTDOWN_TRANSPORT");
226  }
228  int64_t num_bytes = -1;
229  RETURN_IF_ERROR(parcel->ReadInt64(&num_bytes));
230  gpr_log(GPR_INFO, "received acknowledge bytes = %" PRId64, num_bytes);
231  wire_writer_->OnAckReceived(num_bytes);
232  break;
233  }
235  if (is_client_) {
236  return absl::FailedPreconditionError("Receive PING request in client");
237  }
238  int ping_id = -1;
239  RETURN_IF_ERROR(parcel->ReadInt32(&ping_id));
240  gpr_log(GPR_INFO, "received ping id = %d", ping_id);
241  // TODO(waynetu): Ping back.
242  break;
243  }
245  int value = -1;
246  RETURN_IF_ERROR(parcel->ReadInt32(&value));
247  gpr_log(GPR_INFO, "received ping response = %d", value);
248  break;
249  }
250  }
251  return absl::OkStatus();
252 }
253 
256  bool need_to_send_ack = false;
257  int64_t num_bytes = 0;
258  absl::Status tx_process_result;
259  {
260  grpc_core::MutexLock lock(&mu_);
261  if (!connected_) {
262  return absl::InvalidArgumentError("Transports not connected yet");
263  }
264 
265  // Indicate which callbacks should be cancelled. It will be initialized as
266  // the flags the in-coming transaction carries, and when a particular
267  // callback is completed, the corresponding bit in cancellation_flag will be
268  // set to 0 so that we won't cancel it afterward.
269  int cancellation_flags = 0;
270  tx_process_result =
271  ProcessStreamingTransactionImpl(code, parcel, &cancellation_flags);
272  if (!tx_process_result.ok()) {
273  gpr_log(GPR_ERROR, "Failed to process streaming transaction: %s",
274  tx_process_result.ToString().c_str());
275  // Something went wrong when receiving transaction. Cancel failed
276  // requests.
277  if (cancellation_flags & kFlagPrefix) {
278  gpr_log(GPR_INFO, "cancelling initial metadata");
279  transport_stream_receiver_->NotifyRecvInitialMetadata(
280  code, tx_process_result);
281  }
282  if (cancellation_flags & kFlagMessageData) {
283  gpr_log(GPR_INFO, "cancelling message data");
284  transport_stream_receiver_->NotifyRecvMessage(code, tx_process_result);
285  }
286  if (cancellation_flags & kFlagSuffix) {
287  gpr_log(GPR_INFO, "cancelling trailing metadata");
288  transport_stream_receiver_->NotifyRecvTrailingMetadata(
289  code, tx_process_result, 0);
290  }
291  }
292  if ((num_incoming_bytes_ - num_acknowledged_bytes_) >=
294  need_to_send_ack = true;
295  num_bytes = num_incoming_bytes_;
296  num_acknowledged_bytes_ = num_incoming_bytes_;
297  }
298  }
299  if (need_to_send_ack) {
301  // wire_writer_ should not be accessed while holding mu_!
302  // Otherwise, it is possible that
303  // 1. wire_writer_::mu_ is acquired before mu_ (NDK call back during
304  // transaction)
305  // 2. mu_ is acquired before wire_writer_::mu_ (e.g. Java call back us, and
306  // we call WireWriter::SendAck which will try to acquire wire_writer_::mu_)
307  absl::Status ack_status = wire_writer_->SendAck(num_bytes);
308  if (tx_process_result.ok()) {
309  return ack_status;
310  }
311  }
312  return tx_process_result;
313 }
314 
316  transaction_code_t code, ReadableParcel* parcel, int* cancellation_flags) {
317  GPR_ASSERT(cancellation_flags);
318  num_incoming_bytes_ += parcel->GetDataSize();
319  gpr_log(GPR_INFO, "Total incoming bytes: %" PRId64, num_incoming_bytes_);
320 
321  int flags;
322  RETURN_IF_ERROR(parcel->ReadInt32(&flags));
323  gpr_log(GPR_INFO, "flags = %d", flags);
324  *cancellation_flags = flags;
325 
326  // Ignore in-coming transaction with flag = 0 to match with Java
327  // implementation.
328  // TODO(waynetu): Check with grpc-java team to see whether this is the
329  // intended behavior.
330  // TODO(waynetu): What should be returned here?
331  if (flags == 0) {
332  gpr_log(GPR_INFO, "[WARNING] Receive empty transaction. Ignored.");
333  return absl::OkStatus();
334  }
335 
336  int status = flags >> 16;
337  gpr_log(GPR_INFO, "status = %d", status);
338  gpr_log(GPR_INFO, "FLAG_PREFIX = %d", (flags & kFlagPrefix));
339  gpr_log(GPR_INFO, "FLAG_MESSAGE_DATA = %d", (flags & kFlagMessageData));
340  gpr_log(GPR_INFO, "FLAG_SUFFIX = %d", (flags & kFlagSuffix));
341  int seq_num;
342  RETURN_IF_ERROR(parcel->ReadInt32(&seq_num));
343  // TODO(waynetu): For now we'll just assume that the transactions commit in
344  // the same order they're issued. The following assertion detects
345  // out-of-order or missing transactions. WireReaderImpl should be fixed if
346  // we indeed found such behavior.
347  int32_t& expectation = expected_seq_num_[code];
348  if (seq_num < 0 || seq_num != expectation) {
349  // Unexpected sequence number.
350  return absl::InternalError("Unexpected sequence number");
351  }
352  // TODO(waynetu): According to the protocol, "The sequence number will wrap
353  // around to 0 if more than 2^31 messages are sent." For now we'll just
354  // assert that it never reach such circumstances.
356  "Sequence number too large");
357  expectation++;
358  gpr_log(GPR_INFO, "sequence number = %d", seq_num);
359  if (flags & kFlagPrefix) {
360  std::string method_ref;
361  if (!is_client_) {
362  RETURN_IF_ERROR(parcel->ReadString(&method_ref));
363  }
364  absl::StatusOr<Metadata> initial_metadata_or_error = parse_metadata(parcel);
365  if (!initial_metadata_or_error.ok()) {
366  return initial_metadata_or_error.status();
367  }
368  if (!is_client_) {
369  // In BinderChannel wireformat specification, path is not encoded as part
370  // of metadata. So we extract the path and turn it into metadata here
371  // (this is what core API layer expects).
372  initial_metadata_or_error->emplace_back(":path",
373  std::string("/") + method_ref);
374  // Since authority metadata is not part of BinderChannel wireformat
375  // specification, and gRPC core API layer expects the presence of
376  // authority for message sent from client to server, we add one if
377  // missing (it will be missing if client grpc-java).
378  bool has_authority = false;
379  for (const auto& p : *initial_metadata_or_error) {
380  if (p.first == kAuthorityMetadataKey) has_authority = true;
381  }
382  if (!has_authority) {
383  initial_metadata_or_error->emplace_back(kAuthorityMetadataKey,
384  "binder.authority");
385  }
386  }
387  transport_stream_receiver_->NotifyRecvInitialMetadata(
388  code, *initial_metadata_or_error);
389  *cancellation_flags &= ~kFlagPrefix;
390  }
391  if (flags & kFlagMessageData) {
392  int count;
393  RETURN_IF_ERROR(parcel->ReadInt32(&count));
394  gpr_log(GPR_INFO, "count = %d", count);
395  std::string msg_data{};
396  if (count > 0) {
397  RETURN_IF_ERROR(parcel->ReadByteArray(&msg_data));
398  }
399  gpr_log(GPR_INFO, "msg_data = %s", msg_data.c_str());
400  message_buffer_[code] += msg_data;
401  if ((flags & kFlagMessageDataIsPartial) == 0) {
402  std::string s = std::move(message_buffer_[code]);
403  message_buffer_.erase(code);
404  transport_stream_receiver_->NotifyRecvMessage(code, std::move(s));
405  }
406  *cancellation_flags &= ~kFlagMessageData;
407  }
408  if (flags & kFlagSuffix) {
410  // FLAG_STATUS_DESCRIPTION set
412  RETURN_IF_ERROR(parcel->ReadString(&desc));
413  gpr_log(GPR_INFO, "description = %s", desc.c_str());
414  }
416  if (is_client_) {
417  absl::StatusOr<Metadata> trailing_metadata_or_error =
418  parse_metadata(parcel);
419  if (!trailing_metadata_or_error.ok()) {
420  return trailing_metadata_or_error.status();
421  }
422  trailing_metadata = *trailing_metadata_or_error;
423  }
424  transport_stream_receiver_->NotifyRecvTrailingMetadata(
426  *cancellation_flags &= ~kFlagSuffix;
427  }
428  return absl::OkStatus();
429 }
430 
431 } // namespace grpc_binder
432 #endif
absl::InvalidArgumentError
Status InvalidArgumentError(absl::string_view message)
Definition: third_party/abseil-cpp/absl/status/status.cc:351
GPR_INFO
#define GPR_INFO
Definition: include/grpc/impl/codegen/log.h:56
grpc_binder::WireReaderImpl::is_client_
bool is_client_
Definition: wire_reader_impl.h:120
grpc_binder::Binder::ConstructTxReceiver
virtual std::unique_ptr< TransactionReceiver > ConstructTxReceiver(grpc_core::RefCountedPtr< WireReader > wire_reader_ref, TransactionReceiver::OnTransactCb transact_cb) const =0
grpc_binder::BinderTransportTxCode::SETUP_TRANSPORT
@ SETUP_TRANSPORT
grpc_binder::WireReaderImpl::ProcessStreamingTransaction
absl::Status ProcessStreamingTransaction(transaction_code_t code, ReadableParcel *parcel)
Definition: wire_reader_impl.cc:254
log.h
absl::Status::ToString
std::string ToString(StatusToStringMode mode=StatusToStringMode::kDefault) const
Definition: third_party/abseil-cpp/absl/status/status.h:821
binder.h
grpc_binder::BinderTransportTxCode::PING_RESPONSE
@ PING_RESPONSE
grpc_core::MutexLock
Definition: src/core/lib/gprpp/sync.h:88
grpc_binder
Definition: connection_id_generator.cc:45
grpc_binder::WireReaderImpl::other_end_binder_
std::unique_ptr< Binder > other_end_binder_
Definition: wire_reader_impl.h:114
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
transaction_code_t
uint32_t transaction_code_t
Definition: binder_constants.h:24
absl::OkStatus
Status OkStatus()
Definition: third_party/abseil-cpp/absl/status/status.h:882
grpc_binder::kFlagMessageDataIsPartial
const int kFlagMessageDataIsPartial
Definition: transaction.cc:30
status
absl::Status status
Definition: rls.cc:251
version
Definition: version.py:1
absl::InternalError
Status InternalError(absl::string_view message)
Definition: third_party/abseil-cpp/absl/status/status.cc:347
grpc_status._async.code
code
Definition: grpcio_status/grpc_status/_async.py:34
absl::PermissionDeniedError
Status PermissionDeniedError(absl::string_view message)
Definition: third_party/abseil-cpp/absl/status/status.cc:363
grpc_binder::BinderTransportTxCode
BinderTransportTxCode
Definition: binder_constants.h:31
grpc_binder::WireReaderImpl::security_policy_
std::shared_ptr< grpc::experimental::binder::SecurityPolicy > security_policy_
Definition: wire_reader_impl.h:121
grpc_binder::kFlagStatusDescription
const int kFlagStatusDescription
Definition: transaction.cc:28
grpc_status._async.trailing_metadata
trailing_metadata
Definition: grpcio_status/grpc_status/_async.py:36
absl::move
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
Definition: abseil-cpp/absl/utility/utility.h:221
GPR_ASSERT
#define GPR_ASSERT(x)
Definition: include/grpc/impl/codegen/log.h:94
grpc_binder::WireReaderImpl::transport_stream_receiver_
std::shared_ptr< TransportStreamReceiver > transport_stream_receiver_
Definition: wire_reader_impl.h:107
int64_t
signed __int64 int64_t
Definition: stdint-msvc2008.h:89
grpc_binder::BinderTransportTxCode::SHUTDOWN_TRANSPORT
@ SHUTDOWN_TRANSPORT
grpc_binder::WireReaderImpl::connection_noti_
absl::Notification connection_noti_
Definition: wire_reader_impl.h:108
max
int max
Definition: bloaty/third_party/zlib/examples/enough.c:170
absl::FailedPreconditionError
Status FailedPreconditionError(absl::string_view message)
Definition: third_party/abseil-cpp/absl/status/status.cc:343
transport_stream_receiver_
std::shared_ptr< StrictMock< MockTransportStreamReceiver > > transport_stream_receiver_
Definition: wire_reader_test.cc:98
grpc_binder::WireReaderImpl::on_destruct_callback_
std::function< void()> on_destruct_callback_
Definition: wire_reader_impl.h:124
wire_reader_impl.h
grpc_core::InternallyRefCounted< WireReader >::Ref
RefCountedPtr< WireReader > Ref() GRPC_MUST_USE_RESULT
Definition: orphanable.h:90
gpr_log
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
grpc_binder::WireReaderImpl::tx_receiver_
std::unique_ptr< TransactionReceiver > tx_receiver_
Definition: wire_reader_impl.h:119
conf.version
string version
Definition: doc/python/sphinx/conf.py:36
absl::Notification::Notify
void Notify()
Definition: abseil-cpp/absl/synchronization/notification.cc:27
is_client_
const bool is_client_
Definition: binder_transport.cc:370
grpc_binder::ReadableParcel::ReadBinder
virtual absl::Status ReadBinder(std::unique_ptr< Binder > *data)=0
grpc_binder::ReadableParcel::GetDataSize
virtual int32_t GetDataSize() const =0
GPR_ERROR
#define GPR_ERROR
Definition: include/grpc/impl/codegen/log.h:57
grpc_binder::Binder::GetWritableParcel
virtual WritableParcel * GetWritableParcel() const =0
grpc_binder::WireReaderImpl::wire_writer_
std::shared_ptr< WireWriter > wire_writer_
Definition: wire_reader_impl.h:132
grpc_binder::WritableParcel
Definition: binder.h:44
grpc_binder::ReadableParcel::ReadByteArray
virtual absl::Status ReadByteArray(std::string *data)=0
security_policy_
std::shared_ptr< grpc::experimental::binder::SecurityPolicy > security_policy_
Definition: binder_server_credentials.cc:61
RETURN_IF_ERROR
#define RETURN_IF_ERROR(expr)
Definition: wire_reader_impl.cc:36
grpc_binder::WireReaderImpl::ProcessStreamingTransactionImpl
absl::Status ProcessStreamingTransactionImpl(transaction_code_t code, ReadableParcel *parcel, int *cancellation_flags) ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_)
Definition: wire_reader_impl.cc:315
value
const char * value
Definition: hpack_parser_table.cc:165
grpc_binder::WireReaderImpl::~WireReaderImpl
~WireReaderImpl() override
Definition: wire_reader_impl.cc:87
grpc_binder::WireReaderImpl::RecvSetupTransport
std::unique_ptr< Binder > RecvSetupTransport()
Definition: wire_reader_impl.cc:144
grpc_binder::kFlagPrefix
const int kFlagPrefix
Definition: transaction.cc:23
grpc_binder::WireReaderImpl::mu_
grpc_core::Mutex mu_
Definition: wire_reader_impl.h:109
absl::StatusOr::ok
ABSL_MUST_USE_RESULT bool ok() const
Definition: abseil-cpp/absl/status/statusor.h:491
key
const char * key
Definition: hpack_parser_table.cc:164
absl::flags_internal
Definition: abseil-cpp/absl/flags/commandlineflag.h:40
grpc_binder::WritableParcel::WriteInt32
virtual absl::Status WriteInt32(int32_t data)=0
grpc_binder::BinderTransportTxCode::ACKNOWLEDGE_BYTES
@ ACKNOWLEDGE_BYTES
grpc_binder::WireReaderImpl::ProcessTransaction
absl::Status ProcessTransaction(transaction_code_t code, ReadableParcel *parcel, int uid)
Definition: wire_reader_impl.cc:153
count
int * count
Definition: bloaty/third_party/googletest/googlemock/test/gmock_stress_test.cc:96
absl::Status
Definition: third_party/abseil-cpp/absl/status/status.h:424
ret
UniquePtr< SSL_SESSION > ret
Definition: ssl_x509.cc:1029
grpc_binder::Binder::Initialize
virtual void Initialize()=0
grpc_binder::kFlagSuffix
const int kFlagSuffix
Definition: transaction.cc:25
std
Definition: grpcpp/impl/codegen/async_unary_call.h:407
grpc_binder::WritableParcel::WriteBinder
virtual absl::Status WriteBinder(HasRawBinder *binder)=0
wire_writer.h
grpc_binder::kFlagMessageData
const int kFlagMessageData
Definition: transaction.cc:24
grpc_binder::WireReaderImpl::kFlowControlAckBytes
static constexpr int64_t kFlowControlAckBytes
Definition: wire_reader_impl.h:127
grpc_binder::ReadableParcel::ReadString
virtual absl::Status ReadString(std::string *str)=0
desc
#define desc
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set.h:338
transport_stream_receiver.h
absl::Status::ok
ABSL_MUST_USE_RESULT bool ok() const
Definition: third_party/abseil-cpp/absl/status/status.h:802
grpc_binder::ReadableParcel::ReadInt32
virtual absl::Status ReadInt32(int32_t *data)=0
connected_
grpc_closure connected_
Definition: tcp_connect_handshaker.cc:87
absl::UnimplementedError
Status UnimplementedError(absl::string_view message)
Definition: third_party/abseil-cpp/absl/status/status.cc:379
grpc_binder::ReadableParcel::ReadInt64
virtual absl::Status ReadInt64(int64_t *data)=0
grpc_binder::Metadata
std::vector< std::pair< std::string, std::string > > Metadata
Definition: transaction.h:38
flags
uint32_t flags
Definition: retry_filter.cc:632
grpc_binder::WireReaderImpl::SetupTransport
std::shared_ptr< WireWriter > SetupTransport(std::unique_ptr< Binder > binder) override
Definition: wire_reader_impl.cc:93
grpc_binder::kFirstCallId
const int kFirstCallId
Definition: binder_constants.cc:26
absl::StatusOr
Definition: abseil-cpp/absl/status/statusor.h:187
code
Definition: bloaty/third_party/zlib/contrib/infback9/inftree9.h:24
grpc_binder::ReadableParcel
Definition: binder.h:66
grpc_binder::Binder
Definition: binder.h:87
function
std::function< bool(GrpcTool *, int, const char **, const CliCredentials &, GrpcToolOutputCallback)> function
Definition: grpc_tool.cc:250
int32_t
signed int int32_t
Definition: stdint-msvc2008.h:77
to_string
static bool to_string(zval *from)
Definition: protobuf/php/ext/google/protobuf/convert.c:333
grpc_binder::WireReaderImpl::SendSetupTransport
void SendSetupTransport(Binder *binder)
Definition: wire_reader_impl.cc:117
grpc_binder::Binder::Transact
virtual absl::Status Transact(BinderTransportTxCode tx_code)=0
grpc_binder::WireReaderImpl::WireReaderImpl
WireReaderImpl(std::shared_ptr< TransportStreamReceiver > transport_stream_receiver, bool is_client, std::shared_ptr< grpc::experimental::binder::SecurityPolicy > security_policy, std::function< void()> on_destruct_callback=nullptr)
Definition: wire_reader_impl.cc:75
grpc_binder::Binder::PrepareTransaction
virtual absl::Status PrepareTransaction()=0
reader
void reader(void *n)
Definition: libuv/docs/code/locks/main.c:8
grpc_binder::BinderTransportTxCode::PING
@ PING
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
expectation
struct expectation expectation
Definition: cq_verifier_internal.h:24
absl::StatusOr::status
const Status & status() const &
Definition: abseil-cpp/absl/status/statusor.h:678
absl::Notification::WaitForNotification
void WaitForNotification() const
Definition: abseil-cpp/absl/synchronization/notification.cc:48
port_platform.h


grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:01:52