CEF4Delphi/docs/html/uCEFResponseFilter.TCustomResponseFilter.html
Salvador Díaz Fau 82f6d8eeb6 Added more code comments.
Added documentation for ICefResponseFilter, TCustomResponseFilter, TCefResponseFilterRef and TCefResponseFilterOwn
2024-04-20 17:46:13 +02:00

214 lines
13 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<title>cef4delphi: uCEFResponseFilter: Class TCustomResponseFilter</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="generator" content="PasDoc 0.16.0-snapshot">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="StyleSheet" type="text/css" href="pasdoc.css">
</head>
<body>
<span id="TCustomResponseFilter"></span><h1 class="cio">Class TCustomResponseFilter</h1>
<div class="sections">
<div class="one_section"><a class="section" href="#PasDoc-Description">Description</a></div><div class="one_section"><a class="section" href="#PasDoc-Hierarchy">Hierarchy</a></div><div class="one_section"><a class="section" href="#PasDoc-Fields">Fields</a></div><div class="one_section"><a class="section" href="#PasDoc-Methods">Methods</a></div><div class="one_section"><a class="section" href="#PasDoc-Properties">Properties</a></div></div>
<span id="PasDoc-Description"></span><h2 class="unit">Unit</h2>
<p class="unitlink">
<a href="uCEFResponseFilter.html">uCEFResponseFilter</a></p>
<h2 class="declaration">Declaration</h2>
<p class="declaration">
<code>type TCustomResponseFilter = class(<a class="normal" href="uCEFResponseFilter.TCefResponseFilterOwn.html">TCefResponseFilterOwn</a>)</code></p>
<h2 class="description">Description</h2>
<p>
Custom class implementing a resource filter with events. </p>
<p>
<p>The functions and events of this interface will be called on the browser process IO thread.
<p>&lt;see href=&quot;<a href="https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_response_filter_capi.h">https://bitbucket.org/chromiumembedded/cef/src/master/include/capi/cef_response_filter_capi.h</a>&quot;&gt;CEF source file: /include/capi/cef_response_filter_capi.h (cef_response_filter_t))</p>
<span id="PasDoc-Hierarchy"></span><h2 class="hierarchy">Hierarchy</h2>
<ul class="hierarchy"><li class="ancestor">TInterfacedObject</li>
<li class="ancestor"><a class="normal" href="uCEFBaseRefCounted.TCefBaseRefCountedOwn.html">TCefBaseRefCountedOwn</a></li>
<li class="ancestor"><a class="normal" href="uCEFResponseFilter.TCefResponseFilterOwn.html">TCefResponseFilterOwn</a></li>
<li class="thisitem">TCustomResponseFilter</li></ul><h2 class="overview">Overview</h2>
<span id="PasDoc-Fields"></span><h3 class="summary">Fields</h3>
<table class="summary wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><code><strong><a href="uCEFResponseFilter.TCustomResponseFilter.html#FOnFilter">FOnFilter</a></strong>: <a href="uCEFResponseFilter.html#TOnFilterEvent">TOnFilterEvent</a>;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><code><strong><a href="uCEFResponseFilter.TCustomResponseFilter.html#FOnInitFilter">FOnInitFilter</a></strong>: <a href="uCEFResponseFilter.html#TOnInitFilterEvent">TOnInitFilterEvent</a>;</code></td>
</tr>
</table>
<span id="PasDoc-Methods"></span><h3 class="summary">Methods</h3>
<table class="summary wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><code>function <strong><a href="uCEFResponseFilter.TCustomResponseFilter.html#InitFilter">InitFilter</a></strong>: Boolean; override;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><code>function <strong><a href="uCEFResponseFilter.TCustomResponseFilter.html#Filter-Pointer-NativeUInt-NativeUInt-Pointer-NativeUInt-NativeUInt-">Filter</a></strong>(data_in: Pointer; data_in_size: <a href="uCEFTypes.html#NativeUInt">NativeUInt</a>; var data_in_read: <a href="uCEFTypes.html#NativeUInt">NativeUInt</a>; data_out: Pointer; data_out_size : <a href="uCEFTypes.html#NativeUInt">NativeUInt</a>; var data_out_written: <a href="uCEFTypes.html#NativeUInt">NativeUInt</a>): <a href="uCEFTypes.html#TCefResponseFilterStatus">TCefResponseFilterStatus</a>; override;</code></td>
</tr>
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>constructor <strong><a href="uCEFResponseFilter.TCustomResponseFilter.html#Create">Create</a></strong>; override;</code></td>
</tr>
</table>
<span id="PasDoc-Properties"></span><h3 class="summary">Properties</h3>
<table class="summary wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>property <strong><a href="uCEFResponseFilter.TCustomResponseFilter.html#OnFilter">OnFilter</a></strong> : <a href="uCEFResponseFilter.html#TOnFilterEvent">TOnFilterEvent</a> read <a href="uCEFResponseFilter.TCustomResponseFilter.html#FOnFilter">FOnFilter</a> write <a href="uCEFResponseFilter.TCustomResponseFilter.html#FOnFilter">FOnFilter</a>;</code></td>
</tr>
<tr class="list2">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><code>property <strong><a href="uCEFResponseFilter.TCustomResponseFilter.html#OnInitFilter">OnInitFilter</a></strong> : <a href="uCEFResponseFilter.html#TOnInitFilterEvent">TOnInitFilterEvent</a> read <a href="uCEFResponseFilter.TCustomResponseFilter.html#FOnInitFilter">FOnInitFilter</a> write <a href="uCEFResponseFilter.TCustomResponseFilter.html#FOnInitFilter">FOnInitFilter</a>;</code></td>
</tr>
</table>
<h2 class="description">Description</h2>
<h3 class="detail">Fields</h3>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><span id="FOnFilter"></span><code><strong>FOnFilter</strong>: <a href="uCEFResponseFilter.html#TOnFilterEvent">TOnFilterEvent</a>;</code></td>
</tr>
<tr><td colspan="2">
<p class="nodescription">This item has no description.</p></td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><span id="FOnInitFilter"></span><code><strong>FOnInitFilter</strong>: <a href="uCEFResponseFilter.html#TOnInitFilterEvent">TOnInitFilterEvent</a>;</code></td>
</tr>
<tr><td colspan="2">
<p class="nodescription">This item has no description.</p></td></tr>
</table>
<h3 class="detail">Methods</h3>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><span id="InitFilter"></span><code>function <strong>InitFilter</strong>: Boolean; override;</code></td>
</tr>
<tr><td colspan="2">
<p class="inheritdescription">This item has no description. Showing description inherited from <a class="normal" href="uCEFResponseFilter.TCefResponseFilterOwn.html#InitFilter">TCefResponseFilterOwn.InitFilter</a>.</p><p>
Initialize the response filter. Will only be called a single time. The filter will not be installed if this function returns false (0). </p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="protected.gif" alt="Protected" title="Protected"></a></td>
<td class="itemcode"><span id="Filter-Pointer-NativeUInt-NativeUInt-Pointer-NativeUInt-NativeUInt-"></span><code>function <strong>Filter</strong>(data_in: Pointer; data_in_size: <a href="uCEFTypes.html#NativeUInt">NativeUInt</a>; var data_in_read: <a href="uCEFTypes.html#NativeUInt">NativeUInt</a>; data_out: Pointer; data_out_size : <a href="uCEFTypes.html#NativeUInt">NativeUInt</a>; var data_out_written: <a href="uCEFTypes.html#NativeUInt">NativeUInt</a>): <a href="uCEFTypes.html#TCefResponseFilterStatus">TCefResponseFilterStatus</a>; override;</code></td>
</tr>
<tr><td colspan="2">
<p class="inheritdescription">This item has no description. Showing description inherited from <a class="normal" href="uCEFResponseFilter.TCefResponseFilterOwn.html#Filter-Pointer-NativeUInt-NativeUInt-Pointer-NativeUInt-NativeUInt-">TCefResponseFilterOwn.Filter</a>.</p><p>
<p>Called to filter a chunk of data. Expected usage is as follows:
<p></p>
<pre class="preformatted">
1. Read input data from |data_in| and set |data_in_read| to the number of
bytes that were read up to a maximum of |data_in_size|. |data_in| will
be NULL if |data_in_size| is zero.
2. Write filtered output data to |data_out| and set |data_out_written| to
the number of bytes that were written up to a maximum of
|data_out_size|. If no output data was written then all data must be
read from |data_in| (user must set |data_in_read| = |data_in_size|).
3. Return RESPONSE_FILTER_DONE if all output data was written or
RESPONSE_FILTER_NEED_MORE_DATA if output data is still pending.</pre>
<p>
<p>This function will be called repeatedly until the input buffer has been fully read (user sets |data_in_read| = |data_in_size|) and there is no more input data to filter (the resource response is complete). This function may then be called an additional time with an NULL input buffer if the user filled the output buffer (set |data_out_written| = |data_out_size|) and returned RESPONSE_FILTER_NEED_MORE_DATA to indicate that output data is still pending.
<p>Calls to this function will stop when one of the following conditions is met:
<p></p>
<pre class="preformatted">
1. There is no more input data to filter (the resource response is
complete) and the user sets |data_out_written| = 0 or returns
RESPONSE_FILTER_DONE to indicate that all data has been written, or;
2. The user returns RESPONSE_FILTER_ERROR to indicate an error.</pre>
<p>
<p>Do not keep a reference to the buffers passed to this function.
<p></p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="Create"></span><code>constructor <strong>Create</strong>; override;</code></td>
</tr>
<tr><td colspan="2">
<p class="nodescription">This item has no description.</p></td></tr>
</table>
<h3 class="detail">Properties</h3>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="OnFilter"></span><code>property <strong>OnFilter</strong> : <a href="uCEFResponseFilter.html#TOnFilterEvent">TOnFilterEvent</a> read <a href="uCEFResponseFilter.TCustomResponseFilter.html#FOnFilter">FOnFilter</a> write <a href="uCEFResponseFilter.TCustomResponseFilter.html#FOnFilter">FOnFilter</a>;</code></td>
</tr>
<tr><td colspan="2">
<p>
<p>OnFilter is triggered when ICefResponseFilter.Filter is executed to filter a chunk of data.
<p>Expected usage is as follows:
<p></p>
<pre class="preformatted">
1. Read input data from |data_in| and set |data_in_read| to the number of
bytes that were read up to a maximum of |data_in_size|. |data_in| will
be NULL if |data_in_size| is zero.
2. Write filtered output data to |data_out| and set |data_out_written| to
the number of bytes that were written up to a maximum of
|data_out_size|. If no output data was written then all data must be
read from |data_in| (user must set |data_in_read| = |data_in_size|).
3. Return RESPONSE_FILTER_DONE if all output data was written or
RESPONSE_FILTER_NEED_MORE_DATA if output data is still pending.</pre>
<p>
<p>This function will be called repeatedly until the input buffer has been fully read (user sets |data_in_read| = |data_in_size|) and there is no more input data to filter (the resource response is complete). This function may then be called an additional time with an NULL input buffer if the user filled the output buffer (set |data_out_written| = |data_out_size|) and returned RESPONSE_FILTER_NEED_MORE_DATA to indicate that output data is still pending.
<p>Calls to this function will stop when one of the following conditions is met:
<p></p>
<pre class="preformatted">
1. There is no more input data to filter (the resource response is
complete) and the user sets |data_out_written| = 0 or returns
RESPONSE_FILTER_DONE to indicate that all data has been written, or;
2. The user returns RESPONSE_FILTER_ERROR to indicate an error.</pre>
<p>
<p>Do not keep a reference to the buffers passed to this function.
<p></p>
</td></tr>
</table>
<table class="detail wide_list">
<tr class="list">
<td class="visibility"><a href="legend.html"><img src="public.gif" alt="Public" title="Public"></a></td>
<td class="itemcode"><span id="OnInitFilter"></span><code>property <strong>OnInitFilter</strong> : <a href="uCEFResponseFilter.html#TOnInitFilterEvent">TOnInitFilterEvent</a> read <a href="uCEFResponseFilter.TCustomResponseFilter.html#FOnInitFilter">FOnInitFilter</a> write <a href="uCEFResponseFilter.TCustomResponseFilter.html#FOnInitFilter">FOnInitFilter</a>;</code></td>
</tr>
<tr><td colspan="2">
<p>
OnInitFilter is triggered when ICefResponseFilter.InitFilter is executed. Set the aResult parameter to install the filter. </p>
</td></tr>
</table>
<hr><span class="appinfo"><em>Generated by <a href="https://pasdoc.github.io/">PasDoc 0.16.0-snapshot</a>. </em>
</span>
</body></html>