magreenblatt wrote:The "reference identity" problem can be solved by adding IsSame() methods to all CEF object types. I'm open to other ways of implementing the C API provided it can still be mostly auto-generated from the C++ API and doesn't make CEF C++ development more difficult. Suggestions?
Something like JavaScriptCore / WebKit2 API's may be.
Currently CEF C API is very like by structure organization, but works very differs in runtime.
1. All *Impl objects can persist pointer to a C wrapper (C struct), and return this C wrapper when it needed.
2. Same happens with reverse way.
After 1 & 2 will be done, we can see, that any objects can be plain C++ object with "native struct" aggregated inside, which will have (as minimum) two pointers on C++ struct (for impl / proxy), and for method table (C) for this object kind. Then other-side world can simple get pointer to this C struct.
Also, is very good to have static methods which can call virtual methods, i.e. much easy to use cef_v8value_get_string_value(v8ValueHandle) which access to real virtual method via object pointer. It is much easiest to creating other bindings for other languages.
But at this moment there is are absolutely doesn't matter, without understanding core functionality (i mean chromium/browser).
PS: WebKit2 API (WebKit's multi-process architechture, it is different from Chromium's) uses "Injection Bundles" to get closer integration with browser. InjectionBundle it is separate module, which loaded in to "renderer" process, and got important messages like didClearWindowObject, etc... I mean all JS bindings are possible now only from bundle, and as i'm understand rightly -> if any IPC required with host process -> it is end-user's zone. As for me - good idea.