Commit Graph

9 Commits

Author SHA1 Message Date
Alex Maitland 8b247a6a37 Javascript Binding - IJavascriptCallbackProxy.ExecuteAsync correctly creates pending task using callback Id
- Previously a new PendingTask(TaskCompletionSource) was created using a new Id which worked when the Ids matched
  between the browser and render process. If you skipped executing a callback then the Ids would get out of sync.

Issue #3979
2022-01-27 16:03:22 +10:00
Alex Maitland 9214052868 Javascript Binding - Add/Improve examples 2021-02-26 12:16:50 +10:00
Alex Maitland 6d9f214196 Javascript Callback - Add very basic support for executing a Promise
It's a manual process at this stage and requires the end user to deal to:
- Return "CefSharpDefEvalScriptRes" immediately after the promise function has been created
- Call cefSharp.sendEvalScriptResponse when the async/await (promise) processing has completed
2021-02-15 13:43:51 +10:00
Alex Maitland ab8223d4b9 Core - Add IAsyncMethodInterceptor (#3296)
Core - Add IAsyncMethodInterceptor
  - Add IAsyncMethodInterceptor
    Extension of IMethodInterceptor to allow for easier evaluation of async taskScheduler
  - Add Additional unit tests
  - Add JavascriptBindingSettings.AlwaysInterceptAsynchronously for cases where you'd like all method calls to use 
    IAsyncMethodInterceptor.InterceptAsync

Follow up to PR #3291

Co-authored-by: Andrew Sampson <andrew@rainway.com>
Co-authored-by: Emily Hudson <emily33901@gmail.com>
2021-01-09 13:17:50 +10:00
Alex Maitland 83ae9399dd Core - MethodRunnerQueue use TaskCreationOptions.HideScheduler to
To prevent subtasks from attempting to use our LimitedConcurrencyLevelTaskScheduler we need to
specify TaskCreationOptions.HideScheduler when creating the Task

Resolves #3293
2020-11-25 15:16:57 +10:00
amaitland e438e22741 Example - Add JSB Qunit Tests for Binder UInt conversion
Issue #2906
2019-09-27 08:07:37 +10:00
amaitland 750fc9f22e Javascript Binding - Add support for JsonString
JsonString is parsed into CefValue using the CefParseJson function
If your data is already stored in JSON then it can be parsed directly
or you can use a serializer of your choosing to turn a object into JSON
2019-07-20 12:11:43 +10:00
Alex Maitland fe98124c9b Async JavascriptBinding - Add support for returning Task (#2771)
* Async JavascriptBinding - Add support for returning Task

Remove Parallel Task execution code from MethodRunnerQueue
Add ParallelMethodRunnerQueue
  - For the new code path the Func is executed, if the Result is a generic Task we wait for it's completion
  - If the task is not generic then we return immediately

This is only enabled when CefSharpSettings.ConcurrentTaskExecution = true;
* MethodRunnerQueue - Display error message when method returns Task
* ParallelMethodRunnerQueue - Rename to ConcurrentMethodRunnerQueue
* MethodRunnerQueue - Improve formatting of error message when method returns Task
* Async JavascriptBinding Return Task - Add Basic xUnit Test

Very quick test, needs to be refined a little. The basics are working as expected.

* Add Binding Test Async Task Example to the WPF Example menu

* Async JSB Task - Add additional tests and improve error messaging
2019-06-08 17:21:49 +10:00
amaitland 4f71295941 CefSharp.Example - Move example classes into handlers/javascriptbinding folders/namespaces
Basic code cleanup
2018-10-29 16:21:42 +10:00