Handler in libcef_dll_wrapper
Posted: Fri May 31, 2019 1:31 pm
Hi there,
I am working on a swift project which needs to use the message router in the libcef_dll_wrapper. I did all the bridging including the capi and cpptoc classes. But there are several APIs in CefMessageRouterBrowserSide class:
Seems the Handler param in these functions is raw pointer instead of CefRefPtr. Which makes the bridging painful.
I saw that the Hanlder is based on CefBaseRefCounted, so is it possible that we use the refptr instead of raw pointers? For example:
I have made the changes in libcef_dll_wrapper project on my local machine, and it works fine.
But I believe such change will effect the client_handler class and several testing classes outside libcef_dll_wrapper. I can try to get them changed together and make a pull request if possible.
I am working on a swift project which needs to use the message router in the libcef_dll_wrapper. I did all the bridging including the capi and cpptoc classes. But there are several APIs in CefMessageRouterBrowserSide class:
- Code: Select all
virtual bool AddHandler(Hanlder* handler, bool first) = 0;
virtual bool RemoveHandler(Hanlder* handler) = 0;
virtual void CancelPending(CefRefPtr<CefBrowser> browser,
Hanlder* handler) = 0;
virtual int GetPendingCount(CefRefPtr<CefBrowser> browser,
Hanlder* handler) = 0;
Seems the Handler param in these functions is raw pointer instead of CefRefPtr. Which makes the bridging painful.
I saw that the Hanlder is based on CefBaseRefCounted, so is it possible that we use the refptr instead of raw pointers? For example:
- Code: Select all
virtual bool AddHandler(CefRefPtr<Handler> handler, bool first) = 0;
I have made the changes in libcef_dll_wrapper project on my local machine, and it works fine.
But I believe such change will effect the client_handler class and several testing classes outside libcef_dll_wrapper. I can try to get them changed together and make a pull request if possible.