1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-05-13 21:46:53 +02:00
Fixed an issue in SchemeRegistrationBrowser with big streams. Now THelloScheme.ReadResponse copies the stream in chunks correctly.
This commit is contained in:
Salvador Díaz Fau 2019-01-17 14:53:02 +01:00
parent 395e76afce
commit 9e12b2258b
4 changed files with 8 additions and 4 deletions

View File

@ -13,5 +13,7 @@ Local SWF file.<br>
You need to install the Adobe Flash PPAPI plugin to view the SWF file.</p> You need to install the Adobe Flash PPAPI plugin to view the SWF file.</p>
<p><img src='jupiter.png'><br>Bigger image</p>
</body> </body>
</html> </html>

View File

@ -201,9 +201,11 @@ function THelloScheme.ReadResponse(const dataOut : Pointer;
begin begin
if (FStream <> nil) and (DataOut <> nil) then if (FStream <> nil) and (DataOut <> nil) then
begin begin
FStream.Seek(0, soFromBeginning); // This function will be called several times because the stream is bigger
// than bytesToRead. Each time we will copy a chunk of the stream to
// DataOut.
BytesRead := FStream.Read(DataOut^, BytesToRead); BytesRead := FStream.Read(DataOut^, BytesToRead);
Result := True; Result := (BytesRead > 0);
end end
else else
Result := False; Result := False;

View File

@ -52,7 +52,7 @@ object SchemeRegistrationBrowserFrm: TSchemeRegistrationBrowserFrm
Align = alClient Align = alClient
ItemIndex = 1 ItemIndex = 1
TabOrder = 1 TabOrder = 1
Text = 'hello://simplexsl.xml' Text = 'hello://test.html'
Items.Strings = ( Items.Strings = (
'https://www.google.com' 'https://www.google.com'
'hello://test.html') 'hello://test.html')

View File

@ -51,7 +51,7 @@ uses
Controls, Forms, Dialogs, StdCtrls, ExtCtrls, Types, ComCtrls, ClipBrd, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, Types, ComCtrls, ClipBrd,
{$ENDIF} {$ENDIF}
uCEFChromium, uCEFWindowParent, uCEFInterfaces, uCEFApplication, uCEFSchemeRegistrar, uCEFChromium, uCEFWindowParent, uCEFInterfaces, uCEFApplication, uCEFSchemeRegistrar,
uCEFTypes, uCEFConstants; uCEFTypes, uCEFConstants, uCEFWinControl;
const const
MINIBROWSER_CONTEXTMENU_REGSCHEME = MENU_ID_USER_FIRST + 1; MINIBROWSER_CONTEXTMENU_REGSCHEME = MENU_ID_USER_FIRST + 1;