From 22fac75268360e2993e085d5ed3e01802662e64d Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Fri, 8 Nov 2013 00:13:38 +0100 Subject: [PATCH] =?UTF-8?q?#209.=20Let=E2=80=99s=20make=20it=20a=20bit=20m?= =?UTF-8?q?ore=20apparent=20that=20we=20are=20doing=20stuff=20asynchronous?= =?UTF-8?q?ly.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CefSharp.Wpf/WebView.cs | 4 ++-- CefSharp/IWebBrowser.h | 15 ++++++++------- CefSharp/ManagedCefBrowserAdapter.h | 4 ++-- CefSharp/ScriptCore.cpp | 2 +- CefSharp/ScriptCore.h | 2 +- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/CefSharp.Wpf/WebView.cs b/CefSharp.Wpf/WebView.cs index 486e42129..557bf69b1 100644 --- a/CefSharp.Wpf/WebView.cs +++ b/CefSharp.Wpf/WebView.cs @@ -706,9 +706,9 @@ namespace CefSharp.Wpf throw new NotImplementedException(); } - public void ExecuteScript(string script) + public void ExecuteScriptAsync(string script) { - managedCefBrowserAdapter.ExecuteScript(script); + managedCefBrowserAdapter.ExecuteScriptAsync(script); } public object EvaluateScript(string script) diff --git a/CefSharp/IWebBrowser.h b/CefSharp/IWebBrowser.h index 2d35e25e3..bc4d7a3d6 100644 --- a/CefSharp/IWebBrowser.h +++ b/CefSharp/IWebBrowser.h @@ -53,22 +53,23 @@ namespace CefSharp void RegisterJsObject(String^ name, Object^ objectToBind); /// - /// Execute some Javascript code in the context of this WebBrowser. + /// Execute some JavaScript code in the context of this WebBrowser. As the method name implies, the script will be + /// executed asynchronously, and the method therefore returns before the script has actually been executed. /// - /// The Javascript code that should be executed. - void ExecuteScript(String^ script); + /// The JavaScript code that should be executed. + void ExecuteScriptAsync(String^ script); /// - /// Execute some Javascript code in the context of this WebBrowser, and return the result of the evaluation. + /// Execute some JavaScript code in the context of this WebBrowser, and return the result of the evaluation. /// - /// The Javascript code that should be executed. + /// The JavaScript code that should be executed. Object^ EvaluateScript(String^ script); /// - /// Execute some Javascript code in the context of this WebBrowser, and return the result of the evaluation. + /// Execute some JavaScript code in the context of this WebBrowser, and return the result of the evaluation. /// /// The Javascript code that should be executed. - /// The timeout after which the Javascript code execution should be aborted. + /// The timeout after which the JavaScript code execution should be aborted. Object^ EvaluateScript(String^ script, Nullable timeout); }; } diff --git a/CefSharp/ManagedCefBrowserAdapter.h b/CefSharp/ManagedCefBrowserAdapter.h index 3a4e1d46e..513dfa8ea 100644 --- a/CefSharp/ManagedCefBrowserAdapter.h +++ b/CefSharp/ManagedCefBrowserAdapter.h @@ -244,13 +244,13 @@ namespace CefSharp } } - void ExecuteScript(String^ script) + void ExecuteScriptAsync(String^ script) { auto browser = _renderClientAdapter->GetCefBrowser(); if (browser != nullptr) { - _scriptCore->Execute(browser, StringUtils::ToNative(script)); + _scriptCore->ExecuteAsync(browser, StringUtils::ToNative(script)); } } diff --git a/CefSharp/ScriptCore.cpp b/CefSharp/ScriptCore.cpp index 47d22bfb7..cf3e644ba 100644 --- a/CefSharp/ScriptCore.cpp +++ b/CefSharp/ScriptCore.cpp @@ -31,7 +31,7 @@ namespace CefSharp } } - void ScriptCore::Execute(CefRefPtr browser, CefString script) + void ScriptCore::ExecuteAsync(CefRefPtr browser, CefString script) { if (CefCurrentlyOn(TID_UI)) { diff --git a/CefSharp/ScriptCore.h b/CefSharp/ScriptCore.h index 58abf27a8..8445aeff7 100644 --- a/CefSharp/ScriptCore.h +++ b/CefSharp/ScriptCore.h @@ -25,7 +25,7 @@ namespace CefSharp _event = CreateEvent(NULL, FALSE, FALSE, NULL); } - DECL void Execute(CefRefPtr browser, CefString script); + DECL void ExecuteAsync(CefRefPtr browser, CefString script); IMPLEMENT_LOCKING(ScriptCore); IMPLEMENT_REFCOUNTING(ScriptCore);