summaryrefslogtreecommitdiff
path: root/indra/llplugin
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llplugin')
-rw-r--r--indra/llplugin/llpluginclassmedia.cpp24
-rw-r--r--indra/llplugin/llpluginclassmedia.h8
-rw-r--r--indra/llplugin/llpluginprocesschild.cpp4
-rw-r--r--indra/llplugin/llpluginprocesschild.h3
-rw-r--r--indra/llplugin/llpluginprocessparent.cpp9
-rw-r--r--indra/llplugin/llpluginprocessparent.h7
6 files changed, 29 insertions, 26 deletions
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<std::string, LLPluginSharedMemory*> 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<std::string, LLPluginSharedMemory*> sharedMemoryRegionsType;