-
Notifications
You must be signed in to change notification settings - Fork 10.9k
[binder] Use AParcel_getDataSize in flow-control #27257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
e0484e3
to
29ea4de
Compare
29ea4de
to
4c7395d
Compare
Ping. |
9eac98a
to
b8b0300
Compare
return AParcel_getDataSize(parcel_); | ||
} else { | ||
gpr_log(GPR_INFO, "[Warning] AParcel_getDataSize is not available"); | ||
return 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This returns 0 but ReadableParcelAndroid::GetDataSize
return -1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Both return 0.
@@ -39,34 +41,41 @@ absl::Status FakeWritableParcel::SetDataPosition(int32_t pos) { | |||
absl::Status FakeWritableParcel::WriteInt32(int32_t data) { | |||
data_[data_position_] = data; | |||
SetDataPosition(data_position_ + 1).IgnoreError(); | |||
data_size_ += 4; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably use size_of(int32_t)
instead of hardcoding the value? Same for other types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
bb8a6ed
to
ca9119a
Compare
@@ -253,6 +253,7 @@ absl::Status WireReaderImpl::ProcessStreamingTransaction( | |||
absl::Status WireReaderImpl::ProcessStreamingTransactionImpl( | |||
transaction_code_t code, const ReadableParcel* parcel, | |||
int* cancellation_flags) { | |||
num_incoming_bytes_ += parcel->GetDataSize(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put it below GPR_ASSERT
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
8a3bd94
to
918e4e1
Compare
918e4e1
to
ca3ae75
Compare
Some changes: * OnTransactCb now takes a non-const ReadableParcel* so that testing codes no longer have to rely on mutable. * Remove GetReadableParcel() interface from binder since we only sent one-way transaction and the output (readable) parcel is never used. * Remove GetDataPosition() / SetDataPosition() interfaces since they are both unused. * Some changes that should've been made to grpc#27257 but was somehow missing...
Some changes: * OnTransactCb now takes a non-const ReadableParcel* so that testing codes no longer have to rely on mutable. * Remove GetReadableParcel() interface from binder since we only sent one-way transaction and the output (readable) parcel is never used. * Remove GetDataPosition() / SetDataPosition() interfaces since they are both unused. * Some changes that should've been made to grpc#27257 but was somehow missing...
Some changes: * OnTransactCb now takes a non-const ReadableParcel* so that testing codes no longer have to rely on mutable. * Remove GetReadableParcel() interface from binder since we only sent one-way transaction and the output (readable) parcel is never used. * Remove GetDataPosition() / SetDataPosition() interfaces since they are both unused. * Some changes that should've been made to grpc#27257 but was somehow missing...
Some changes: * OnTransactCb now takes a non-const ReadableParcel* so that testing codes no longer have to rely on mutable. * Remove GetReadableParcel() interface from binder since we only sent one-way transaction and the output (readable) parcel is never used. * Remove GetDataPosition() / SetDataPosition() interfaces since they are both unused. * Some changes that should've been made to grpc#27257 but was somehow missing...
Some changes: * OnTransactCb now takes a non-const ReadableParcel* so that testing codes no longer have to rely on mutable. * Remove GetReadableParcel() interface from binder since we only sent one-way transaction and the output (readable) parcel is never used. * Remove GetDataPosition() / SetDataPosition() interfaces since they are both unused. * Some changes that should've been made to #27257 but was somehow missing...
Some changes: * OnTransactCb now takes a non-const ReadableParcel* so that testing codes no longer have to rely on mutable. * Remove GetReadableParcel() interface from binder since we only sent one-way transaction and the output (readable) parcel is never used. * Remove GetDataPosition() / SetDataPosition() interfaces since they are both unused. * Some changes that should've been made to grpc#27257 but was somehow missing...
Depends on #27243.