From f563ef61004c70c05c2ca78a8fbdd85ed1dbf1a6 Mon Sep 17 00:00:00 2001 From: callum_linden Date: Wed, 11 Nov 2015 09:53:51 -0800 Subject: Add callback for when CEF asks to shutdown --- indra/media_plugins/cef/media_plugin_cef.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'indra/media_plugins/cef') diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 86157bf852..d14254d3d7 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -62,6 +62,7 @@ private: void onStatusMessageCallback(std::string value); void onTitleChangeCallback(std::string title); void onLoadStartCallback(); + void onRequestExitCallback(); void onLoadEndCallback(int httpStatusCode); void onAddressChangeCallback(std::string url); void onNavigateURLCallback(std::string url, std::string target); @@ -128,7 +129,6 @@ MediaPluginBase(host_send_func, host_user_data) // MediaPluginCEF::~MediaPluginCEF() { - mLLCEFLib->requestExit(); } //////////////////////////////////////////////////////////////////////////////// @@ -199,6 +199,16 @@ void MediaPluginCEF::onLoadStartCallback() sendMessage(message); } +//////////////////////////////////////////////////////////////////////////////// +// +void MediaPluginCEF::onRequestExitCallback() +{ + mLLCEFLib->shutdown(); + + LLPluginMessage message("base", "goodbye"); + sendMessage(message); +} + //////////////////////////////////////////////////////////////////////////////// // void MediaPluginCEF::onLoadEndCallback(int httpStatusCode) @@ -344,8 +354,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) } else if (message_name == "cleanup") { - LLPluginMessage message("base", "goodbye"); - sendMessage(message); + mLLCEFLib->requestExit(); } else if (message_name == "shm_added") { @@ -401,6 +410,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) mLLCEFLib->setOnNavigateURLCallback(boost::bind(&MediaPluginCEF::onNavigateURLCallback, this, _1, _2)); mLLCEFLib->setOnHTTPAuthCallback(boost::bind(&MediaPluginCEF::onHTTPAuthCallback, this, _1, _2, _3, _4)); mLLCEFLib->setOnCursorChangedCallback(boost::bind(&MediaPluginCEF::onCursorChangedCallback, this, _1, _2)); + mLLCEFLib->setOnRequestExitCallback(boost::bind(&MediaPluginCEF::onRequestExitCallback, this)); LLCEFLib::LLCEFLibSettings settings; settings.initial_width = 1024; -- cgit v1.2.3 From f8050dbac2861d76adfe8630abe09ca5fb2666f7 Mon Sep 17 00:00:00 2001 From: callum_linden Date: Wed, 11 Nov 2015 16:28:11 -0800 Subject: Fix MAINT-5832 Add /LTCG flag to linker for media_plugin_cef.dll to avoid linker restarts --- indra/media_plugins/cef/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/media_plugins/cef') diff --git a/indra/media_plugins/cef/CMakeLists.txt b/indra/media_plugins/cef/CMakeLists.txt index 16015be672..1f6163e41e 100644 --- a/indra/media_plugins/cef/CMakeLists.txt +++ b/indra/media_plugins/cef/CMakeLists.txt @@ -61,7 +61,7 @@ set (media_plugin_cef_LINK_LIBRARIES if (LINUX) message(FATAL_ERROR "CEF plugin has been enabled for a Linux compile.\n" " Please create a volume_catcher implementation for this platform.") - + elseif (DARWIN) list(APPEND media_plugin_cef_SOURCE_FILES mac_volume_catcher.cpp) find_library(CORESERVICES_LIBRARY CoreServices) @@ -98,7 +98,7 @@ if (WINDOWS) set_target_properties( media_plugin_cef PROPERTIES - LINK_FLAGS "/MANIFEST:NO /SAFESEH:NO /NODEFAULTLIB:LIBCMT" + LINK_FLAGS "/MANIFEST:NO /SAFESEH:NO /LTCG /NODEFAULTLIB:LIBCMT" LINK_FLAGS_DEBUG "/MANIFEST:NO /SAFESEH:NO /NODEFAULTLIB:LIBCMTD" ) endif (WINDOWS) -- cgit v1.2.3