mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2025-01-01 03:03:09 +03:00
Inject $native
into WebWorker contexts
This is just to make sure it works. Will inject the remaining extensions when they are converted to from v8 extensions to context bindings.
This commit is contained in:
parent
faaaaec846
commit
47420c2e01
@ -16,7 +16,18 @@ class AtomCefRenderProcessHandler : public CefRenderProcessHandler {
|
||||
virtual bool OnProcessMessageReceived(CefRefPtr<CefBrowser> browser,
|
||||
CefProcessId source_process,
|
||||
CefRefPtr<CefProcessMessage> message) OVERRIDE;
|
||||
|
||||
virtual void OnWorkerContextCreated(int worker_id,
|
||||
const CefString& url,
|
||||
CefRefPtr<CefV8Context> context) OVERRIDE;
|
||||
virtual void OnWorkerContextReleased(int worker_id,
|
||||
const CefString& url,
|
||||
CefRefPtr<CefV8Context> context) OVERRIDE;
|
||||
virtual void OnWorkerUncaughtException(int worker_id,
|
||||
const CefString& url,
|
||||
CefRefPtr<CefV8Context> context,
|
||||
CefRefPtr<CefV8Exception> exception,
|
||||
CefRefPtr<CefV8StackTrace> stackTrace) OVERRIDE;
|
||||
|
||||
void Reload(CefRefPtr<CefBrowser> browser);
|
||||
void Shutdown(CefRefPtr<CefBrowser> browser);
|
||||
bool CallMessageReceivedHandler(CefRefPtr<CefV8Context> context, CefRefPtr<CefProcessMessage> message);
|
||||
|
@ -29,6 +29,30 @@ void AtomCefRenderProcessHandler::OnContextReleased(CefRefPtr<CefBrowser> browse
|
||||
[PathWatcher removePathWatcherForContext:context];
|
||||
}
|
||||
|
||||
|
||||
|
||||
void AtomCefRenderProcessHandler::OnWorkerContextCreated(int worker_id,
|
||||
const CefString& url,
|
||||
CefRefPtr<CefV8Context> context) {
|
||||
v8_extensions::Native::CreateContextBinding(context);
|
||||
}
|
||||
|
||||
void AtomCefRenderProcessHandler::OnWorkerContextReleased(int worker_id,
|
||||
const CefString& url,
|
||||
CefRefPtr<CefV8Context> context) {
|
||||
NSLog(@"Web worker context released");
|
||||
}
|
||||
|
||||
void AtomCefRenderProcessHandler::OnWorkerUncaughtException(int worker_id,
|
||||
const CefString& url,
|
||||
CefRefPtr<CefV8Context> context,
|
||||
CefRefPtr<CefV8Exception> exception,
|
||||
CefRefPtr<CefV8StackTrace> stackTrace) {
|
||||
|
||||
std::string message = exception->GetMessage().ToString();
|
||||
NSLog(@"Exception throw in worker thread %s", message.c_str());
|
||||
}
|
||||
|
||||
bool AtomCefRenderProcessHandler::OnProcessMessageReceived(CefRefPtr<CefBrowser> browser,
|
||||
CefProcessId source_process,
|
||||
CefRefPtr<CefProcessMessage> message) {
|
||||
|
Loading…
Reference in New Issue
Block a user