Expose the real v8

Think CEF could benefit from a new feature or capability? Discuss CEF feature requests here.

Expose the real v8

Postby IngwiePhoenix » Thu Jan 30, 2014 5:31 pm

Hey!

i just want to be honest; but the v8 types within CEF are messy.

I have worked with v8 in nodejs a lot now, and got very used to the bare engine, its codign style, and things alike. But CEF seems to twist it over and about, taking out the simplicity of the API. I cant even tell what is a v8::Local and what is a v8::Persistant Ovo; This is kinda weird, because it makes v8 look like "just a tiny extension" - although you can do awesome things with JS - especially if you can embed your own code ontop.

Therefore, my suggestion is, to expose the actual v8 API in future releases. That would make embedding and reading up on docs much easier. And, to port existing v8 code to CEF too.

Kind regards, Ingwie.
IngwiePhoenix
Mentor
 
Posts: 73
Joined: Thu Nov 21, 2013 5:04 pm

Re: Expose the real v8

Postby magreenblatt » Thu Jan 30, 2014 6:30 pm

It is already possible with some minor changes. See https://code.google.com/p/chromiumembed ... ail?id=708.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: Expose the real v8

Postby IngwiePhoenix » Fri Jan 31, 2014 2:43 am

So, I have to build CEF on my own, using the supplied patch? o.O I didnt really get how the "modification" works. But I do get how the code snippet works. :)
IngwiePhoenix
Mentor
 
Posts: 73
Joined: Thu Nov 21, 2013 5:04 pm

Re: Expose the real v8

Postby magreenblatt » Fri Jan 31, 2014 9:21 am

IngwiePhoenix wrote:So, I have to build CEF on my own, using the supplied patch?

Yes, because V8 needs to be built as a separate shared library and linked from both CEF and your application.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: Expose the real v8

Postby IngwiePhoenix » Fri Jan 31, 2014 2:49 pm

Now I see - so the whole v8 engine is consumed and "hidden" within the libcef shared library. I just read the patch.
Gonna need to try this out, but hopefuly in a future release, there will be a more "easy" way to interact with the JS part, by using the actual v8 API. x3

Thanks for the help.

Kind regards, Ingwie
IngwiePhoenix
Mentor
 
Posts: 73
Joined: Thu Nov 21, 2013 5:04 pm

Re: Expose the real v8

Postby IngwiePhoenix » Sat Feb 08, 2014 5:04 pm

So, with the feeling that i MUST be possible to use the real v8 from within libcef, I decided to go and learn some more - and finally, found a way to combine the use of nm and c++filt. So, after i created a list of all symbols from the debug libcef, and then ran c++filt over it...i was quite baffled. Look!

Code: Select all
...
v8::ObjectTemplate::NewInstance()
v8::ObjectTemplate::SetAccessor(v8::Handle<v8::String>, v8::Handle<v8::DeclaredAccessorDescriptor>, v8::AccessControl, v8::PropertyAttribute, v8::Handle<v8::AccessorSignature>)
v8::ObjectTemplate::SetAccessor(v8::Handle<v8::String>, v8::Handle<v8::Value> (*)(v8::Local<v8::String>, v8::AccessorInfo const&), void (*)(v8::Local<v8::String>, v8::Local<v8::Value>, v8::AccessorInfo const&), v8::Handle<v8::Value>, v8::AccessControl, v8::PropertyAttribute, v8::Handle<v8::AccessorSignature>)
v8::ObjectTemplate::SetAccessor(v8::Handle<v8::String>, void (*)(v8::Local<v8::String>, v8::PropertyCallbackInfo<v8::Value> const&), void (*)(v8::Local<v8::String>, v8::Local<v8::Value>, v8::PropertyCallbackInfo<void> const&), v8::Handle<v8::Value>, v8::AccessControl, v8::PropertyAttribute, v8::Handle<v8::AccessorSignature>)
v8::ObjectTemplate::InternalFieldCount()
v8::ObjectTemplate::MarkAsUndetectable()
v8::ObjectTemplate::SetInternalFieldCount(int)
v8::ObjectTemplate::SetAccessCheckCallbacks(bool (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::AccessType, v8::Local<v8::Value>), bool (*)(v8::Local<v8::Object>, unsigned int, v8::AccessType, v8::Local<v8::Value>), v8::Handle<v8::Value>, bool)
v8::ObjectTemplate::SetNamedPropertyHandler(v8::Handle<v8::Value> (*)(v8::Local<v8::String>, v8::AccessorInfo const&), v8::Handle<v8::Value> (*)(v8::Local<v8::String>, v8::Local<v8::Value>, v8::AccessorInfo const&), v8::Handle<v8::Integer> (*)(v8::Local<v8::String>, v8::AccessorInfo const&), v8::Handle<v8::Boolean> (*)(v8::Local<v8::String>, v8::AccessorInfo const&), v8::Handle<v8::Array> (*)(v8::AccessorInfo const&), v8::Handle<v8::Value>)
....


Now, that actually means that I am going to try and copy the v8 headers from this distro into the CEF include folder, and try to use v8 from there. The only missing thing is, to find a way to use it with the existing API. But there was a nice example in the issue you linked before.

Anyway, I simply wanted to share that. Because that means, that we may can use the bare v8 - and for my project, thats a bless =D
IngwiePhoenix
Mentor
 
Posts: 73
Joined: Thu Nov 21, 2013 5:04 pm

Re: Expose the real v8

Postby IngwiePhoenix » Thu Feb 13, 2014 12:53 pm

Bump.
IngwiePhoenix
Mentor
 
Posts: 73
Joined: Thu Nov 21, 2013 5:04 pm


Return to Feature Request Forum

Who is online

Users browsing this forum: No registered users and 35 guests

cron