Skip to content

Commit 4785c9c

Browse files
mabakojushar
authored andcommitted
add a parameter to reloadBrowserPage() to allow for ignoring the cache
1 parent aa43c2f commit 4785c9c

File tree

6 files changed

+17
-8
lines changed

6 files changed

+17
-8
lines changed

MTA10/core/CWebView.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,12 +413,19 @@ bool CWebView::GoForward ()
413413
return true;
414414
}
415415

416-
void CWebView::Refresh ()
416+
void CWebView::Refresh ( bool bIgnoreCache )
417417
{
418418
if ( !m_pWebView )
419419
return;
420420

421-
m_pWebView->Reload ();
421+
if ( bIgnoreCache )
422+
{
423+
m_pWebView->ReloadIgnoreCache ();
424+
}
425+
else
426+
{
427+
m_pWebView->Reload ();
428+
}
422429
}
423430

424431
////////////////////////////////////////////////////////////////////

MTA10/core/CWebView.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class CWebView : public CWebViewInterface, private CefClient, private CefRenderH
8787
bool CanGoForward ();
8888
bool GoBack ();
8989
bool GoForward ();
90-
void Refresh ();
90+
void Refresh ( bool ignoreCache );
9191

9292
// CefClient methods
9393
virtual CefRefPtr<CefRenderHandler> GetRenderHandler() override { return this; };

MTA10/mods/shared_logic/CClientWebBrowser.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,9 @@ bool CClientWebBrowser::GoForward ()
156156
return m_pWebView->GoForward ();
157157
}
158158

159-
void CClientWebBrowser::Refresh ()
159+
void CClientWebBrowser::Refresh ( bool bIgnoreCache )
160160
{
161-
m_pWebView->Refresh ();
161+
m_pWebView->Refresh ( bIgnoreCache );
162162
}
163163

164164
////////////////////////////////////////////////////////////////////////////

MTA10/mods/shared_logic/CClientWebBrowser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class CClientWebBrowser : public CClientTexture, public CWebBrowserEventsInterfa
6565
bool CanGoForward ();
6666
bool GoBack ();
6767
bool GoForward ();
68-
void Refresh ();
68+
void Refresh ( bool bIgnoreCache );
6969

7070
// CWebBrowserEventsInterface implementation
7171
void Events_OnCreated () override;

MTA10/mods/shared_logic/luadefs/CLuaBrowserDefs.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,13 +793,15 @@ int CLuaBrowserDefs::ReloadBrowserPage( lua_State* luaVM )
793793
{
794794
// bool reloadBrowserPage( browser webBrowser )
795795
CClientWebBrowser* pWebBrowser;
796+
bool bIgnoreCache;
796797

797798
CScriptArgReader argStream ( luaVM );
798799
argStream.ReadUserData ( pWebBrowser );
800+
argStream.ReadIfNextIsBool ( bIgnoreCache, false );
799801

800802
if ( !argStream.HasErrors () )
801803
{
802-
pWebBrowser->Refresh ();
804+
pWebBrowser->Refresh ( bIgnoreCache );
803805
lua_pushboolean ( luaVM, true );
804806
return 1;
805807
}

MTA10/sdk/core/CWebViewInterface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class CWebViewInterface
6161
virtual bool CanGoForward () = 0;
6262
virtual bool GoBack () = 0;
6363
virtual bool GoForward () = 0;
64-
virtual void Refresh () = 0;
64+
virtual void Refresh ( bool bIgnoreCache ) = 0;
6565
};
6666

6767
#endif

0 commit comments

Comments
 (0)