ntdll.dll!77d9891c() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
KernelBase.dll!_WaitForSingleObjectEx@12() Unknown
KernelBase.dll!_WaitForSingleObject@8() Unknown
libcef.dll!v8::base::Semaphore::Wait() Line 175 C++
libcef.dll!CefContext::Shutdown() Line 316 C++
libcef.dll!`anonymous namespace'::`dynamic atexit destructor for 'g_force_shutdown''() C++
> libcef.dll!doexit(int code, int quick, int retcaller) Line 628 C
libcef.dll!_cexit() Line 448 C
libcef.dll!_CRT_INIT(void * hDllHandle, unsigned long dwReason, void * lpreserved) Line 169 C
libcef.dll!__DllMainCRTStartup(void * hDllHandle, unsigned long dwReason, void * lpreserved) Line 399 C
libcef.dll!_DllMainCRTStartup(void * hDllHandle, unsigned long dwReason, void * lpreserved) Line 340 C
ntdll.dll!77d988ae() Unknown
> cw42.dll!CCEFHtmlHandler::OnRenderProcessTerminated(CefRefPtr<CefBrowser> browser, cef_termination_status_t status) Line 2112 C++
cw42.dll!`anonymous namespace'::request_handler_on_render_process_terminated(struct _cef_request_handler_t *,struct _cef_browser_t *,enum cef_termination_status_t) Unknown
libcef.dll!CefRequestHandlerCToCpp::OnRenderProcessTerminated(CefRefPtr<CefBrowser> browser, cef_termination_status_t status) Line 506 C++
libcef.dll!CefBrowserHostImpl::RenderProcessGone(base::TerminationStatus status) Line 2712 C++
libcef.dll!content::WebContentsImpl::RenderViewTerminated(content::RenderViewHost * rvh, base::TerminationStatus status, int error_code) Line 3884 C++
libcef.dll!content::RenderViewHostImpl::RenderProcessExited(content::RenderProcessHost * host, base::TerminationStatus status, int exit_code) Line 602 C++
libcef.dll!content::RenderProcessHostImpl::ProcessDied(bool already_dead, content::RenderProcessHost::RendererClosedDetails * known_details) Line 2219 C++
libcef.dll!content::RenderProcessHostImpl::OnChannelError() Line 1659 C++
libcef.dll!base::debug::TaskAnnotator::RunTask(const char * queue_function, const base::PendingTask & pending_task) Line 51 C++
libcef.dll!base::MessageLoop::RunTask(const base::PendingTask & pending_task) Line 477 C++
libcef.dll!base::MessageLoop::DoWork() Line 597 C++
libcef.dll!base::MessagePumpForUI::DoRunLoop() Line 173 C++
libcef.dll!base::MessagePumpWin::Run(base::MessagePump::Delegate * delegate) Line 56 C++
libcef.dll!base::MessageLoop::RunHandler() Line 439 C++
libcef.dll!base::RunLoop::Run() Line 56 C++
libcef.dll!base::MessageLoop::Run() Line 283 C++
libcef.dll!base::Thread::Run(base::MessageLoop * message_loop) Line 200 C++
libcef.dll!base::Thread::ThreadMain() Line 254 C++
libcef.dll!base::`anonymous namespace'::ThreadFunc(void * params) Line 84 C++
void CCefSimpleHandler::OnBeforeClose(CefRefPtr<CefBrowser> browser)
{
CEF_REQUIRE_UI_THREAD();
CefRefPtr<CefProcessMessage> message = CefProcessMessage::Create("Get Return Value");
browser->SendProcessMessage(PID_RENDERER, message);
if (m_Parent != nullptr)
{
m_Parent->SendMessage(WMA_CEF_BROWSER_DESTROYED, (WPARAM)this, (LPARAM)browser.get());
}
// Remove from the list of existing browsers.
BrowserList::iterator bit = browser_list_.begin();
for (; bit != browser_list_.end(); ++bit) {
if ((*bit)->IsSame(browser)) {
browser_list_.erase(bit);
break;
}
}
}
class CaseWareClientApp : public ClientApp
{
private:
virtual bool OnProcessMessageReceived(CefRefPtr<CefBrowser> browser, CefProcessId source_process, CefRefPtr<CefProcessMessage> message) OVERRIDE
{
if (message->GetName() == "Get Return Value")
{
CefRefPtr<CefV8Value> returnValue = browser->GetMainFrame()->GetV8Context()->GetGlobal()->GetValue("returnValue");
Json::Value* jsonValue = GetJsonValueFromV8(returnValue);
Json::FastWriter writer;
std::string json = writer.write(*jsonValue);
delete jsonValue;
CefRefPtr<CefProcessMessage> msg = CefProcessMessage::Create("Return Value");
CefRefPtr<CefListValue> args = msg->GetArgumentList();
args->SetString(0, json);
browser->SendProcessMessage(PID_BROWSER, msg);
return true;
}
return false;
}
IMPLEMENT_REFCOUNTING(CaseWareClientApp);
};
class CaseWareClientApp : public ClientApp
{
public:
CaseWareClientApp()
: ClientApp()
, m_Thread(nullptr)
{
}
virtual ~CaseWareClientApp()
{
delete m_Thread;
}
virtual CefRefPtr<CefBrowserProcessHandler> GetBrowserProcessHandler() OVERRIDE
{
return this;
}
virtual CefRefPtr<CefRenderProcessHandler> GetRenderProcessHandler() OVERRIDE
{
return this;
}
public:
virtual bool OnProcessMessageReceived(CefRefPtr<CefBrowser> browser, CefProcessId source_process, CefRefPtr<CefProcessMessage> message) OVERRIDE
{
return false;
}
virtual void OnBrowserDestroyed(CefRefPtr<CefBrowser> browser) OVERRIDE
{
delete m_Thread;
m_Thread = new std::thread(ProcessReturnValue, browser);
}
std::thread* m_Thread;
IMPLEMENT_REFCOUNTING(CaseWareClientApp);
};
// Program entry point function.
int APIENTRY wWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow) {
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
void* sandbox_info = NULL;
CefMainArgs main_args(hInstance);
CefRefPtr<CefApp> app(new CaseWareClientApp);
_se_translator_function oldse = _set_se_translator(trans_func);
try {
// Execute the secondary process, if any.
int exit_code = CefExecuteProcess(main_args, app.get(), sandbox_info);
if (exit_code >= 0)
return exit_code;
}
catch (CSEHException e)
{
return e.GetExceptionNumber();
}
catch (...)
{
return -1;
}
// Retrieve the current working directory.
if (_getcwd(szWorkingDir, MAX_PATH) == NULL)
szWorkingDir[0] = 0;
// Parse command line arguments. The passed in values are ignored on Windows.
AppInitCommandLine(0, NULL);
CefSettings settings;
// Populate the settings based on command line arguments.
AppGetSettings(settings);
// Initialize CEF.
CefInitialize(main_args, settings, app.get(), sandbox_info);
// Register the scheme handler.
scheme_test::InitTest();
HACCEL hAccelTable;
// Initialize global strings
LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
LoadString(hInstance, IDC_CEFCLIENT, szWindowClass, MAX_LOADSTRING);
LoadString(hInstance, IDS_OSR_WIDGET_CLASS, szOSRWindowClass, MAX_LOADSTRING);
MyRegisterClass(hInstance);
// Perform application initialization
if (!InitInstance (hInstance, nCmdShow))
return FALSE;
hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_CEFCLIENT));
int result = 0;
if (!settings.multi_threaded_message_loop) {
// Run the CEF message loop. This function will block until the application
// recieves a WM_QUIT message.
CefRunMessageLoop();
} else {
// Create a hidden window for message processing.
hMessageWnd = CreateMessageWindow(hInstance);
ASSERT(hMessageWnd);
MSG msg;
// Run the application message loop.
while (GetMessage(&msg, NULL, 0, 0)) {
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
DestroyWindow(hMessageWnd);
hMessageWnd = NULL;
result = static_cast<int>(msg.wParam);
}
// Shut down CEF.
CefShutdown();
return result;
}
Users browsing this forum: No registered users and 20 guests