Chromium Code Reviews| Index: components/cronet/ios/cronet_c_for_grpc.h |
| diff --git a/components/cronet/ios/cronet_c_for_grpc.h b/components/cronet/ios/cronet_c_for_grpc.h |
| index 187cde78de93a816b277aaf38f60205971d2645e..9e7a8ad21137dcc1d56b1ae33ea75c68941bd182 100644 |
| --- a/components/cronet/ios/cronet_c_for_grpc.h |
| +++ b/components/cronet/ios/cronet_c_for_grpc.h |
| @@ -144,6 +144,27 @@ cronet_bidirectional_stream* cronet_bidirectional_stream_create( |
| CRONET_EXPORT |
| int cronet_bidirectional_stream_destroy(cronet_bidirectional_stream* stream); |
| +/** |
| + * Disables or enables auto flush. By default, data is flushed after |
| + * every cronet_bidirectional_stream_write(). If the auto flush is disabled, |
| + * the client should explicitly call cronet_bidirectional_stream_flush to flush |
| + * the data. |
| + */ |
| +CRONET_EXPORT int cronet_bidirectional_stream_disable_auto_flush( |
| + cronet_bidirectional_stream* stream, |
| + bool disable_auto_flush); |
| + |
| +/** |
| + * Delays sending request headers until cronet_bidirectional_stream_flush() |
| + * is called. This flag is currently only respected when QUIC is negotiated. |
| + * When true, QUIC will send request header frame along with data frame(s) |
| + * as a single packet when possible. |
| + */ |
| +CRONET_EXPORT |
| +int cronet_bidirectional_stream_delay_request_headers_until_flush( |
| + cronet_bidirectional_stream* stream, |
| + bool delay_headers_until_flush); |
| + |
| /* Start the stream by sending request to |url| using |method| and |headers|. If |
| * |end_of_stream| is true, then no data is expected to be written. The |method| |
| * is HTTP verb, with PUT having a special meaning to mark idempotent request, |
| @@ -172,10 +193,9 @@ int cronet_bidirectional_stream_read(cronet_bidirectional_stream* stream, |
| char* buffer, |
| int capacity); |
| -/* Write request data from |buffer| of |buffer_length| length. Must only be |
| - * called at most once in response to each invocation of the |
| - * on_stream_ready() and on_write_completed() methods of the |
| - * cronet_bidirectional_stream_callback. |
| +/* Write request data from |buffer| of |buffer_length| length. If auto flush is |
|
xunjieli
2016/06/10 16:30:50
nit: Writes?
mef
2016/06/10 18:36:37
Done.
|
| + * disabled, data will be sent only after cronet_bidirectional_stream_flush() is |
| + * called. |
| * Each call will result in an invocation the callback's on_write_completed() |
| * method if data is sent, or its on_failed() method if there's an error. |
| * The callback's on_succeeded() method is also invoked if |end_of_stream| is |
| @@ -187,6 +207,16 @@ int cronet_bidirectional_stream_write(cronet_bidirectional_stream* stream, |
| int buffer_length, |
| bool end_of_stream); |
| +/** |
| + * Flush pending writes. This method should not be called before invocation of |
|
xunjieli
2016/06/10 16:30:50
nit: Flushes?
mef
2016/06/10 18:36:37
Done.
|
| + * on_stream_ready() method of the cronet_bidirectional_stream_callback. |
| + * For each previously called cronet_bidirectional_stream_write() |
| + * a corresponding on_write_completed() callback will be invoked when the buffer |
| + * is sent. |
| + */ |
| +CRONET_EXPORT |
| +int cronet_bidirectional_stream_flush(cronet_bidirectional_stream* stream); |
| + |
| /* Cancels the stream. Can be called at any time after |
| * cronet_bidirectional_stream_start(). The on_canceled() method of |
| * cronet_bidirectional_stream_callback will be invoked when cancelation |