From 197de032e1f66894f595a3a1ba46b36f45f8e8f5 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 9 Dec 2009 12:57:10 -0800 Subject: DEV-43948 viewer2 is writing session data into the 'read-only' installation tree (mostly media stuff) propagate the parent app's OSUserAppDir (i.e. ~/.secondlife/) all the way down to plugins, if they need persistant user data/settings (like the webkit plugin needs a place to put its cache). --- indra/media_plugins/webkit/media_plugin_webkit.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'indra/media_plugins/webkit/media_plugin_webkit.cpp') diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp index 25f4c8720a..1ead310754 100644 --- a/indra/media_plugins/webkit/media_plugin_webkit.cpp +++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp @@ -76,6 +76,8 @@ public: private: + std::string mProfileDir; + enum { INIT_STATE_UNINITIALIZED, // Browser instance hasn't been set up yet @@ -187,7 +189,6 @@ private: #else std::string component_dir = application_dir; #endif - std::string profileDir = application_dir + "/" + "browser_profile"; // cross platform? // window handle - needed on Windows and must be app window. #if LL_WINDOWS @@ -199,7 +200,7 @@ private: #endif // main browser initialization - bool result = LLQtWebKit::getInstance()->init( application_dir, component_dir, profileDir, native_window_handle ); + bool result = LLQtWebKit::getInstance()->init( application_dir, component_dir, mProfileDir, native_window_handle ); if ( result ) { // create single browser window @@ -576,7 +577,7 @@ MediaPluginWebKit::~MediaPluginWebKit() void MediaPluginWebKit::receiveMessage(const char *message_string) { -// std::cerr << "MediaPluginWebKit::receiveMessage: received message: \"" << message_string << "\"" << std::endl; + std::cerr << "MediaPluginWebKit::receiveMessage: received message: \"" << message_string << "\"" << std::endl; LLPluginMessage message_in; if(message_in.parse(message_string) >= 0) @@ -587,6 +588,9 @@ void MediaPluginWebKit::receiveMessage(const char *message_string) { if(message_name == "init") { + std::string user_data_path = message_in.getValue("user_data_path"); // n.b. always has trailing platform-specific dir-delimiter + mProfileDir = user_data_path + "browser_profile"; + LLPluginMessage message("base", "init_response"); LLSD versions = LLSD::emptyMap(); versions[LLPLUGIN_MESSAGE_CLASS_BASE] = LLPLUGIN_MESSAGE_CLASS_BASE_VERSION; -- cgit v1.2.3 From 05e0d9d24ac4ec1c0b18326e97a0c9ab705f5948 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Wed, 9 Dec 2009 14:36:45 -0800 Subject: Re-disable a very spewy debug spew in the webkit plugin. Mea culpa. --- indra/media_plugins/webkit/media_plugin_webkit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/media_plugins/webkit/media_plugin_webkit.cpp') diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp index 1ead310754..276ad39dfb 100644 --- a/indra/media_plugins/webkit/media_plugin_webkit.cpp +++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp @@ -577,7 +577,7 @@ MediaPluginWebKit::~MediaPluginWebKit() void MediaPluginWebKit::receiveMessage(const char *message_string) { - std::cerr << "MediaPluginWebKit::receiveMessage: received message: \"" << message_string << "\"" << std::endl; +// std::cerr << "MediaPluginWebKit::receiveMessage: received message: \"" << message_string << "\"" << std::endl; LLPluginMessage message_in; if(message_in.parse(message_string) >= 0) -- cgit v1.2.3