Commit Graph

3 Commits

Author SHA1 Message Date
Alex Maitland b5a83f526e Enhancement - Pluggable Javascript Naming (#3141)
* Core - Move NameConverter to IJavascriptObjectRepository

- Move NameConverter property from BindingOptions to IJavascriptObjectRepository
- Remove BindingOptions.CamelCaseJavascriptNames

**Breaking Change**

Follow up to https://github.com/cefsharp/CefSharp/commit/898ca38e7a7261b3a42c33b2abf5eac6c022ddde

* Core - Javascript Binding Pluggable Naming Improvements

- Added some basic unit tests (more required)
- DefaultBinder now accepts a IJavascriptNameConverter passed into the constructor
  to allow for conversion of names

* Core - Replace WeakReference with WeakReference<T>
2020-07-27 20:13:16 +10:00
amaitland 25ab209380 MethodRunnerQueue/ConcurrentMethodRunnerQueue - Remove custom task execution queue
- ConcurrentMethodRunnerQueue we now directly queue tasks on TaskScheduler.Default
- MethodRunnerQueue now uses LimitedConcurrencyLevelTaskScheduler (example from Microsoft) to limit execution to one concurrent task
- MethodRunnerQueue tasks are now run on the ThreadPool directly instead of our own custom thread, should have some threading implications
for user
- IMethodRunnerQueue now implements IDisposable

Resolves #2873
2019-09-06 11:05:18 +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