diff --git a/native/atom_cef_render_process_handler.h b/native/atom_cef_render_process_handler.h index c6d979e8b..edb49888b 100644 --- a/native/atom_cef_render_process_handler.h +++ b/native/atom_cef_render_process_handler.h @@ -16,7 +16,18 @@ class AtomCefRenderProcessHandler : public CefRenderProcessHandler { virtual bool OnProcessMessageReceived(CefRefPtr browser, CefProcessId source_process, CefRefPtr message) OVERRIDE; - + virtual void OnWorkerContextCreated(int worker_id, + const CefString& url, + CefRefPtr context) OVERRIDE; + virtual void OnWorkerContextReleased(int worker_id, + const CefString& url, + CefRefPtr context) OVERRIDE; + virtual void OnWorkerUncaughtException(int worker_id, + const CefString& url, + CefRefPtr context, + CefRefPtr exception, + CefRefPtr stackTrace) OVERRIDE; + void Reload(CefRefPtr browser); void Shutdown(CefRefPtr browser); bool CallMessageReceivedHandler(CefRefPtr context, CefRefPtr message); diff --git a/native/atom_cef_render_process_handler.mm b/native/atom_cef_render_process_handler.mm index 2d5a82cf6..0c6f5ac4a 100644 --- a/native/atom_cef_render_process_handler.mm +++ b/native/atom_cef_render_process_handler.mm @@ -29,6 +29,30 @@ void AtomCefRenderProcessHandler::OnContextReleased(CefRefPtr browse [PathWatcher removePathWatcherForContext:context]; } + + +void AtomCefRenderProcessHandler::OnWorkerContextCreated(int worker_id, + const CefString& url, + CefRefPtr context) { + v8_extensions::Native::CreateContextBinding(context); +} + +void AtomCefRenderProcessHandler::OnWorkerContextReleased(int worker_id, + const CefString& url, + CefRefPtr context) { + NSLog(@"Web worker context released"); +} + +void AtomCefRenderProcessHandler::OnWorkerUncaughtException(int worker_id, + const CefString& url, + CefRefPtr context, + CefRefPtr exception, + CefRefPtr stackTrace) { + + std::string message = exception->GetMessage().ToString(); + NSLog(@"Exception throw in worker thread %s", message.c_str()); +} + bool AtomCefRenderProcessHandler::OnProcessMessageReceived(CefRefPtr browser, CefProcessId source_process, CefRefPtr message) {