From d5e685306ce100a62db06a36dfef58f3beb22b7a Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Fri, 12 Mar 2010 14:34:25 -0800 Subject: (for B5) Fix for EXT-5823 "Include language in user-agent string" (implemented via JavaScript - not in ua string) (for B5) Fix for EXT-5314 "Inworld Browser blanks out at credit card entry" Note: also includes an update to install.xml that points to a new version of LLQtWebKit that is required for these fixes --- indra/llplugin/llpluginclassmedia.cpp | 4 ++-- indra/llplugin/llpluginclassmedia.h | 6 +++++- indra/llplugin/llpluginprocesschild.cpp | 2 ++ indra/llplugin/llpluginprocesschild.h | 1 + indra/llplugin/llpluginprocessparent.cpp | 4 +++- indra/llplugin/llpluginprocessparent.h | 8 +++++++- 6 files changed, 20 insertions(+), 5 deletions(-) (limited to 'indra/llplugin') diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index 6a2449cf4b..d48f4ad0f5 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -65,7 +65,7 @@ LLPluginClassMedia::~LLPluginClassMedia() reset(); } -bool LLPluginClassMedia::init(const std::string &launcher_filename, const std::string &plugin_filename, bool debug, const std::string &user_data_path) +bool LLPluginClassMedia::init(const std::string &launcher_filename, const std::string &plugin_filename, bool debug, const std::string &user_data_path, const std::string &language_code) { LL_DEBUGS("Plugin") << "launcher: " << launcher_filename << LL_ENDL; LL_DEBUGS("Plugin") << "plugin: " << plugin_filename << LL_ENDL; @@ -73,7 +73,7 @@ bool LLPluginClassMedia::init(const std::string &launcher_filename, const std::s mPlugin = new LLPluginProcessParent(this); mPlugin->setSleepTime(mSleepTime); - mPlugin->init(launcher_filename, plugin_filename, debug, user_data_path); + mPlugin->init(launcher_filename, plugin_filename, debug, user_data_path,language_code); return true; } diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h index 58e91fa0b4..ce49241e84 100644 --- a/indra/llplugin/llpluginclassmedia.h +++ b/indra/llplugin/llpluginclassmedia.h @@ -49,7 +49,11 @@ public: virtual ~LLPluginClassMedia(); // local initialization, called by the media manager when creating a source - virtual bool init(const std::string &launcher_filename, const std::string &plugin_filename, bool debug, const std::string &user_data_path); + virtual bool init(const std::string &launcher_filename, + const std::string &plugin_filename, + bool debug, + const std::string &user_data_path, + const std::string &language_code); // undoes everything init() didm called by the media manager when destroying a source virtual void reset(); diff --git a/indra/llplugin/llpluginprocesschild.cpp b/indra/llplugin/llpluginprocesschild.cpp index 52b5a319ec..9b43ec0e3e 100644 --- a/indra/llplugin/llpluginprocesschild.cpp +++ b/indra/llplugin/llpluginprocesschild.cpp @@ -156,6 +156,7 @@ void LLPluginProcessChild::idle(void) setState(STATE_PLUGIN_INITIALIZING); LLPluginMessage message("base", "init"); message.setValue("user_data_path", mUserDataPath); + message.setValue("language_code", mLanguageCode); sendMessageToPlugin(message); } break; @@ -329,6 +330,7 @@ void LLPluginProcessChild::receiveMessageRaw(const std::string &message) { mPluginFile = parsed.getValue("file"); mUserDataPath = parsed.getValue("user_data_path"); + mLanguageCode = parsed.getValue("language_code"); } else if(message_name == "shm_add") { diff --git a/indra/llplugin/llpluginprocesschild.h b/indra/llplugin/llpluginprocesschild.h index 58f8935ed1..af76ec1fa5 100644 --- a/indra/llplugin/llpluginprocesschild.h +++ b/indra/llplugin/llpluginprocesschild.h @@ -99,6 +99,7 @@ private: std::string mPluginFile; std::string mUserDataPath; + std::string mLanguageCode; LLPluginInstance *mInstance; diff --git a/indra/llplugin/llpluginprocessparent.cpp b/indra/llplugin/llpluginprocessparent.cpp index efd5df687e..0ce2c759ba 100644 --- a/indra/llplugin/llpluginprocessparent.cpp +++ b/indra/llplugin/llpluginprocessparent.cpp @@ -98,13 +98,14 @@ void LLPluginProcessParent::errorState(void) setState(STATE_ERROR); } -void LLPluginProcessParent::init(const std::string &launcher_filename, const std::string &plugin_filename, bool debug, const std::string &user_data_path) +void LLPluginProcessParent::init(const std::string &launcher_filename, const std::string &plugin_filename, bool debug, const std::string &user_data_path, const std::string &language_code) { mProcess.setExecutable(launcher_filename); mPluginFile = plugin_filename; mCPUUsage = 0.0f; mDebug = debug; mUserDataPath = user_data_path; + mLanguageCode = language_code; setState(STATE_INITIALIZED); } @@ -363,6 +364,7 @@ void LLPluginProcessParent::idle(void) LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_INTERNAL, "load_plugin"); message.setValue("file", mPluginFile); message.setValue("user_data_path", mUserDataPath); + message.setValue("language_code", mLanguageCode); sendMessage(message); } diff --git a/indra/llplugin/llpluginprocessparent.h b/indra/llplugin/llpluginprocessparent.h index 524cd9923f..23702814c8 100644 --- a/indra/llplugin/llpluginprocessparent.h +++ b/indra/llplugin/llpluginprocessparent.h @@ -59,7 +59,12 @@ public: LLPluginProcessParent(LLPluginProcessParentOwner *owner); ~LLPluginProcessParent(); - void init(const std::string &launcher_filename, const std::string &plugin_filename, bool debug, const std::string &user_data_path); + void init(const std::string &launcher_filename, + const std::string &plugin_filename, + bool debug, + const std::string &user_data_path, + const std::string &language_code); + void idle(void); // returns true if the plugin is on its way to steady state @@ -144,6 +149,7 @@ private: std::string mPluginFile; std::string mUserDataPath; + std::string mLanguageCode; LLPluginProcessParentOwner *mOwner; -- cgit v1.2.3 From ce242821dcf83bde15b49895c24019347b266d97 Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Tue, 16 Mar 2010 16:42:31 -0700 Subject: Added an "init" message in LLPLUGIN_MESSAGE_CLASS_MEDIA, and made LLPluginClassMedia queue it up before initializing its LLPluginProcessParent. Made all existing plugins send their texture_params message from this init message instead of the LLPLUGIN_MESSAGE_CLASS_BASE "init" message. (This ensures that they won't start to receive 'size_change' messages until after the init has happened.) Added "set_user_data_path" and "set_language_code" messages to LLPluginClassMedia. Made webkit plugin deal with the new messages, when they're sent before it receives the media "init". Removed the user_data_path and language_code arguments from the init function calls throughout the hierarchy. Made LLViewerMediaImpl queue up the language code and user data path messages before initializing the media. Reviewed by Callum at http://codereview.lindenlab.com/687006 . --- indra/llplugin/llpluginclassmedia.cpp | 24 +++++++++++++++++++++--- indra/llplugin/llpluginclassmedia.h | 8 +++++--- indra/llplugin/llpluginprocesschild.cpp | 4 ---- indra/llplugin/llpluginprocesschild.h | 3 --- indra/llplugin/llpluginprocessparent.cpp | 9 ++------- indra/llplugin/llpluginprocessparent.h | 7 +------ 6 files changed, 29 insertions(+), 26 deletions(-) (limited to 'indra/llplugin') diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index d48f4ad0f5..cb62e46271 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -65,15 +65,19 @@ LLPluginClassMedia::~LLPluginClassMedia() reset(); } -bool LLPluginClassMedia::init(const std::string &launcher_filename, const std::string &plugin_filename, bool debug, const std::string &user_data_path, const std::string &language_code) +bool LLPluginClassMedia::init(const std::string &launcher_filename, const std::string &plugin_filename, bool debug) { LL_DEBUGS("Plugin") << "launcher: " << launcher_filename << LL_ENDL; LL_DEBUGS("Plugin") << "plugin: " << plugin_filename << LL_ENDL; - LL_DEBUGS("Plugin") << "user_data_path: " << user_data_path << LL_ENDL; mPlugin = new LLPluginProcessParent(this); mPlugin->setSleepTime(mSleepTime); - mPlugin->init(launcher_filename, plugin_filename, debug, user_data_path,language_code); + + // Queue up the media init message -- it will be sent after all the currently queued messages. + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "init"); + sendMessage(message); + + mPlugin->init(launcher_filename, plugin_filename, debug); return true; } @@ -678,6 +682,20 @@ void LLPluginClassMedia::paste() sendMessage(message); } +void LLPluginClassMedia::setUserDataPath(const std::string &user_data_path) +{ + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "set_user_data_path"); + message.setValue("path", user_data_path); + sendMessage(message); +} + +void LLPluginClassMedia::setLanguageCode(const std::string &language_code) +{ + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "set_language_code"); + message.setValue("language", language_code); + sendMessage(message); +} + LLPluginClassMedia::ETargetType getTargetTypeFromLLQtWebkit(int target_type) { // convert a LinkTargetType value from llqtwebkit to an ETargetType diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h index ce49241e84..6318c67f12 100644 --- a/indra/llplugin/llpluginclassmedia.h +++ b/indra/llplugin/llpluginclassmedia.h @@ -51,9 +51,7 @@ public: // local initialization, called by the media manager when creating a source virtual bool init(const std::string &launcher_filename, const std::string &plugin_filename, - bool debug, - const std::string &user_data_path, - const std::string &language_code); + bool debug); // undoes everything init() didm called by the media manager when destroying a source virtual void reset(); @@ -177,6 +175,10 @@ public: void paste(); bool canPaste() const { return mCanPaste; }; + + // These can be called before init(), and they will be queued and sent before the media init message. + void setUserDataPath(const std::string &user_data_path); + void setLanguageCode(const std::string &language_code); /////////////////////////////////// // media browser class functions diff --git a/indra/llplugin/llpluginprocesschild.cpp b/indra/llplugin/llpluginprocesschild.cpp index 9b43ec0e3e..ccaf95b36d 100644 --- a/indra/llplugin/llpluginprocesschild.cpp +++ b/indra/llplugin/llpluginprocesschild.cpp @@ -155,8 +155,6 @@ void LLPluginProcessChild::idle(void) { setState(STATE_PLUGIN_INITIALIZING); LLPluginMessage message("base", "init"); - message.setValue("user_data_path", mUserDataPath); - message.setValue("language_code", mLanguageCode); sendMessageToPlugin(message); } break; @@ -329,8 +327,6 @@ void LLPluginProcessChild::receiveMessageRaw(const std::string &message) if(message_name == "load_plugin") { mPluginFile = parsed.getValue("file"); - mUserDataPath = parsed.getValue("user_data_path"); - mLanguageCode = parsed.getValue("language_code"); } else if(message_name == "shm_add") { diff --git a/indra/llplugin/llpluginprocesschild.h b/indra/llplugin/llpluginprocesschild.h index af76ec1fa5..0e5e85406a 100644 --- a/indra/llplugin/llpluginprocesschild.h +++ b/indra/llplugin/llpluginprocesschild.h @@ -98,9 +98,6 @@ private: std::string mPluginFile; - std::string mUserDataPath; - std::string mLanguageCode; - LLPluginInstance *mInstance; typedef std::map sharedMemoryRegionsType; diff --git a/indra/llplugin/llpluginprocessparent.cpp b/indra/llplugin/llpluginprocessparent.cpp index 0ce2c759ba..895c858979 100644 --- a/indra/llplugin/llpluginprocessparent.cpp +++ b/indra/llplugin/llpluginprocessparent.cpp @@ -98,15 +98,12 @@ void LLPluginProcessParent::errorState(void) setState(STATE_ERROR); } -void LLPluginProcessParent::init(const std::string &launcher_filename, const std::string &plugin_filename, bool debug, const std::string &user_data_path, const std::string &language_code) +void LLPluginProcessParent::init(const std::string &launcher_filename, const std::string &plugin_filename, bool debug) { mProcess.setExecutable(launcher_filename); mPluginFile = plugin_filename; mCPUUsage = 0.0f; - mDebug = debug; - mUserDataPath = user_data_path; - mLanguageCode = language_code; - + mDebug = debug; setState(STATE_INITIALIZED); } @@ -363,8 +360,6 @@ void LLPluginProcessParent::idle(void) { LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_INTERNAL, "load_plugin"); message.setValue("file", mPluginFile); - message.setValue("user_data_path", mUserDataPath); - message.setValue("language_code", mLanguageCode); sendMessage(message); } diff --git a/indra/llplugin/llpluginprocessparent.h b/indra/llplugin/llpluginprocessparent.h index 23702814c8..cc6c513615 100644 --- a/indra/llplugin/llpluginprocessparent.h +++ b/indra/llplugin/llpluginprocessparent.h @@ -61,9 +61,7 @@ public: void init(const std::string &launcher_filename, const std::string &plugin_filename, - bool debug, - const std::string &user_data_path, - const std::string &language_code); + bool debug); void idle(void); @@ -148,9 +146,6 @@ private: std::string mPluginFile; - std::string mUserDataPath; - std::string mLanguageCode; - LLPluginProcessParentOwner *mOwner; typedef std::map sharedMemoryRegionsType; -- cgit v1.2.3 From cb7fbc8a2093fd1ed5440d0f3184d9080cecad48 Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Thu, 18 Mar 2010 16:53:27 -0700 Subject: EXT-6466 "Move "Enable Cookies" checkbox...", EXT-6402 "Add feature to disable Web plugins via prefs" and EXT-6401 "Add feature to disable Javascript via prefs" Apologies for the multiple commit of Jiras - these changes are closely related and impossible to commit deparately Reviewed by Monroe --- indra/llplugin/llpluginclassmedia.cpp | 15 +++++++++++++++ indra/llplugin/llpluginclassmedia.h | 2 ++ 2 files changed, 17 insertions(+) (limited to 'indra/llplugin') diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index cb62e46271..bf0e19473e 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -696,6 +696,20 @@ void LLPluginClassMedia::setLanguageCode(const std::string &language_code) sendMessage(message); } +void LLPluginClassMedia::setPluginsEnabled(const bool enabled) +{ + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "plugins_enabled"); + message.setValueBoolean("enable", enabled); + sendMessage(message); +} + +void LLPluginClassMedia::setJavascriptEnabled(const bool enabled) +{ + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "javascript_enabled"); + message.setValueBoolean("enable", enabled); + sendMessage(message); +} + LLPluginClassMedia::ETargetType getTargetTypeFromLLQtWebkit(int target_type) { // convert a LinkTargetType value from llqtwebkit to an ETargetType @@ -1065,6 +1079,7 @@ void LLPluginClassMedia::clear_cookies() void LLPluginClassMedia::enable_cookies(bool enable) { LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "enable_cookies"); + message.setValueBoolean("enable", enable); sendMessage(message); } diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h index 6318c67f12..79356beb68 100644 --- a/indra/llplugin/llpluginclassmedia.h +++ b/indra/llplugin/llpluginclassmedia.h @@ -179,6 +179,8 @@ public: // These can be called before init(), and they will be queued and sent before the media init message. void setUserDataPath(const std::string &user_data_path); void setLanguageCode(const std::string &language_code); + void setPluginsEnabled(const bool enabled); + void setJavascriptEnabled(const bool enabled); /////////////////////////////////// // media browser class functions -- cgit v1.2.3