Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

JS ArrayBuffer and others

Post Reply
User avatar
salvadordf
Posts: 4052
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: JS ArrayBuffer and others

Post by salvadordf »

Read the JavaScript integration Wiki page to know the details about "working with contexts" :
https://bitbucket.org/chromiumembedded/ ... h-contexts

The JSWindowBindingWithArrayBuffer demo uses the OnContextCreated event to create the ArrayBuffer but the tests in the official CEF project use the GlobalCEFApp.OnProcessMessageReceived event and call frame.GetV8Context.Enter and frame.GetV8Context.Exit to create the ArrayBuffer.

Notice that the GlobalCEFApp.OnProcessMessageReceived event is executed in the TID_RENDERER thread that belongs to the renderer process.
V8 functions can only be used on the main thread (TID_RENDERER) in the renderer process.

The JSEval demo uses the same event and context calls to evaluate some JavaScript :
https://github.com/salvadordf/CEF4Delph ... l.pas#L510
Post Reply