|
|
|
@ -140,8 +140,7 @@ class FlowControlTrace { |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// Fat interface with all methods a flow control implementation needs to
|
|
|
|
|
// support. gRPC C Core does not support pure virtual functions, so instead
|
|
|
|
|
// we abort in any methods which require implementation in the base class.
|
|
|
|
|
// support.
|
|
|
|
|
class TransportFlowControlBase { |
|
|
|
|
public: |
|
|
|
|
TransportFlowControlBase() {} |
|
|
|
@ -149,30 +148,30 @@ class TransportFlowControlBase { |
|
|
|
|
|
|
|
|
|
// Is flow control enabled? This is needed in other codepaths like the checks
|
|
|
|
|
// in parsing and in writing.
|
|
|
|
|
virtual bool flow_control_enabled() const { abort(); } |
|
|
|
|
virtual bool flow_control_enabled() const = 0; |
|
|
|
|
|
|
|
|
|
// Called to check if the transport needs to send a WINDOW_UPDATE frame
|
|
|
|
|
virtual uint32_t MaybeSendUpdate(bool /* writing_anyway */) { abort(); } |
|
|
|
|
virtual uint32_t MaybeSendUpdate(bool /* writing_anyway */) = 0; |
|
|
|
|
|
|
|
|
|
// Using the protected members, returns and Action to be taken by the
|
|
|
|
|
// tranport.
|
|
|
|
|
virtual FlowControlAction MakeAction() { abort(); } |
|
|
|
|
virtual FlowControlAction MakeAction() = 0; |
|
|
|
|
|
|
|
|
|
// Using the protected members, returns and Action to be taken by the
|
|
|
|
|
// tranport. Also checks for updates to our BDP estimate and acts
|
|
|
|
|
// accordingly.
|
|
|
|
|
virtual FlowControlAction PeriodicUpdate() { abort(); } |
|
|
|
|
virtual FlowControlAction PeriodicUpdate() = 0; |
|
|
|
|
|
|
|
|
|
// Called to do bookkeeping when a stream owned by this transport sends
|
|
|
|
|
// data on the wire
|
|
|
|
|
virtual void StreamSentData(int64_t /* size */) { abort(); } |
|
|
|
|
virtual void StreamSentData(int64_t /* size */) = 0; |
|
|
|
|
|
|
|
|
|
// Called to do bookkeeping when a stream owned by this transport receives
|
|
|
|
|
// data from the wire. Also does error checking for frame size.
|
|
|
|
|
virtual grpc_error* RecvData(int64_t /* incoming_frame_size */) { abort(); } |
|
|
|
|
virtual grpc_error* RecvData(int64_t /* incoming_frame_size */) = 0; |
|
|
|
|
|
|
|
|
|
// Called to do bookkeeping when we receive a WINDOW_UPDATE frame.
|
|
|
|
|
virtual void RecvUpdate(uint32_t /* size */) { abort(); } |
|
|
|
|
virtual void RecvUpdate(uint32_t /* size */) = 0; |
|
|
|
|
|
|
|
|
|
// Returns the BdpEstimator held by this object. Caller is responsible for
|
|
|
|
|
// checking for nullptr. TODO(ncteisen): consider fully encapsulating all
|
|
|
|
|