Apply suggestions from code review

Co-authored-by: VZ <vz-github@zeitlins.org>
This commit is contained in:
Tobias Taschner
2021-11-05 09:41:39 +01:00
committed by GitHub
parent 0921d0508a
commit 8613f3aa6b
3 changed files with 5 additions and 4 deletions

View File

@@ -156,7 +156,7 @@ public:
bool m_creating; bool m_creating;
#if wxUSE_WEBVIEW_WEBKIT2 #if wxUSE_WEBVIEW_WEBKIT2
// This methods needs to be public to make it callable from a callback // This method needs to be public to make it callable from a callback
void ProcessJavaScriptResult(GAsyncResult *res, wxWebKitRunScriptParams* params) const; void ProcessJavaScriptResult(GAsyncResult *res, wxWebKitRunScriptParams* params) const;
#endif #endif

View File

@@ -24,7 +24,8 @@
class wxJSScriptWrapper class wxJSScriptWrapper
{ {
public: public:
enum OutputType { enum OutputType
{
JS_OUTPUT_STRING, // All return types are converted to a string JS_OUTPUT_STRING, // All return types are converted to a string
JS_OUTPUT_WEBKIT, // Some return types will be processed JS_OUTPUT_WEBKIT, // Some return types will be processed
JS_OUTPUT_IE, // Most return types will be processed JS_OUTPUT_IE, // Most return types will be processed

View File

@@ -228,7 +228,7 @@ wxString wxWebView::GetUserAgent() const
bool wxWebView::RunScript(const wxString& javascript, wxString* output) const bool wxWebView::RunScript(const wxString& javascript, wxString* output) const
{ {
m_syncScriptResult = -1; m_syncScriptResult = -1;
m_syncScriptOutput.Clear(); m_syncScriptOutput.clear();
RunScriptAsync(javascript, (void*)this); RunScriptAsync(javascript, (void*)this);
// Wait for script exection // Wait for script exection
@@ -249,7 +249,7 @@ void wxWebView::RunScriptAsync(const wxString& WXUNUSED(javascript),
void wxWebView::SendScriptResult(void* clientData, bool success, void wxWebView::SendScriptResult(void* clientData, bool success,
const wxString& output) const const wxString& output) const
{ {
// If currently running sync RunScript() don't send an event, but use // If currently running sync RunScript(), don't send an event, but use
// the scripts result directly // the scripts result directly
if (m_syncScriptResult == -1) if (m_syncScriptResult == -1)
{ {