From 1ea60591a9b5f46a66527497b7b14b843a663de8 Mon Sep 17 00:00:00 2001 From: brad kittenbrink Date: Fri, 13 Nov 2009 20:33:59 -0500 Subject: Refactoring of llviewerprecompiledheaders.h to hopefully increase stability and reduce unnecessary dependencies and incredibuild wedging. Hopefully in the long run this will reduce build time. Also cleaned up a lot of header file usage to conform better to the coding standard. reviewed by james and steve. --- indra/llplugin/llpluginprocessparent.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llplugin') diff --git a/indra/llplugin/llpluginprocessparent.h b/indra/llplugin/llpluginprocessparent.h index 25669f5d78..17608063b5 100644 --- a/indra/llplugin/llpluginprocessparent.h +++ b/indra/llplugin/llpluginprocessparent.h @@ -34,6 +34,7 @@ #ifndef LL_LLPLUGINPROCESSPARENT_H #define LL_LLPLUGINPROCESSPARENT_H +#include "llapr.h" #include "llprocesslauncher.h" #include "llpluginmessage.h" #include "llpluginmessagepipe.h" -- cgit v1.3 From 5e4d7ec715f496406644d52701cbabc2935fc1c3 Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Fri, 11 Dec 2009 17:50:59 -0800 Subject: In LLPluginProcessParent, instead of killing the plugin process, terminate it by closing the sockets. This lets it do some cleanup before exiting, instead of just getting shot. --- indra/llplugin/llpluginprocessparent.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'indra/llplugin') diff --git a/indra/llplugin/llpluginprocessparent.cpp b/indra/llplugin/llpluginprocessparent.cpp index f60838b1e7..dab6d645dd 100644 --- a/indra/llplugin/llpluginprocessparent.cpp +++ b/indra/llplugin/llpluginprocessparent.cpp @@ -79,8 +79,10 @@ LLPluginProcessParent::~LLPluginProcessParent() // and remove it from our map mSharedMemoryRegions.erase(iter); } - - mProcess.kill(); + + // orphaning the process means it won't be killed when the LLProcessLauncher is destructed. + // This is what we want -- it should exit cleanly once it notices the sockets have been closed. + mProcess.orphan(); killSockets(); } @@ -414,7 +416,8 @@ void LLPluginProcessParent::idle(void) break; case STATE_CLEANUP: - mProcess.kill(); + // Don't do a kill here anymore -- closing the sockets is the new 'kill'. + mProcess.orphan(); killSockets(); setState(STATE_DONE); break; -- cgit v1.3 From 6cb3d25942bc2dc67f41efedb3a90db1b559b3b9 Mon Sep 17 00:00:00 2001 From: callum Date: Wed, 16 Dec 2009 13:10:03 -0800 Subject: Merge with tip --- indra/llplugin/llpluginprocessparent.cpp | 1 + indra/media_plugins/webkit/media_plugin_webkit.cpp | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/llplugin') diff --git a/indra/llplugin/llpluginprocessparent.cpp b/indra/llplugin/llpluginprocessparent.cpp index dab6d645dd..608e444375 100644 --- a/indra/llplugin/llpluginprocessparent.cpp +++ b/indra/llplugin/llpluginprocessparent.cpp @@ -62,6 +62,7 @@ LLPluginProcessParent::LLPluginProcessParent(LLPluginProcessParentOwner *owner) // initialize timer - heartbeat test (mHeartbeat.hasExpired()) // can sometimes return true immediately otherwise and plugins // fail immediately because it looks like +// mHeartbeat.initClass(); mHeartbeat.setTimerExpirySec(PLUGIN_LOCKED_UP_SECONDS); } diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp index 707edaa3d6..844da76042 100644 --- a/indra/media_plugins/webkit/media_plugin_webkit.cpp +++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp @@ -205,7 +205,6 @@ private: { // create single browser window mBrowserWindowId = LLQtWebKit::getInstance()->createBrowserWindow( mWidth, mHeight ); - #if LL_WINDOWS // Enable plugins LLQtWebKit::getInstance()->enablePlugins(true); @@ -216,7 +215,9 @@ private: // Disable plugins LLQtWebKit::getInstance()->enablePlugins(false); #endif - + // Enable cookies + LLQtWebKit::getInstance()->enableCookies( true ); + // tell LLQtWebKit about the size of the browser window LLQtWebKit::getInstance()->setSize( mBrowserWindowId, mWidth, mHeight ); -- cgit v1.3 From eb7bd0a214ad794db9cb2acb33c45b9d7f46b981 Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Thu, 17 Dec 2009 18:00:59 -0800 Subject: Changed default launch timeout in LLPluginProcessParent to 60 seconds, and added an to LLPluginProcessParent that allows callers to adjust the launch and lockup timeouts. --- indra/llplugin/llpluginprocessparent.cpp | 24 +++++++++--------------- indra/llplugin/llpluginprocessparent.h | 7 +++++++ 2 files changed, 16 insertions(+), 15 deletions(-) (limited to 'indra/llplugin') diff --git a/indra/llplugin/llpluginprocessparent.cpp b/indra/llplugin/llpluginprocessparent.cpp index 608e444375..49f9783824 100644 --- a/indra/llplugin/llpluginprocessparent.cpp +++ b/indra/llplugin/llpluginprocessparent.cpp @@ -39,12 +39,6 @@ #include "llapr.h" -// If we don't receive a heartbeat in this many seconds, we declare the plugin locked up. -static const F32 PLUGIN_LOCKED_UP_SECONDS = 15.0f; - -// Somewhat longer timeout for initial launch. -static const F32 PLUGIN_LAUNCH_SECONDS = 20.0f; - //virtual LLPluginProcessParentOwner::~LLPluginProcessParentOwner() { @@ -59,11 +53,11 @@ LLPluginProcessParent::LLPluginProcessParent(LLPluginProcessParentOwner *owner) mDisableTimeout = false; mDebug = false; - // initialize timer - heartbeat test (mHeartbeat.hasExpired()) - // can sometimes return true immediately otherwise and plugins - // fail immediately because it looks like -// mHeartbeat.initClass(); - mHeartbeat.setTimerExpirySec(PLUGIN_LOCKED_UP_SECONDS); + mPluginLaunchTimeout = 60.0f; + mPluginLockupTimeout = 15.0f; + + // Don't start the timer here -- start it when we actually launch the plugin process. + mHeartbeat.stop(); } LLPluginProcessParent::~LLPluginProcessParent() @@ -326,7 +320,7 @@ void LLPluginProcessParent::idle(void) // This will allow us to time out if the process never starts. mHeartbeat.start(); - mHeartbeat.setTimerExpirySec(PLUGIN_LAUNCH_SECONDS); + mHeartbeat.setTimerExpirySec(mPluginLaunchTimeout); setState(STATE_LAUNCHED); } } @@ -560,7 +554,7 @@ void LLPluginProcessParent::receiveMessage(const LLPluginMessage &message) else if(message_name == "heartbeat") { // this resets our timer. - mHeartbeat.setTimerExpirySec(PLUGIN_LOCKED_UP_SECONDS); + mHeartbeat.setTimerExpirySec(mPluginLockupTimeout); mCPUUsage = message.getValueReal("cpu_usage"); @@ -715,7 +709,7 @@ bool LLPluginProcessParent::pluginLockedUpOrQuit() bool LLPluginProcessParent::pluginLockedUp() { - // If the timer has expired, the plugin has locked up. - return mHeartbeat.hasExpired(); + // If the timer is running and has expired, the plugin has locked up. + return (mHeartbeat.getStarted() && mHeartbeat.hasExpired()); } diff --git a/indra/llplugin/llpluginprocessparent.h b/indra/llplugin/llpluginprocessparent.h index 03ce10f86c..524cd9923f 100644 --- a/indra/llplugin/llpluginprocessparent.h +++ b/indra/llplugin/llpluginprocessparent.h @@ -102,6 +102,9 @@ public: bool getDisableTimeout() { return mDisableTimeout; }; void setDisableTimeout(bool disable) { mDisableTimeout = disable; }; + + void setLaunchTimeout(F32 timeout) { mPluginLaunchTimeout = timeout; }; + void setLockupTimeout(F32 timeout) { mPluginLockupTimeout = timeout; }; F64 getCPUUsage() { return mCPUUsage; }; @@ -158,6 +161,10 @@ private: bool mDebug; LLProcessLauncher mDebugger; + + F32 mPluginLaunchTimeout; // Somewhat longer timeout for initial launch. + F32 mPluginLockupTimeout; // If we don't receive a heartbeat in this many seconds, we declare the plugin locked up. + }; #endif // LL_LLPLUGINPROCESSPARENT_H -- cgit v1.3