From 038c555fc4254de62a477d1c83a2131970b0b2b5 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 21 Feb 2017 17:12:27 -0500 Subject: DRTVWR-418: In viewer64-mac-havok fork, turn on Xcode 8 Havok. This is known not to work yet: the relevant Havok libraries are not being bundled with llphysicsextensions, therefore the viewer can't link with any Havok symbols. --- autobuild.xml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'autobuild.xml') diff --git a/autobuild.xml b/autobuild.xml index 975a4ebd64..51beb0ddaf 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -1322,9 +1322,9 @@ archive hash - cbaa7619050123c3fd2a88959f88bd47 + bd749bc181e8d75718267bc0ecf4c5bf url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/749/1553/havok_source-2012.1-2-darwin64-500739.tar.bz2 + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/2750/6262/havok_source-2012.1-2-darwin64-502736.tar.bz2 name darwin64 @@ -1358,9 +1358,9 @@ archive hash - dab55cc0555d7126fda925e20af851ea + 03be19251601027841c767f723dae1d4 url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/1194/2807/havok_source-2012.1-2-windows-501181.tar.bz2 + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/2756/6286/havok_source-2012.1-2-windows-502736.tar.bz2 name windows @@ -1370,9 +1370,9 @@ archive hash - 7bbc1c3512a5665b7576b4b0357a9eb7 + de3884eeed32297845add77d5ecc7e6b url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/1195/2816/havok_source-2012.1-2-windows64-501181.tar.bz2 + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/2755/6280/havok_source-2012.1-2-windows64-502736.tar.bz2 name windows64 @@ -3357,7 +3357,6 @@ -G Xcode - -DHAVOK:BOOL=OFF default @@ -3386,7 +3385,6 @@ -G Xcode - -DHAVOK:BOOL=OFF name @@ -3421,7 +3419,6 @@ -G Xcode - -DHAVOK:BOOL=OFF name @@ -3448,7 +3445,6 @@ -G Xcode - -DHAVOK:BOOL=OFF name -- cgit v1.3 From bd5d2625e9c1e3347d91ebc535faaaaa3d09c529 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 20 Mar 2017 21:45:28 -0400 Subject: DRTVWR-418: Update to havok-source build 503601. --- autobuild.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'autobuild.xml') diff --git a/autobuild.xml b/autobuild.xml index e5814be547..038d3fcffc 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -1376,9 +1376,9 @@ archive hash - bd749bc181e8d75718267bc0ecf4c5bf + 814bed3b81820d83a184c0f0a805e92d url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/2750/6262/havok_source-2012.1-2-darwin64-502736.tar.bz2 + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/3613/9353/havok_source-2012.1-2-darwin64-503601.tar.bz2 name darwin64 @@ -1412,9 +1412,9 @@ archive hash - 03be19251601027841c767f723dae1d4 + 7d4517f7a601391e83ba2e08f2ea518f url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/2756/6286/havok_source-2012.1-2-windows-502736.tar.bz2 + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/3621/9389/havok_source-2012.1-2-windows-503601.tar.bz2 name windows @@ -1424,9 +1424,9 @@ archive hash - de3884eeed32297845add77d5ecc7e6b + b15b374f49ce4ac910889f5b7e150c73 url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/2755/6280/havok_source-2012.1-2-windows64-502736.tar.bz2 + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/3614/9359/havok_source-2012.1-2-windows64-503601.tar.bz2 name windows64 -- cgit v1.3 From 2acc472e1edd2bfa3ffad5f9b9f760bcec5a3cb9 Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Wed, 5 Apr 2017 14:34:14 -0700 Subject: Fix for MAINT-7227 Drop down lists do not close after use in internal web browser. (Surprisingly large amount of changes and new version of Dullahan to support this fix) --- autobuild.xml | 14 +++---- indra/media_plugins/cef/media_plugin_cef.cpp | 60 ++++++---------------------- 2 files changed, 19 insertions(+), 55 deletions(-) (limited to 'autobuild.xml') diff --git a/autobuild.xml b/autobuild.xml index 0c0b5b39c4..d125eeb1b4 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -526,9 +526,9 @@ archive hash - 1517ca15cd1209b0910a8f6720c65cb4 + 2a51fd19fe7d3746991c03c37e1b3664 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/3408/8552/dullahan-1.1.636_3.2987.1591.gd3e47f5-darwin64-503397.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4006/11069/dullahan-1.1.651_3.2987.1591.gd3e47f5-darwin64-503995.tar.bz2 name darwin64 @@ -538,9 +538,9 @@ archive hash - 5dc1349abce3ccb04c6ac79a0ff19d59 + 8f41ed585402ab5617f516618e0aa0f8 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/3410/8559/dullahan-1.1.636_3.2987.1591.gd3e47f5-windows-503397.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4008/11076/dullahan-1.1.651_3.2987.1591.gd3e47f5-windows-503995.tar.bz2 name windows @@ -550,16 +550,16 @@ archive hash - 928db398436823aa804046de91339177 + 26dc25ff2579b515edfd03d91aa7f23f url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/3409/8562/dullahan-1.1.636_3.2987.1591.gd3e47f5-windows64-503397.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4007/11081/dullahan-1.1.651_3.2987.1591.gd3e47f5-windows64-503995.tar.bz2 name windows64 version - 1.1.636_3.2987.1591.gd3e47f5 + 1.1.651_3.2987.1591.gd3e47f5 elfio diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 906a5ff6e7..965b755887 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -55,7 +55,7 @@ public: private: bool init(); - void onPageChangedCallback(const unsigned char* pixels, int x, int y, const int width, const int height, bool is_popup); + void onPageChangedCallback(const unsigned char* pixels, int x, int y, const int width, const int height); void onCustomSchemeURLCallback(std::string url); void onConsoleMessageCallback(std::string message, std::string source, int line); void onStatusMessageCallback(std::string value); @@ -84,6 +84,7 @@ private: bool mCookiesEnabled; bool mPluginsEnabled; bool mJavascriptEnabled; + bool mDisableGPU; std::string mUserAgentSubtring; std::string mAuthUsername; std::string mAuthPassword; @@ -117,6 +118,7 @@ MediaPluginBase(host_send_func, host_user_data) mCookiesEnabled = true; mPluginsEnabled = false; mJavascriptEnabled = true; + mDisableGPU = true; mUserAgentSubtring = ""; mAuthUsername = ""; mAuthPassword = ""; @@ -161,56 +163,13 @@ void MediaPluginCEF::postDebugMessage(const std::string& msg) //////////////////////////////////////////////////////////////////////////////// // -void MediaPluginCEF::onPageChangedCallback(const unsigned char* pixels, int x, int y, const int width, const int height, bool is_popup) +void MediaPluginCEF::onPageChangedCallback(const unsigned char* pixels, int x, int y, const int width, const int height) { - if( is_popup ) - { - delete mPopupBuffer; - mPopupBuffer = NULL; - mPopupH = 0; - mPopupW = 0; - mPopupX = 0; - mPopupY = 0; - } - if( mPixels && pixels ) { - if (is_popup) + if (mWidth == width && mHeight == height) { - if( width > 0 && height> 0 ) - { - mPopupBuffer = new U8[ width * height * mDepth ]; - memcpy( mPopupBuffer, pixels, width * height * mDepth ); - mPopupH = height; - mPopupW = width; - mPopupX = x; - mPopupY = mHeight - y - height; - } - } - else - { - if (mWidth == width && mHeight == height) - { - memcpy(mPixels, pixels, mWidth * mHeight * mDepth); - } - if( mPopupBuffer && mPopupH && mPopupW ) - { - U32 bufferSize = mWidth * mHeight * mDepth; - U32 popupStride = mPopupW * mDepth; - U32 bufferStride = mWidth * mDepth; - int dstY = mPopupY; - - int src = 0; - int dst = dstY * mWidth * mDepth + mPopupX * mDepth; - - for( int line = 0; dst + popupStride < bufferSize && line < mPopupH; ++line ) - { - memcpy( mPixels + dst, mPopupBuffer + src, popupStride ); - src += popupStride; - dst += bufferStride; - } - } - + memcpy(mPixels, pixels, mWidth * mHeight * mDepth); } setDirty(0, 0, mWidth, mHeight); } @@ -477,7 +436,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) if (message_name == "init") { // event callbacks from Dullahan - mCEFLib->setOnPageChangedCallback(std::bind(&MediaPluginCEF::onPageChangedCallback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5, std::placeholders::_6)); + mCEFLib->setOnPageChangedCallback(std::bind(&MediaPluginCEF::onPageChangedCallback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5)); mCEFLib->setOnCustomSchemeURLCallback(std::bind(&MediaPluginCEF::onCustomSchemeURLCallback, this, std::placeholders::_1)); mCEFLib->setOnConsoleMessageCallback(std::bind(&MediaPluginCEF::onConsoleMessageCallback, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); mCEFLib->setOnStatusMessageCallback(std::bind(&MediaPluginCEF::onStatusMessageCallback, this, std::placeholders::_1)); @@ -499,6 +458,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) settings.cache_path = mCachePath; settings.cookie_store_path = mCookiePath; settings.cookies_enabled = mCookiesEnabled; + settings.disable_gpu = mDisableGPU; settings.flash_enabled = mPluginsEnabled; settings.flip_mouse_y = false; settings.flip_pixels_y = true; @@ -755,6 +715,10 @@ void MediaPluginCEF::receiveMessage(const char* message_string) { mJavascriptEnabled = message_in.getValueBoolean("enable"); } + else if (message_name == "gpu_disabled") + { + mDisableGPU = message_in.getValueBoolean("disable"); + } } else if (message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA_TIME) { -- cgit v1.3 From aee540787a823cf69c8991481986b8e4889f0267 Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Thu, 6 Apr 2017 17:00:17 -0700 Subject: Partial fix for MAINT-7236 Web content does not always respect UI Size preference (pull in new version of Dullahan with improved support) --- autobuild.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'autobuild.xml') diff --git a/autobuild.xml b/autobuild.xml index d125eeb1b4..d6580b06e0 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -526,9 +526,9 @@ archive hash - 2a51fd19fe7d3746991c03c37e1b3664 + c3da21de753f30793a369c6a3dfaab07 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4006/11069/dullahan-1.1.651_3.2987.1591.gd3e47f5-darwin64-503995.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4090/11448/dullahan-1.1.651_3.2987.1591.gd3e47f5-darwin64-504079.tar.bz2 name darwin64 @@ -538,9 +538,9 @@ archive hash - 8f41ed585402ab5617f516618e0aa0f8 + 3aea0733d1f18aa69420a02b9e455b40 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4008/11076/dullahan-1.1.651_3.2987.1591.gd3e47f5-windows-503995.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4091/11453/dullahan-1.1.651_3.2987.1591.gd3e47f5-windows-504079.tar.bz2 name windows @@ -550,9 +550,9 @@ archive hash - 26dc25ff2579b515edfd03d91aa7f23f + c52a90eaa74218ff954cd1f32d1960c9 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4007/11081/dullahan-1.1.651_3.2987.1591.gd3e47f5-windows64-503995.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4092/11459/dullahan-1.1.651_3.2987.1591.gd3e47f5-windows64-504079.tar.bz2 name windows64 -- cgit v1.3 From 45f67f4ed7922e87ae5dd471bd82506f1e2300da Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Wed, 19 Apr 2017 13:22:32 -0700 Subject: Hopeful fix for MAINT-7220 Windows Error Message 'SLPlugin.exe has stopped working ' appears. --- autobuild.xml | 14 +- indra/llplugin/llpluginmessagepipe.cpp | 2 +- indra/llplugin/llpluginprocesschild.cpp | 1171 +++++++++++++------------- indra/media_plugins/cef/media_plugin_cef.cpp | 18 +- indra/newview/llviewermedia.cpp | 4 +- 5 files changed, 604 insertions(+), 605 deletions(-) (limited to 'autobuild.xml') diff --git a/autobuild.xml b/autobuild.xml index 3a74a6832f..1ff5d8ade4 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -526,9 +526,9 @@ archive hash - c3da21de753f30793a369c6a3dfaab07 + 9005fcda30e6659790e2fdfc27d4e2ee url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4090/11448/dullahan-1.1.651_3.2987.1591.gd3e47f5-darwin64-504079.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4384/12984/dullahan-1.1.764_3.2987.1591.gd3e47f5-darwin64-504373.tar.bz2 name darwin64 @@ -538,9 +538,9 @@ archive hash - 3aea0733d1f18aa69420a02b9e455b40 + 9c2abd5b606a5f0580c4cbb4e9aedfaa url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4091/11453/dullahan-1.1.651_3.2987.1591.gd3e47f5-windows-504079.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4385/12990/dullahan-1.1.764_3.2987.1591.gd3e47f5-windows-504373.tar.bz2 name windows @@ -550,16 +550,16 @@ archive hash - c52a90eaa74218ff954cd1f32d1960c9 + 9e6714e4c3286a0b268577300043d998 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4092/11459/dullahan-1.1.651_3.2987.1591.gd3e47f5-windows64-504079.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4386/12995/dullahan-1.1.764_3.2987.1591.gd3e47f5-windows64-504373.tar.bz2 name windows64 version - 1.1.651_3.2987.1591.gd3e47f5 + 1.1.764_3.2987.1591.gd3e47f5 elfio diff --git a/indra/llplugin/llpluginmessagepipe.cpp b/indra/llplugin/llpluginmessagepipe.cpp index 7e2bf90ad1..b7497ad781 100644 --- a/indra/llplugin/llpluginmessagepipe.cpp +++ b/indra/llplugin/llpluginmessagepipe.cpp @@ -215,7 +215,7 @@ bool LLPluginMessagePipe::pumpOutput() else if(APR_STATUS_IS_EOF(status)) { // This is what we normally expect when a plugin exits. - LL_INFOS() << "Got EOF from plugin socket. " << LL_ENDL; + //LL_INFOS() << "Got EOF from plugin socket. " << LL_ENDL; if(mOwner) { diff --git a/indra/llplugin/llpluginprocesschild.cpp b/indra/llplugin/llpluginprocesschild.cpp index be80d38305..3804ffadbb 100644 --- a/indra/llplugin/llpluginprocesschild.cpp +++ b/indra/llplugin/llpluginprocesschild.cpp @@ -1,582 +1,589 @@ -/** - * @file llpluginprocesschild.cpp - * @brief LLPluginProcessChild handles the child side of the external-process plugin API. - * - * @cond - * $LicenseInfo:firstyear=2008&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - * @endcond - */ - -#include "linden_common.h" - -#include "llpluginprocesschild.h" -#include "llplugininstance.h" -#include "llpluginmessagepipe.h" -#include "llpluginmessageclasses.h" - -static const F32 GOODBYE_SECONDS = 20.0f; -static const F32 HEARTBEAT_SECONDS = 1.0f; -static const F32 PLUGIN_IDLE_SECONDS = 1.0f / 100.0f; // Each call to idle will give the plugin this much time. - -LLPluginProcessChild::LLPluginProcessChild() -{ - mState = STATE_UNINITIALIZED; - mInstance = NULL; - mSocket = LLSocket::create(gAPRPoolp, LLSocket::STREAM_TCP); - mSleepTime = PLUGIN_IDLE_SECONDS; // default: send idle messages at 100Hz - mCPUElapsed = 0.0f; - mBlockingRequest = false; - mBlockingResponseReceived = false; -} - -LLPluginProcessChild::~LLPluginProcessChild() -{ - if(mInstance != NULL) - { - sendMessageToPlugin(LLPluginMessage("base", "cleanup")); - - // IMPORTANT: under some (unknown) circumstances the apr_dso_unload() triggered when mInstance is deleted - // appears to fail and lock up which means that a given instance of the slplugin process never exits. - // This is bad, especially when users try to update their version of SL - it fails because the slplugin - // process as well as a bunch of plugin specific files are locked and cannot be overwritten. - exit( 0 ); - //delete mInstance; - //mInstance = NULL; - } -} - -void LLPluginProcessChild::killSockets(void) -{ - killMessagePipe(); - mSocket.reset(); -} - -void LLPluginProcessChild::init(U32 launcher_port) -{ - mLauncherHost = LLHost("127.0.0.1", launcher_port); - setState(STATE_INITIALIZED); -} - -void LLPluginProcessChild::idle(void) -{ - bool idle_again; - do - { - if(APR_STATUS_IS_EOF(mSocketError)) - { - // Plugin socket was closed. This covers both normal plugin termination and host crashes. - setState(STATE_ERROR); - } - else if(mSocketError != APR_SUCCESS) - { - LL_INFOS("Plugin") << "message pipe is in error state (" << mSocketError << "), moving to STATE_ERROR"<< LL_ENDL; - setState(STATE_ERROR); - } - - if((mState > STATE_INITIALIZED) && (mMessagePipe == NULL)) - { - // The pipe has been closed -- we're done. - // TODO: This could be slightly more subtle, but I'm not sure it needs to be. - LL_INFOS("Plugin") << "message pipe went away, moving to STATE_ERROR"<< LL_ENDL; - setState(STATE_ERROR); - } - - // If a state needs to go directly to another state (as a performance enhancement), it can set idle_again to true after calling setState(). - // USE THIS CAREFULLY, since it can starve other code. Specifically make sure there's no way to get into a closed cycle and never return. - // When in doubt, don't do it. - idle_again = false; - - if(mInstance != NULL) - { - // Provide some time to the plugin - mInstance->idle(); - } - - switch(mState) - { - case STATE_UNINITIALIZED: - break; - - case STATE_INITIALIZED: - if(mSocket->blockingConnect(mLauncherHost)) - { - // This automatically sets mMessagePipe - new LLPluginMessagePipe(this, mSocket); - - setState(STATE_CONNECTED); - } - else - { - // connect failed - setState(STATE_ERROR); - } - break; - - case STATE_CONNECTED: - sendMessageToParent(LLPluginMessage(LLPLUGIN_MESSAGE_CLASS_INTERNAL, "hello")); - setState(STATE_PLUGIN_LOADING); - break; - - case STATE_PLUGIN_LOADING: - if(!mPluginFile.empty()) - { - mInstance = new LLPluginInstance(this); - if(mInstance->load(mPluginDir, mPluginFile) == 0) - { - mHeartbeat.start(); - mHeartbeat.setTimerExpirySec(HEARTBEAT_SECONDS); - mCPUElapsed = 0.0f; - setState(STATE_PLUGIN_LOADED); - } - else - { - setState(STATE_ERROR); - } - } - break; - - case STATE_PLUGIN_LOADED: - { - setState(STATE_PLUGIN_INITIALIZING); - LLPluginMessage message("base", "init"); - sendMessageToPlugin(message); - } - break; - - case STATE_PLUGIN_INITIALIZING: - // waiting for init_response... - break; - - case STATE_RUNNING: - if(mInstance != NULL) - { - // Provide some time to the plugin - LLPluginMessage message("base", "idle"); - message.setValueReal("time", PLUGIN_IDLE_SECONDS); - sendMessageToPlugin(message); - - mInstance->idle(); - - if(mHeartbeat.hasExpired()) - { - - // This just proves that we're not stuck down inside the plugin code. - LLPluginMessage heartbeat(LLPLUGIN_MESSAGE_CLASS_INTERNAL, "heartbeat"); - - // Calculate the approximage CPU usage fraction (floating point value between 0 and 1) used by the plugin this heartbeat cycle. - // Note that this will not take into account any threads or additional processes the plugin spawns, but it's a first approximation. - // If we could write OS-specific functions to query the actual CPU usage of this process, that would be a better approximation. - heartbeat.setValueReal("cpu_usage", mCPUElapsed / mHeartbeat.getElapsedTimeF64()); - - sendMessageToParent(heartbeat); - - mHeartbeat.reset(); - mHeartbeat.setTimerExpirySec(HEARTBEAT_SECONDS); - mCPUElapsed = 0.0f; - } - } - // receivePluginMessage will transition to STATE_UNLOADING - break; - - case STATE_SHUTDOWNREQ: - if (mInstance != NULL) - { - sendMessageToPlugin(LLPluginMessage("base", "cleanup")); - delete mInstance; - mInstance = NULL; - } - setState(STATE_UNLOADING); - mWaitGoodbye.setTimerExpirySec(GOODBYE_SECONDS); - break; - - case STATE_UNLOADING: - // waiting for goodbye from plugin. - if (mWaitGoodbye.hasExpired()) - { - LL_WARNS() << "Wait for goodbye expired. Advancing to UNLOADED" << LL_ENDL; - setState(STATE_UNLOADED); - } - break; - - case STATE_UNLOADED: - killSockets(); - setState(STATE_DONE); - break; - - case STATE_ERROR: - // Close the socket to the launcher - killSockets(); - // TODO: Where do we go from here? Just exit()? - setState(STATE_DONE); - break; - - case STATE_DONE: - // just sit here. - break; - } - - } while (idle_again); -} - -void LLPluginProcessChild::sleep(F64 seconds) -{ - deliverQueuedMessages(); - if(mMessagePipe) - { - mMessagePipe->pump(seconds); - } - else - { - ms_sleep((int)(seconds * 1000.0f)); - } -} - -void LLPluginProcessChild::pump(void) -{ - deliverQueuedMessages(); - if(mMessagePipe) - { - mMessagePipe->pump(0.0f); - } - else - { - // Should we warn here? - } -} - - -bool LLPluginProcessChild::isRunning(void) -{ - bool result = false; - - if(mState == STATE_RUNNING) - result = true; - - return result; -} - -bool LLPluginProcessChild::isDone(void) -{ - bool result = false; - - switch(mState) - { - case STATE_DONE: - result = true; - break; - default: - break; - } - - return result; -} - -void LLPluginProcessChild::sendMessageToPlugin(const LLPluginMessage &message) -{ - if (mInstance) - { - std::string buffer = message.generate(); - - LL_DEBUGS("Plugin") << "Sending to plugin: " << buffer << LL_ENDL; - LLTimer elapsed; - - mInstance->sendMessage(buffer); - - mCPUElapsed += elapsed.getElapsedTimeF64(); - } - else - { - LL_WARNS("Plugin") << "mInstance == NULL" << LL_ENDL; - } -} - -void LLPluginProcessChild::sendMessageToParent(const LLPluginMessage &message) -{ - std::string buffer = message.generate(); - - LL_DEBUGS("Plugin") << "Sending to parent: " << buffer << LL_ENDL; - - writeMessageRaw(buffer); -} - -void LLPluginProcessChild::receiveMessageRaw(const std::string &message) -{ - // Incoming message from the TCP Socket - - LL_DEBUGS("Plugin") << "Received from parent: " << message << LL_ENDL; - - // Decode this message - LLPluginMessage parsed; - parsed.parse(message); - - if(mBlockingRequest) - { - // We're blocking the plugin waiting for a response. - - if(parsed.hasValue("blocking_response")) - { - // This is the message we've been waiting for -- fall through and send it immediately. - mBlockingResponseReceived = true; - } - else - { - // Still waiting. Queue this message and don't process it yet. - mMessageQueue.push(message); - return; - } - } - - bool passMessage = true; - - // FIXME: how should we handle queueing here? - - { - std::string message_class = parsed.getClass(); - if(message_class == LLPLUGIN_MESSAGE_CLASS_INTERNAL) - { - passMessage = false; - - std::string message_name = parsed.getName(); - if(message_name == "load_plugin") - { - mPluginFile = parsed.getValue("file"); - mPluginDir = parsed.getValue("dir"); - } - else if (message_name == "shutdown_plugin") - { - setState(STATE_SHUTDOWNREQ); - } - else if(message_name == "shm_add") - { - std::string name = parsed.getValue("name"); - size_t size = (size_t)parsed.getValueS32("size"); - - sharedMemoryRegionsType::iterator iter = mSharedMemoryRegions.find(name); - if(iter != mSharedMemoryRegions.end()) - { - // Need to remove the old region first - LL_WARNS("Plugin") << "Adding a duplicate shared memory segment!" << LL_ENDL; - } - else - { - // This is a new region - LLPluginSharedMemory *region = new LLPluginSharedMemory; - if(region->attach(name, size)) - { - mSharedMemoryRegions.insert(sharedMemoryRegionsType::value_type(name, region)); - - std::stringstream addr; - addr << region->getMappedAddress(); - - // Send the add notification to the plugin - LLPluginMessage message("base", "shm_added"); - message.setValue("name", name); - message.setValueS32("size", (S32)size); - message.setValuePointer("address", region->getMappedAddress()); - sendMessageToPlugin(message); - - // and send the response to the parent - message.setMessage(LLPLUGIN_MESSAGE_CLASS_INTERNAL, "shm_add_response"); - message.setValue("name", name); - sendMessageToParent(message); - } - else - { - LL_WARNS("Plugin") << "Couldn't create a shared memory segment!" << LL_ENDL; - delete region; - } - } - - } - else if(message_name == "shm_remove") - { - std::string name = parsed.getValue("name"); - sharedMemoryRegionsType::iterator iter = mSharedMemoryRegions.find(name); - if(iter != mSharedMemoryRegions.end()) - { - // forward the remove request to the plugin -- its response will trigger us to detach the segment. - LLPluginMessage message("base", "shm_remove"); - message.setValue("name", name); - sendMessageToPlugin(message); - } - else - { - LL_WARNS("Plugin") << "shm_remove for unknown memory segment!" << LL_ENDL; - } - } - else if(message_name == "sleep_time") - { - mSleepTime = llmax(parsed.getValueReal("time"), 1.0 / 100.0); // clamp to maximum of 100Hz - } - else if(message_name == "crash") - { - // Crash the plugin - LL_ERRS("Plugin") << "Plugin crash requested." << LL_ENDL; - } - else if(message_name == "hang") - { - // Hang the plugin - LL_WARNS("Plugin") << "Plugin hang requested." << LL_ENDL; - while(1) - { - // wheeeeeeeee...... - } - } - else - { - LL_WARNS("Plugin") << "Unknown internal message from parent: " << message_name << LL_ENDL; - } - } - } - - if(passMessage && mInstance != NULL) - { - LLTimer elapsed; - - mInstance->sendMessage(message); - - mCPUElapsed += elapsed.getElapsedTimeF64(); - } -} - -/* virtual */ -void LLPluginProcessChild::receivePluginMessage(const std::string &message) -{ - LL_DEBUGS("Plugin") << "Received from plugin: " << message << LL_ENDL; - - if(mBlockingRequest) - { - // - LL_ERRS("Plugin") << "Can't send a message while already waiting on a blocking request -- aborting!" << LL_ENDL; - } - - // Incoming message from the plugin instance - bool passMessage = true; - - // FIXME: how should we handle queueing here? - - // Intercept certain base messages (responses to ones sent by this class) - { - // Decode this message - LLPluginMessage parsed; - parsed.parse(message); - - if(parsed.hasValue("blocking_request")) - { - mBlockingRequest = true; - } - - std::string message_class = parsed.getClass(); - if(message_class == "base") - { - std::string message_name = parsed.getName(); - if(message_name == "init_response") - { - // The plugin has finished initializing. - setState(STATE_RUNNING); - - // Don't pass this message up to the parent - passMessage = false; - - LLPluginMessage new_message(LLPLUGIN_MESSAGE_CLASS_INTERNAL, "load_plugin_response"); - LLSD versions = parsed.getValueLLSD("versions"); - new_message.setValueLLSD("versions", versions); - - if(parsed.hasValue("plugin_version")) - { - std::string plugin_version = parsed.getValue("plugin_version"); - new_message.setValueLLSD("plugin_version", plugin_version); - } - - // Let the parent know it's loaded and initialized. - sendMessageToParent(new_message); - } - else if (message_name == "goodbye") - { - setState(STATE_UNLOADED); - } - else if(message_name == "shm_remove_response") - { - // Don't pass this message up to the parent - passMessage = false; - - std::string name = parsed.getValue("name"); - sharedMemoryRegionsType::iterator iter = mSharedMemoryRegions.find(name); - if(iter != mSharedMemoryRegions.end()) - { - // detach the shared memory region - iter->second->detach(); - - // and remove it from our map - mSharedMemoryRegions.erase(iter); - - // Finally, send the response to the parent. - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_INTERNAL, "shm_remove_response"); - message.setValue("name", name); - sendMessageToParent(message); - } - else - { - LL_WARNS("Plugin") << "shm_remove_response for unknown memory segment!" << LL_ENDL; - } - } - } - } - - if(passMessage) - { - LL_DEBUGS("Plugin") << "Passing through to parent: " << message << LL_ENDL; - writeMessageRaw(message); - } - - while(mBlockingRequest) - { - // The plugin wants to block and wait for a response to this message. - sleep(mSleepTime); // this will pump the message pipe and process messages - - if(mBlockingResponseReceived || mSocketError != APR_SUCCESS || (mMessagePipe == NULL)) - { - // Response has been received, or we've hit an error state. Stop waiting. - mBlockingRequest = false; - mBlockingResponseReceived = false; - } - } -} - - -void LLPluginProcessChild::setState(EState state) -{ - LL_DEBUGS("Plugin") << "setting state to " << state << LL_ENDL; - mState = state; -}; - -void LLPluginProcessChild::deliverQueuedMessages() -{ - if(!mBlockingRequest) - { - while(!mMessageQueue.empty()) - { - receiveMessageRaw(mMessageQueue.front()); - mMessageQueue.pop(); - } - } -} +/** +* @file llpluginprocesschild.cpp +* @brief LLPluginProcessChild handles the child side of the external-process plugin API. +* +* @cond +* $LicenseInfo:firstyear=2008&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2010, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +* @endcond +*/ + +#include "linden_common.h" + +#include "llpluginprocesschild.h" +#include "llplugininstance.h" +#include "llpluginmessagepipe.h" +#include "llpluginmessageclasses.h" + +static const F32 GOODBYE_SECONDS = 20.0f; +static const F32 HEARTBEAT_SECONDS = 1.0f; +static const F32 PLUGIN_IDLE_SECONDS = 1.0f / 100.0f; // Each call to idle will give the plugin this much time. + +LLPluginProcessChild::LLPluginProcessChild() +{ + mState = STATE_UNINITIALIZED; + mInstance = NULL; + mSocket = LLSocket::create(gAPRPoolp, LLSocket::STREAM_TCP); + mSleepTime = PLUGIN_IDLE_SECONDS; // default: send idle messages at 100Hz + mCPUElapsed = 0.0f; + mBlockingRequest = false; + mBlockingResponseReceived = false; +} + +LLPluginProcessChild::~LLPluginProcessChild() +{ + if (mInstance != NULL) + { + sendMessageToPlugin(LLPluginMessage("base", "cleanup")); + + // IMPORTANT: under some (unknown) circumstances the apr_dso_unload() triggered when mInstance is deleted + // appears to fail and lock up which means that a given instance of the slplugin process never exits. + // This is bad, especially when users try to update their version of SL - it fails because the slplugin + // process as well as a bunch of plugin specific files are locked and cannot be overwritten. + exit(0); + //delete mInstance; + //mInstance = NULL; + } +} + +void LLPluginProcessChild::killSockets(void) +{ + killMessagePipe(); + mSocket.reset(); +} + +void LLPluginProcessChild::init(U32 launcher_port) +{ + mLauncherHost = LLHost("127.0.0.1", launcher_port); + setState(STATE_INITIALIZED); +} + +void LLPluginProcessChild::idle(void) +{ + bool idle_again; + do + { + if (mState < STATE_SHUTDOWNREQ) + { // Once we have hit the shutdown request state checking for errors might put us in a spurious + // error state... don't do that. + + if (APR_STATUS_IS_EOF(mSocketError)) + { + // Plugin socket was closed. This covers both normal plugin termination and host crashes. + setState(STATE_ERROR); + } + else if (mSocketError != APR_SUCCESS) + { + LL_INFOS("Plugin") << "message pipe is in error state (" << mSocketError << "), moving to STATE_ERROR" << LL_ENDL; + setState(STATE_ERROR); + } + + if ((mState > STATE_INITIALIZED) && (mMessagePipe == NULL)) + { + // The pipe has been closed -- we're done. + // TODO: This could be slightly more subtle, but I'm not sure it needs to be. + LL_INFOS("Plugin") << "message pipe went away, moving to STATE_ERROR" << LL_ENDL; + setState(STATE_ERROR); + } + } + + // If a state needs to go directly to another state (as a performance enhancement), it can set idle_again to true after calling setState(). + // USE THIS CAREFULLY, since it can starve other code. Specifically make sure there's no way to get into a closed cycle and never return. + // When in doubt, don't do it. + idle_again = false; + + if (mInstance != NULL) + { + // Provide some time to the plugin + mInstance->idle(); + } + + switch (mState) + { + case STATE_UNINITIALIZED: + break; + + case STATE_INITIALIZED: + if (mSocket->blockingConnect(mLauncherHost)) + { + // This automatically sets mMessagePipe + new LLPluginMessagePipe(this, mSocket); + + setState(STATE_CONNECTED); + } + else + { + // connect failed + setState(STATE_ERROR); + } + break; + + case STATE_CONNECTED: + sendMessageToParent(LLPluginMessage(LLPLUGIN_MESSAGE_CLASS_INTERNAL, "hello")); + setState(STATE_PLUGIN_LOADING); + break; + + case STATE_PLUGIN_LOADING: + if (!mPluginFile.empty()) + { + mInstance = new LLPluginInstance(this); + if (mInstance->load(mPluginDir, mPluginFile) == 0) + { + mHeartbeat.start(); + mHeartbeat.setTimerExpirySec(HEARTBEAT_SECONDS); + mCPUElapsed = 0.0f; + setState(STATE_PLUGIN_LOADED); + } + else + { + setState(STATE_ERROR); + } + } + break; + + case STATE_PLUGIN_LOADED: + { + setState(STATE_PLUGIN_INITIALIZING); + LLPluginMessage message("base", "init"); + sendMessageToPlugin(message); + } + break; + + case STATE_PLUGIN_INITIALIZING: + // waiting for init_response... + break; + + case STATE_RUNNING: + if (mInstance != NULL) + { + // Provide some time to the plugin + LLPluginMessage message("base", "idle"); + message.setValueReal("time", PLUGIN_IDLE_SECONDS); + sendMessageToPlugin(message); + + mInstance->idle(); + + if (mHeartbeat.hasExpired()) + { + + // This just proves that we're not stuck down inside the plugin code. + LLPluginMessage heartbeat(LLPLUGIN_MESSAGE_CLASS_INTERNAL, "heartbeat"); + + // Calculate the approximage CPU usage fraction (floating point value between 0 and 1) used by the plugin this heartbeat cycle. + // Note that this will not take into account any threads or additional processes the plugin spawns, but it's a first approximation. + // If we could write OS-specific functions to query the actual CPU usage of this process, that would be a better approximation. + heartbeat.setValueReal("cpu_usage", mCPUElapsed / mHeartbeat.getElapsedTimeF64()); + + sendMessageToParent(heartbeat); + + mHeartbeat.reset(); + mHeartbeat.setTimerExpirySec(HEARTBEAT_SECONDS); + mCPUElapsed = 0.0f; + } + } + // receivePluginMessage will transition to STATE_UNLOADING + break; + + case STATE_SHUTDOWNREQ: + // set next state first thing in case "cleanup" message advances state. + setState(STATE_UNLOADING); + mWaitGoodbye.setTimerExpirySec(GOODBYE_SECONDS); + + if (mInstance != NULL) + { + sendMessageToPlugin(LLPluginMessage("base", "cleanup")); + } + break; + + case STATE_UNLOADING: + // waiting for goodbye from plugin. + if (mWaitGoodbye.hasExpired()) + { + LL_WARNS() << "Wait for goodbye expired. Advancing to UNLOADED" << LL_ENDL; + setState(STATE_UNLOADED); + } + break; + + case STATE_UNLOADED: + killSockets(); + delete mInstance; + mInstance = NULL; + setState(STATE_DONE); + break; + + case STATE_ERROR: + // Close the socket to the launcher + killSockets(); + // TODO: Where do we go from here? Just exit()? + setState(STATE_DONE); + break; + + case STATE_DONE: + // just sit here. + break; + } + + } while (idle_again); +} + +void LLPluginProcessChild::sleep(F64 seconds) +{ + deliverQueuedMessages(); + if (mMessagePipe) + { + mMessagePipe->pump(seconds); + } + else + { + ms_sleep((int)(seconds * 1000.0f)); + } +} + +void LLPluginProcessChild::pump(void) +{ + deliverQueuedMessages(); + if (mMessagePipe) + { + mMessagePipe->pump(0.0f); + } + else + { + // Should we warn here? + } +} + + +bool LLPluginProcessChild::isRunning(void) +{ + bool result = false; + + if (mState == STATE_RUNNING) + result = true; + + return result; +} + +bool LLPluginProcessChild::isDone(void) +{ + bool result = false; + + switch (mState) + { + case STATE_DONE: + result = true; + break; + default: + break; + } + + return result; +} + +void LLPluginProcessChild::sendMessageToPlugin(const LLPluginMessage &message) +{ + if (mInstance) + { + std::string buffer = message.generate(); + + LL_DEBUGS("Plugin") << "Sending to plugin: " << buffer << LL_ENDL; + LLTimer elapsed; + + mInstance->sendMessage(buffer); + + mCPUElapsed += elapsed.getElapsedTimeF64(); + } + else + { + LL_WARNS("Plugin") << "mInstance == NULL" << LL_ENDL; + } +} + +void LLPluginProcessChild::sendMessageToParent(const LLPluginMessage &message) +{ + std::string buffer = message.generate(); + + LL_DEBUGS("Plugin") << "Sending to parent: " << buffer << LL_ENDL; + + writeMessageRaw(buffer); +} + +void LLPluginProcessChild::receiveMessageRaw(const std::string &message) +{ + // Incoming message from the TCP Socket + + LL_DEBUGS("Plugin") << "Received from parent: " << message << LL_ENDL; + + // Decode this message + LLPluginMessage parsed; + parsed.parse(message); + + if (mBlockingRequest) + { + // We're blocking the plugin waiting for a response. + + if (parsed.hasValue("blocking_response")) + { + // This is the message we've been waiting for -- fall through and send it immediately. + mBlockingResponseReceived = true; + } + else + { + // Still waiting. Queue this message and don't process it yet. + mMessageQueue.push(message); + return; + } + } + + bool passMessage = true; + + // FIXME: how should we handle queueing here? + + { + std::string message_class = parsed.getClass(); + if (message_class == LLPLUGIN_MESSAGE_CLASS_INTERNAL) + { + passMessage = false; + + std::string message_name = parsed.getName(); + if (message_name == "load_plugin") + { + mPluginFile = parsed.getValue("file"); + mPluginDir = parsed.getValue("dir"); + } + else if (message_name == "shutdown_plugin") + { + setState(STATE_SHUTDOWNREQ); + } + else if (message_name == "shm_add") + { + std::string name = parsed.getValue("name"); + size_t size = (size_t)parsed.getValueS32("size"); + + sharedMemoryRegionsType::iterator iter = mSharedMemoryRegions.find(name); + if (iter != mSharedMemoryRegions.end()) + { + // Need to remove the old region first + LL_WARNS("Plugin") << "Adding a duplicate shared memory segment!" << LL_ENDL; + } + else + { + // This is a new region + LLPluginSharedMemory *region = new LLPluginSharedMemory; + if (region->attach(name, size)) + { + mSharedMemoryRegions.insert(sharedMemoryRegionsType::value_type(name, region)); + + std::stringstream addr; + addr << region->getMappedAddress(); + + // Send the add notification to the plugin + LLPluginMessage message("base", "shm_added"); + message.setValue("name", name); + message.setValueS32("size", (S32)size); + message.setValuePointer("address", region->getMappedAddress()); + sendMessageToPlugin(message); + + // and send the response to the parent + message.setMessage(LLPLUGIN_MESSAGE_CLASS_INTERNAL, "shm_add_response"); + message.setValue("name", name); + sendMessageToParent(message); + } + else + { + LL_WARNS("Plugin") << "Couldn't create a shared memory segment!" << LL_ENDL; + delete region; + } + } + + } + else if (message_name == "shm_remove") + { + std::string name = parsed.getValue("name"); + sharedMemoryRegionsType::iterator iter = mSharedMemoryRegions.find(name); + if (iter != mSharedMemoryRegions.end()) + { + // forward the remove request to the plugin -- its response will trigger us to detach the segment. + LLPluginMessage message("base", "shm_remove"); + message.setValue("name", name); + sendMessageToPlugin(message); + } + else + { + LL_WARNS("Plugin") << "shm_remove for unknown memory segment!" << LL_ENDL; + } + } + else if (message_name == "sleep_time") + { + mSleepTime = llmax(parsed.getValueReal("time"), 1.0 / 100.0); // clamp to maximum of 100Hz + } + else if (message_name == "crash") + { + // Crash the plugin + LL_ERRS("Plugin") << "Plugin crash requested." << LL_ENDL; + } + else if (message_name == "hang") + { + // Hang the plugin + LL_WARNS("Plugin") << "Plugin hang requested." << LL_ENDL; + while (1) + { + // wheeeeeeeee...... + } + } + else + { + LL_WARNS("Plugin") << "Unknown internal message from parent: " << message_name << LL_ENDL; + } + } + } + + if (passMessage && mInstance != NULL) + { + LLTimer elapsed; + + mInstance->sendMessage(message); + + mCPUElapsed += elapsed.getElapsedTimeF64(); + } +} + +/* virtual */ +void LLPluginProcessChild::receivePluginMessage(const std::string &message) +{ + LL_DEBUGS("Plugin") << "Received from plugin: " << message << LL_ENDL; + + if (mBlockingRequest) + { + // + LL_ERRS("Plugin") << "Can't send a message while already waiting on a blocking request -- aborting!" << LL_ENDL; + } + + // Incoming message from the plugin instance + bool passMessage = true; + + // FIXME: how should we handle queueing here? + + // Intercept certain base messages (responses to ones sent by this class) + { + // Decode this message + LLPluginMessage parsed; + parsed.parse(message); + + if (parsed.hasValue("blocking_request")) + { + mBlockingRequest = true; + } + + std::string message_class = parsed.getClass(); + if (message_class == "base") + { + std::string message_name = parsed.getName(); + if (message_name == "init_response") + { + // The plugin has finished initializing. + setState(STATE_RUNNING); + + // Don't pass this message up to the parent + passMessage = false; + + LLPluginMessage new_message(LLPLUGIN_MESSAGE_CLASS_INTERNAL, "load_plugin_response"); + LLSD versions = parsed.getValueLLSD("versions"); + new_message.setValueLLSD("versions", versions); + + if (parsed.hasValue("plugin_version")) + { + std::string plugin_version = parsed.getValue("plugin_version"); + new_message.setValueLLSD("plugin_version", plugin_version); + } + + // Let the parent know it's loaded and initialized. + sendMessageToParent(new_message); + } + else if (message_name == "goodbye") + { + setState(STATE_UNLOADED); + } + else if (message_name == "shm_remove_response") + { + // Don't pass this message up to the parent + passMessage = false; + + std::string name = parsed.getValue("name"); + sharedMemoryRegionsType::iterator iter = mSharedMemoryRegions.find(name); + if (iter != mSharedMemoryRegions.end()) + { + // detach the shared memory region + iter->second->detach(); + + // and remove it from our map + mSharedMemoryRegions.erase(iter); + + // Finally, send the response to the parent. + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_INTERNAL, "shm_remove_response"); + message.setValue("name", name); + sendMessageToParent(message); + } + else + { + LL_WARNS("Plugin") << "shm_remove_response for unknown memory segment!" << LL_ENDL; + } + } + } + } + + if (passMessage) + { + LL_DEBUGS("Plugin") << "Passing through to parent: " << message << LL_ENDL; + writeMessageRaw(message); + } + + while (mBlockingRequest) + { + // The plugin wants to block and wait for a response to this message. + sleep(mSleepTime); // this will pump the message pipe and process messages + + if (mBlockingResponseReceived || mSocketError != APR_SUCCESS || (mMessagePipe == NULL)) + { + // Response has been received, or we've hit an error state. Stop waiting. + mBlockingRequest = false; + mBlockingResponseReceived = false; + } + } +} + + +void LLPluginProcessChild::setState(EState state) +{ + LL_DEBUGS("Plugin") << "setting state to " << state << LL_ENDL; + mState = state; +}; + +void LLPluginProcessChild::deliverQueuedMessages() +{ + if (!mBlockingRequest) + { + while (!mMessageQueue.empty()) + { + receiveMessageRaw(mMessageQueue.front()); + mMessageQueue.pop(); + } + } +} diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 965b755887..a2f7626e81 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -96,12 +96,6 @@ private: std::string mCookiePath; std::string mPickedFile; dullahan* mCEFLib; - - U8 *mPopupBuffer; - U32 mPopupW; - U32 mPopupH; - U32 mPopupX; - U32 mPopupY; }; //////////////////////////////////////////////////////////////////////////////// @@ -131,18 +125,13 @@ MediaPluginBase(host_send_func, host_user_data) mPickedFile = ""; mCEFLib = new dullahan(); - mPopupBuffer = NULL; - mPopupW = 0; - mPopupH = 0; - mPopupX = 0; - mPopupY = 0; } //////////////////////////////////////////////////////////////////////////////// // MediaPluginCEF::~MediaPluginCEF() { - delete[] mPopupBuffer; + mCEFLib->shutdown(); } //////////////////////////////////////////////////////////////////////////////// @@ -217,10 +206,11 @@ void MediaPluginCEF::onLoadStartCallback() // void MediaPluginCEF::onRequestExitCallback() { - mCEFLib->shutdown(); - LLPluginMessage message("base", "goodbye"); sendMessage(message); + + mDeleteMe = true; + //mCEFLib->shutdown(); } //////////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 9f05ee61bd..900075488f 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -604,7 +604,9 @@ void LLViewerMedia::updateMedia(void *dummy_arg) LLPluginProcessParent::setUseReadThread(gSavedSettings.getBOOL("PluginUseReadThread")); // HACK: we always try to keep a spare running webkit plugin around to improve launch times. - createSpareBrowserMediaSource(); + // 2017-04-19 Removed CP - this doesn't appear to buy us much and consumes a lot of resources so + // removing it for now. + //createSpareBrowserMediaSource(); sAnyMediaShowing = false; sAnyMediaPlaying = false; -- cgit v1.3 From 504f1db9c9f975ce54d424d32876cc92a947be12 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 21 Apr 2017 09:12:11 -0400 Subject: DRTVWR-418: Update to havok-source build 504455. --- autobuild.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'autobuild.xml') diff --git a/autobuild.xml b/autobuild.xml index b409d67b5e..2802727196 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -1376,9 +1376,9 @@ archive hash - 814bed3b81820d83a184c0f0a805e92d + 8c06877b3499cb68fce7acacd1b5f7a0 url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/3613/9353/havok_source-2012.1-2-darwin64-503601.tar.bz2 + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/4467/13273/havok_source-2012.1-2-darwin64-504455.tar.bz2 name darwin64 @@ -1412,9 +1412,9 @@ archive hash - 7d4517f7a601391e83ba2e08f2ea518f + 1fe2d6f9c355c4b61d70ce65482440d5 url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/3621/9389/havok_source-2012.1-2-windows-503601.tar.bz2 + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/4468/13279/havok_source-2012.1-2-windows-504455.tar.bz2 name windows @@ -1424,9 +1424,9 @@ archive hash - b15b374f49ce4ac910889f5b7e150c73 + a8e92e72394b1d24e4700d4297ec6053 url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/3614/9359/havok_source-2012.1-2-windows64-503601.tar.bz2 + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/4469/13285/havok_source-2012.1-2-windows64-504455.tar.bz2 name windows64 -- cgit v1.3 From a5247189aad81a31f4e50d865cf7837336ecf5d9 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 21 Apr 2017 12:26:30 -0400 Subject: DRTVWR-418: Update to havok-source build 504463. --- autobuild.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'autobuild.xml') diff --git a/autobuild.xml b/autobuild.xml index 2802727196..f1d0cf37cf 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -1376,9 +1376,9 @@ archive hash - 8c06877b3499cb68fce7acacd1b5f7a0 + 71a1a177654dc14242bb5ea96fbae0d7 url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/4467/13273/havok_source-2012.1-2-darwin64-504455.tar.bz2 + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/4475/13298/havok_source-2012.1-2-darwin64-504463.tar.bz2 name darwin64 @@ -1412,9 +1412,9 @@ archive hash - 1fe2d6f9c355c4b61d70ce65482440d5 + b048e59efc0c51cb55c20445a2cb7944 url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/4468/13279/havok_source-2012.1-2-windows-504455.tar.bz2 + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/4477/13310/havok_source-2012.1-2-windows-504463.tar.bz2 name windows @@ -1424,9 +1424,9 @@ archive hash - a8e92e72394b1d24e4700d4297ec6053 + 7a120851d55adefdea504af8b2905d31 url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/4469/13285/havok_source-2012.1-2-windows64-504455.tar.bz2 + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/4476/13304/havok_source-2012.1-2-windows64-504463.tar.bz2 name windows64 -- cgit v1.3 From 5ea93fc85c2ac2ec862306cab25909aa0a45a411 Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Mon, 24 Apr 2017 13:13:26 -0700 Subject: pull in nickyd's changes to APR and LLCEFLib (Dullahan) for MAINT-6116 Console window appears breifly for Flash sites --- autobuild.xml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'autobuild.xml') diff --git a/autobuild.xml b/autobuild.xml index 1ff5d8ade4..f5f0c3e6f6 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -112,9 +112,9 @@ archive hash - 7d97a3788ea4f89eccb7789e4f015bb3 + f80a5551e8a0257efd7a73ed9bbf18f1 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/747/1540/apr_suite-1.4.5.500735-windows-500735.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4174/11812/apr_suite-1.4.5.504161-windows-504161.tar.bz2 name windows @@ -124,16 +124,16 @@ archive hash - 8820c4df1079a9af53f52485f50ff179 + ff2fc463385024c37532c0cc73c1c989 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/746/1537/apr_suite-1.4.5.500735-windows64-500735.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4172/11806/apr_suite-1.4.5.504161-windows64-504161.tar.bz2 name windows64 version - 1.4.5.500735 + 1.4.5.504161 boost @@ -538,9 +538,9 @@ archive hash - 9c2abd5b606a5f0580c4cbb4e9aedfaa + f537886de9bb68d8698f08fecaa843f3 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4385/12990/dullahan-1.1.764_3.2987.1591.gd3e47f5-windows-504373.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4536/13621/dullahan-1.1.764_3.2987.1591.gd3e47f5-windows-504524.tar.bz2 name windows @@ -550,9 +550,9 @@ archive hash - 9e6714e4c3286a0b268577300043d998 + 5d841fad742e58a050fb529b2f5ab965 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4386/12995/dullahan-1.1.764_3.2987.1591.gd3e47f5-windows64-504373.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4535/13626/dullahan-1.1.764_3.2987.1591.gd3e47f5-windows64-504524.tar.bz2 name windows64 -- cgit v1.3 From 579fd1a958174e0b313744ad49a598a187ef91b3 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 26 Apr 2017 19:03:52 -0400 Subject: DRTVWR-418: Update havok-source to build 504680, with Havok fix. --- autobuild.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'autobuild.xml') diff --git a/autobuild.xml b/autobuild.xml index 85211414b6..168ef4aec7 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -1376,9 +1376,9 @@ archive hash - 71a1a177654dc14242bb5ea96fbae0d7 + a0c4405c9e44d4a0135fe20ba8cfbace url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/4475/13298/havok_source-2012.1-2-darwin64-504463.tar.bz2 + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/4693/14627/havok_source-2012.1-2-darwin64-504680.tar.bz2 name darwin64 @@ -1412,9 +1412,9 @@ archive hash - b048e59efc0c51cb55c20445a2cb7944 + 035572a1929be66f6c56468e0ef7fe74 url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/4477/13310/havok_source-2012.1-2-windows-504463.tar.bz2 + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/4695/14637/havok_source-2012.1-2-windows-504680.tar.bz2 name windows @@ -1424,9 +1424,9 @@ archive hash - 7a120851d55adefdea504af8b2905d31 + d8525d2fbb9e0f7bc31427b47350e468 url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/4476/13304/havok_source-2012.1-2-windows64-504463.tar.bz2 + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/4694/14634/havok_source-2012.1-2-windows64-504680.tar.bz2 name windows64 -- cgit v1.3 From cdbad842c276efda32b36aba1040e3205f0fc38c Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 26 Apr 2017 22:29:54 -0400 Subject: DRTVWR-418: Update llphysicsextensions_source to 504710, _stub to 504712. --- autobuild.xml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'autobuild.xml') diff --git a/autobuild.xml b/autobuild.xml index 168ef4aec7..6d6ad0aba6 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -2130,9 +2130,9 @@ archive hash - e2b519ee7538b25877e34ede6864a250 + 162a3fc9b66626072ec8679361b174f5 url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/1691/3748/llphysicsextensions_source-1.0.501678-darwin64-501678.tar.bz2 + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/4722/14837/llphysicsextensions_source-1.0.504710-darwin64-504710.tar.bz2 name darwin64 @@ -2142,9 +2142,9 @@ archive hash - 9b2c1f53f7f1add01af1e7cfa737e20e + c1b43e99c5ddccc18b0e9cb288bf75e1 url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/1689/3734/llphysicsextensions_source-1.0.501678-linux64-501678.tar.bz2 + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/4721/14828/llphysicsextensions_source-1.0.504710-linux64-504710.tar.bz2 name linux64 @@ -2154,16 +2154,16 @@ archive hash - 5e8cb92ae79c9435b98e444322ec5798 + dd85c9e0f5fa3ce483ea183db008c4bc url - http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/1696/3763/llphysicsextensions_source-1.0.501678-windows-501678.tar.bz2 + http://s3-proxy.lindenlab.com/private-builds-secondlife-com/ct2/4726/14858/llphysicsextensions_source-1.0.504710-windows-504710.tar.bz2 name windows version - 1.0.501678 + 1.0.504710 llphysicsextensions_stub @@ -2182,9 +2182,9 @@ archive hash - 32309a20161f54f42d08f7bc1e7fcf01 + 566aa2c6f5b2f40a8b0bedf90d9c6beb url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/1692/3749/llphysicsextensions_stub-1.0.501679-darwin64-501679.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4723/14838/llphysicsextensions_stub-1.0.504712-darwin64-504712.tar.bz2 name darwin64 @@ -2194,9 +2194,9 @@ archive hash - 58af530891721f3690a4dce9a8c73190 + 711f4ec769e4b5f59ba25ee43c11bcbc url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/1690/3739/llphysicsextensions_stub-1.0.501679-linux64-501679.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4724/14846/llphysicsextensions_stub-1.0.504712-linux64-504712.tar.bz2 name linux64 @@ -2206,16 +2206,16 @@ archive hash - c59cb5d1dd96ab51f87cd0cf202304dd + d830aca10ea9396557b1e613c2736e49 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/1695/3757/llphysicsextensions_stub-1.0.501679-windows-501679.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4725/14853/llphysicsextensions_stub-1.0.504712-windows-504712.tar.bz2 name windows version - 1.0.501679 + 1.0.504712 mesa -- cgit v1.3 From a32ec9e983c2aaf991ffff88fb5ad283c0b895d1 Mon Sep 17 00:00:00 2001 From: "callum@lindenlab.com" Date: Fri, 28 Apr 2017 13:51:09 -0700 Subject: Pull in Nickyd's changes to APR and LLCEFLib (Dullahan) for MAINT-6116 Console window appears breifly for Flash sites --- autobuild.xml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'autobuild.xml') diff --git a/autobuild.xml b/autobuild.xml index f5f0c3e6f6..534b9a0478 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -76,9 +76,9 @@ archive hash - ae733dd8f2c83055030ea6e08c623306 + f65774ebabb256f2d217a872b0cf2b5b url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/745/1534/apr_suite-1.4.5.500735-darwin64-500735.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4812/15284/apr_suite-1.4.5.504800-darwin64-504800.tar.bz2 name darwin64 @@ -100,9 +100,9 @@ archive hash - bc8855c8253b8293c7e61af7b1ed0f05 + 84a1a140f20b25d714949185e854d14b url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/744/1545/apr_suite-1.4.5.500735-linux64-500735.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4811/15302/apr_suite-1.4.5.504800-linux64-504800.tar.bz2 name linux64 @@ -112,9 +112,9 @@ archive hash - f80a5551e8a0257efd7a73ed9bbf18f1 + dc80eca3d113b038b469003da8cd6638 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4174/11812/apr_suite-1.4.5.504161-windows-504161.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4813/15290/apr_suite-1.4.5.504800-windows-504800.tar.bz2 name windows @@ -124,16 +124,16 @@ archive hash - ff2fc463385024c37532c0cc73c1c989 + 63146d3d3d5fe7aa6be1a1b0afed36dd url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4172/11806/apr_suite-1.4.5.504161-windows64-504161.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4814/15296/apr_suite-1.4.5.504800-windows64-504800.tar.bz2 name windows64 version - 1.4.5.504161 + 1.4.5.504800 boost @@ -526,9 +526,9 @@ archive hash - 9005fcda30e6659790e2fdfc27d4e2ee + 2924fbd14d8d5346dff79a9834a3dd00 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4384/12984/dullahan-1.1.764_3.2987.1591.gd3e47f5-darwin64-504373.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4804/15260/dullahan-1.1.764_3.2987.1591.gd3e47f5-darwin64-504793.tar.bz2 name darwin64 @@ -538,9 +538,9 @@ archive hash - f537886de9bb68d8698f08fecaa843f3 + 45a2dc847fe3348ced66f9f81802f7e4 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4536/13621/dullahan-1.1.764_3.2987.1591.gd3e47f5-windows-504524.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4806/15271/dullahan-1.1.764_3.2987.1591.gd3e47f5-windows-504793.tar.bz2 name windows @@ -550,9 +550,9 @@ archive hash - 5d841fad742e58a050fb529b2f5ab965 + 2bd634d9b5ec8710e7a898dddb7231b2 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4535/13626/dullahan-1.1.764_3.2987.1591.gd3e47f5-windows64-504524.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4805/15265/dullahan-1.1.764_3.2987.1591.gd3e47f5-windows64-504793.tar.bz2 name windows64 -- cgit v1.3 From 49745fe4edad24c0fc4f9428829a974b273db979 Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Mon, 1 May 2017 12:43:14 -0700 Subject: Pull in new version of Dullahan that is built against latest version of CEF (CEF 3.3029.1611.g44e39a8 / Chromium 58.0.3029.81) --- autobuild.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'autobuild.xml') diff --git a/autobuild.xml b/autobuild.xml index 534b9a0478..a4d4cf7d82 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -526,9 +526,9 @@ archive hash - 2924fbd14d8d5346dff79a9834a3dd00 + da5c705fa4fae169cba26fba92dba1ef url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4804/15260/dullahan-1.1.764_3.2987.1591.gd3e47f5-darwin64-504793.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4835/15404/dullahan-1.1.800_3.3029.1611.g44e39a8-darwin64-504824.tar.bz2 name darwin64 @@ -538,9 +538,9 @@ archive hash - 45a2dc847fe3348ced66f9f81802f7e4 + 17cd8f6e8f95df877d0c9c234f860324 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4806/15271/dullahan-1.1.764_3.2987.1591.gd3e47f5-windows-504793.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4836/15410/dullahan-1.1.800_3.3029.1611.g44e39a8-windows-504824.tar.bz2 name windows @@ -550,16 +550,16 @@ archive hash - 2bd634d9b5ec8710e7a898dddb7231b2 + 7a478f8f0e13f5f81cab657a8c351186 url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4805/15265/dullahan-1.1.764_3.2987.1591.gd3e47f5-windows64-504793.tar.bz2 + http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4837/15415/dullahan-1.1.800_3.3029.1611.g44e39a8-windows64-504824.tar.bz2 name windows64 version - 1.1.764_3.2987.1591.gd3e47f5 + 1.1.800_3.3029.1611.g44e39a8 elfio -- cgit v1.3