Missing callback registry for browsers created without registered js objects #1335
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Branch master, currently 7aa1287
I discovered this issue when investigating the erroneous execution of
in the CefSharp.OffScreen.Example
Since e9675a2
In this commit the execution of evaluated script will stop if no root object could be found as the evaluated script could create a callback during the
SerializeV8Object(result, responseArgList, 2, callbackRegistry);
call.Browsers no object (sync & asnyc) has been registered will not hold a root object and therefore, no callback registry which would, prior to e9675a2, lead to an exception when the evaluted javascript source code would return a callback function.
This leads to the CefSharp.OffScreen.Example not executing properly. Of course, if the check for a missing root object would be removed the example would execute. However, callback functions could not be used.
Therefore, I think that a root object should be created even if no objects have been registered. The root object itself checks if a sync / async object exists and will therefore, only act as a manager for the callbacks which should not be too heavy.