@@ -57,22 +57,34 @@ class CefResponseFilter : public virtual CefBase {
5757 virtual bool InitFilter () =0;
5858
5959 // /
60- // Called to filter a chunk of data. |data_in| is the input buffer containing
61- // |data_in_size| bytes of pre-filter data (|data_in| will be NULL if
62- // |data_in_size| is zero). |data_out| is the output buffer that can accept up
63- // to |data_out_size| bytes of filtered output data. Set |data_in_read| to the
64- // number of bytes that were read from |data_in|. Set |data_out_written| to
65- // the number of bytes that were written into |data_out|. If some or all of
66- // the pre-filter data was read successfully but more data is needed in order
67- // to continue filtering (filtered output is pending) return
68- // RESPONSE_FILTER_NEED_MORE_DATA. If some or all of the pre-filter data was
69- // read successfully and all available filtered output has been written return
70- // RESPONSE_FILTER_DONE. If an error occurs during filtering return
71- // RESPONSE_FILTER_ERROR. This method will be called repeatedly until there is
72- // no more data to filter (resource response is complete), |data_in_read|
73- // matches |data_in_size| (all available pre-filter bytes have been read), and
74- // the method returns RESPONSE_FILTER_DONE or RESPONSE_FILTER_ERROR. Do not
75- // keep a reference to the buffers passed to this method.
60+ // Called to filter a chunk of data. Expected usage is as follows:
61+ //
62+ // A. Read input data from |data_in| and set |data_in_read| to the number of
63+ // bytes that were read up to a maximum of |data_in_size|. |data_in| will
64+ // be NULL if |data_in_size| is zero.
65+ // B. Write filtered output data to |data_out| and set |data_out_written| to
66+ // the number of bytes that were written up to a maximum of
67+ // |data_out_size|. If no output data was written then all data must be
68+ // read from |data_in| (user must set |data_in_read| = |data_in_size|).
69+ // C. Return RESPONSE_FILTER_DONE if all output data was written or
70+ // RESPONSE_FILTER_NEED_MORE_DATA if output data is still pending.
71+ //
72+ // This method will be called repeatedly until the input buffer has been
73+ // fully read (user sets |data_in_read| = |data_in_size|) and there is no
74+ // more input data to filter (the resource response is complete). This method
75+ // may then be called an additional time with an empty input buffer if the
76+ // user filled the output buffer (set |data_out_written| = |data_out_size|)
77+ // and returned RESPONSE_FILTER_NEED_MORE_DATA to indicate that output data is
78+ // still pending.
79+ //
80+ // Calls to this method will stop when one of the following conditions is met:
81+ //
82+ // A. There is no more input data to filter (the resource response is
83+ // complete) and the user sets |data_out_written| = 0 or returns
84+ // RESPONSE_FILTER_DONE to indicate that all data has been written, or;
85+ // B. The user returns RESPONSE_FILTER_ERROR to indicate an error.
86+ //
87+ // Do not keep a reference to the buffers passed to this method.
7688 // /
7789 /* --cef(optional_param=data_in,default_retval=RESPONSE_FILTER_ERROR)--*/
7890 virtual FilterStatus Filter (void * data_in,
0 commit comments