From c46c86ca4bbad98c32a6350a34309389026ac551 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Fri, 6 May 2011 16:29:43 +0200 Subject: [PATCH] Split plugin classes and derive AIFilePicker from BasicPluginBase (part 4). Add back fixes that were in Singularity (in indra/media_plugins) but not in imprudence. Also: Add "shutdown" plugin message and terminate file picker plugins cleanly. The DSO (libbasic_plugin_filepicker.so) now tells the child process / plugin loader (SLPlugin) to terminate (using the 'shutdown' message), and AIFilePicker::finish_impl destroys the plugin object on the viewer side when it's ... finished thus. Also added a large comment that gives an overview of all classes involved on the viewer side. Additional fixes for filepicker. Plugin refactor bug fix: mDeleteMe was uninitialized in AIPluginFilePicker. --- indra/llplugin/llpluginclassbasic.h | 3 ++ indra/llplugin/llpluginprocesschild.cpp | 9 ++++ indra/llplugin/llpluginprocesschild.h | 2 +- indra/llplugin/llpluginprocessparent.cpp | 5 ++ indra/llplugin/llpluginprocessparent.h | 4 ++ indra/newview/llviewerwindow.cpp | 4 +- indra/newview/statemachine/aifilepicker.cpp | 6 ++- indra/newview/statemachine/aifilepicker.h | 53 ++++++++++++++++++- .../plugins/base_basic/basic_plugin_base.cpp | 22 ++++++-- indra/plugins/base_basic/basic_plugin_base.h | 3 ++ .../plugins/base_media/media_plugin_base.cpp | 1 - indra/plugins/example_basic/CMakeLists.txt | 4 +- indra/plugins/example_media/CMakeLists.txt | 4 +- indra/plugins/filepicker/CMakeLists.txt | 4 +- .../filepicker/basic_plugin_filepicker.cpp | 6 +++ indra/plugins/filepicker/llfilepicker.cpp | 2 +- .../media_plugin_gstreamer010.cpp | 2 +- .../quicktime/media_plugin_quicktime.cpp | 4 ++ indra/plugins/webkit/CMakeLists.txt | 4 +- indra/plugins/webkit/linux_volume_catcher.cpp | 3 +- indra/plugins/webkit/media_plugin_webkit.cpp | 39 ++------------ 21 files changed, 129 insertions(+), 55 deletions(-) diff --git a/indra/llplugin/llpluginclassbasic.h b/indra/llplugin/llpluginclassbasic.h index a9e4dba46..6c0602608 100644 --- a/indra/llplugin/llpluginclassbasic.h +++ b/indra/llplugin/llpluginclassbasic.h @@ -113,6 +113,9 @@ protected: // Inherited from LLPluginProcessParentOwner. /*virtual*/ void receivePluginMessage(LLPluginMessage const&); + // Inherited from LLPluginProcessParentOwner. + /*virtual*/ void receivedShutdown() { mPlugin->exitState(); } + //-------------------------------------- // Debug use only // diff --git a/indra/llplugin/llpluginprocesschild.cpp b/indra/llplugin/llpluginprocesschild.cpp index 2c47087ab..f844c5a2b 100644 --- a/indra/llplugin/llpluginprocesschild.cpp +++ b/indra/llplugin/llpluginprocesschild.cpp @@ -553,6 +553,15 @@ void LLPluginProcessChild::receivePluginMessage(const std::string &message) } } } + else if (message_class == LLPLUGIN_MESSAGE_CLASS_INTERNAL) + { + std::string message_name = parsed.getName(); + if(message_name == "shutdown") + { + // The plugin is finished. + setState(STATE_UNLOADING); + } + } } if(passMessage) diff --git a/indra/llplugin/llpluginprocesschild.h b/indra/llplugin/llpluginprocesschild.h index 5d643d792..66082db7c 100644 --- a/indra/llplugin/llpluginprocesschild.h +++ b/indra/llplugin/llpluginprocesschild.h @@ -88,7 +88,7 @@ private: STATE_PLUGIN_LOADED, // plugin library has been loaded STATE_PLUGIN_INITIALIZING, // plugin is processing init message STATE_RUNNING, // steady state (processing messages) - STATE_UNLOADING, // plugin has sent shutdown_response and needs to be unloaded + STATE_UNLOADING, // plugin has sent shutdown and needs to be unloaded STATE_UNLOADED, // plugin has been unloaded STATE_ERROR, // generic bailout state STATE_DONE // state machine will sit in this state after either error or normal termination. diff --git a/indra/llplugin/llpluginprocessparent.cpp b/indra/llplugin/llpluginprocessparent.cpp index 35931426d..df2f0b512 100644 --- a/indra/llplugin/llpluginprocessparent.cpp +++ b/indra/llplugin/llpluginprocessparent.cpp @@ -1001,6 +1001,11 @@ void LLPluginProcessParent::receiveMessage(const LLPluginMessage &message) LL_DEBUGS("Plugin") << "cpu usage reported as " << mCPUUsage << LL_ENDL; } + else if(message_name == "shutdown") + { + LL_INFOS("Plugin") << "received shutdown message" << LL_ENDL; + mOwner->receivedShutdown(); + } else if(message_name == "shm_add_response") { // Nothing to do here. diff --git a/indra/llplugin/llpluginprocessparent.h b/indra/llplugin/llpluginprocessparent.h index a82407d05..1ec5ef4c3 100644 --- a/indra/llplugin/llpluginprocessparent.h +++ b/indra/llplugin/llpluginprocessparent.h @@ -53,6 +53,7 @@ public: virtual ~LLPluginProcessParentOwner(); virtual void receivePluginMessage(const LLPluginMessage &message) = 0; virtual bool receivePluginMessageEarly(const LLPluginMessage &message) {return false;}; + virtual void receivedShutdown() = 0; // This will only be called when the plugin has died unexpectedly virtual void pluginLaunchFailed() {}; virtual void pluginDied() {}; @@ -88,6 +89,9 @@ public: // Go to the proper error state void errorState(void); + // Go to exit state. + void exitState(void) { setState(STATE_EXITING); } + void setSleepTime(F64 sleep_time, bool force_send = false); F64 getSleepTime(void) const { return mSleepTime; }; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 2139e75d8..2e684633c 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -4031,7 +4031,7 @@ void LLViewerWindow::saveImageNumbered(LLPointer image) void LLViewerWindow::saveImageNumbered_filepicker_callback(LLPointer image, std::string const& extension, AIFilePicker* filepicker, bool success) { llassert((bool)*filepicker == success); - if (success) + if (success && !filepicker->isCanceled()) { // Copy the directory + file name std::string filepath = filepicker->getFilename(); @@ -4041,7 +4041,7 @@ void LLViewerWindow::saveImageNumbered_filepicker_callback(LLPointerdeleteMe(); } void LLViewerWindow::saveImageNumbered_continued(LLPointer image, std::string const& extension) diff --git a/indra/newview/statemachine/aifilepicker.cpp b/indra/newview/statemachine/aifilepicker.cpp index cd6856100..35d875dfd 100644 --- a/indra/newview/statemachine/aifilepicker.cpp +++ b/indra/newview/statemachine/aifilepicker.cpp @@ -314,7 +314,11 @@ void AIFilePicker::abort_impl(void) void AIFilePicker::finish_impl(void) { - mPluginManager = NULL; // This deletes the plugin, since mPluginManager is a LLPointer. + if (mPluginManager) + { + mPluginManager->destroyPlugin(); + mPluginManager = NULL; + } mFilter.clear(); // Check that open is called before calling run (again). } diff --git a/indra/newview/statemachine/aifilepicker.h b/indra/newview/statemachine/aifilepicker.h index 008afb1d7..fd5bd0cc2 100644 --- a/indra/newview/statemachine/aifilepicker.h +++ b/indra/newview/statemachine/aifilepicker.h @@ -67,6 +67,56 @@ enum ESaveFilter FFSAVE_LSL }; +/* + + AIFilePicker is an AIStateMachine, that has a LLViewerPluginManager (mPluginManager) + to manage a plugin that runs the actual filepicker in a separate process. + + The relationship with the plugin is as follows: + +new AIFilePicker + + AIFilePicker::mPluginManager = new LLViewerPluginManager + + LLPluginProcessParentOwner LLPluginMessagePipeOwner + | | LLPluginMessagePipeOwner::mOwner = LLPluginProcessParentOwner + | | LLPluginMessagePipeOwner::mMessagePipe = LLPluginMessagePipe + | | LLPluginMessagePipeOwner::receiveMessageRaw calls + v | LLPluginProcessParent::receiveMessageRaw + LLPluginClassBasic v + | LLPluginClassBasic::mPlugin = new LLPluginProcessParent ---> new LLPluginMessagePipe + | LLPluginProcessParent::mOwner = (LLPluginProcessParentOwner*)LLPluginClassBasic + | LLPluginProcessParent::sendMessage calls + | LLPluginMessagePipeOwner::writeMessageRaw calls + | mMessagePipe->LLPluginMessagePipe::addMessage + | LLPluginProcessParent::receiveMessageRaw calls + | LLPluginProcessParent::receiveMessage calls + | LLPluginProcessParentOwner::receivePluginMessage == AIPluginFilePicker::receivePluginMessage + | + | LLPluginClassBasic::sendMessage calls mPlugin->LLPluginProcessParent::sendMessage + | + v + LLViewerPluginManager::mPluginBase = new AIPluginFilePicker + AIPluginFilePicker::receivePluginMessage calls + AIFilePicker::receivePluginMessage + + AIPluginFilePicker::mStateMachine = AIFilePicker + + Where the entry point to send messages to the plugin is LLPluginClassBasic::sendMessage, + and the end point for messages received from the plugin is AIFilePicker::receivePluginMessage. + + Termination happens by receiving the "canceled" or "done" message, + which sets the state to AIFilePicker_canceled or AIFilePicker_done + respectively, causing a call to AIStateMachine::finish(), which calls + AIFilePicker::finish_impl which destroys the plugin (mPluginBase) + and the plugin manager (mPluginManager). + + AIStateMachine::finish() also calls the registered callback function, + which should call AIStateMachine::deleteMe(), causing the AIFilePicker + to be deleted. + +*/ + // A file picker state machine. // // Before calling run(), call open() to pass needed parameters. @@ -151,7 +201,8 @@ public: static std::string launcher_name(void) { return gDirUtilp->getLLPluginLauncher(); } static char const* plugin_basename(void) { return "basic_plugin_filepicker"; } - /*virtual*/ void receivePluginMessage(LLPluginMessage const& message) { mStateMachine->receivePluginMessage(message); } + /*virtual*/ void receivePluginMessage(LLPluginMessage const& message) { mStateMachine->receivePluginMessage(message); } + /*virtual*/ void receivedShutdown(void) { /* Nothing -- we terminate on deletion (from AIStateMachine::mainloop) */ } private: AIFilePicker* mStateMachine; diff --git a/indra/plugins/base_basic/basic_plugin_base.cpp b/indra/plugins/base_basic/basic_plugin_base.cpp index 90b5964ef..d7d486502 100755 --- a/indra/plugins/base_basic/basic_plugin_base.cpp +++ b/indra/plugins/base_basic/basic_plugin_base.cpp @@ -46,10 +46,9 @@ /// /// @param[in] send_message_function Function for sending messages from plugin to plugin loader shell /// @param[in] plugin_instance Message data for messages from plugin to plugin loader shell -BasicPluginBase::BasicPluginBase(LLPluginInstance::sendMessageFunction send_message_function, LLPluginInstance* plugin_instance) +BasicPluginBase::BasicPluginBase(LLPluginInstance::sendMessageFunction send_message_function, LLPluginInstance* plugin_instance) : + mPluginInstance(plugin_instance), mSendMessageFunction(send_message_function), mDeleteMe(false) { - mSendMessageFunction = send_message_function; - mPluginInstance = plugin_instance; } /** @@ -79,6 +78,12 @@ void BasicPluginBase::staticReceiveMessage(char const* message_string, BasicPlug // This is the loaded DSO. // // Call this function to send 'message' to the viewer. +// Note: mSendMessageFunction points to LLPluginInstance::staticReceiveMessage, so indirectly this +// just calls LLPluginInstance::receiveMessage (mPluginInstance->receiveMessage) where +// mPluginInstance is the LLPluginInstance created in LLPluginProcessChild::idle during +// state STATE_PLUGIN_LOADING. That function then immediately calls mOwner->receivePluginMessage +// which is implemented as LLPluginProcessChild::receivePluginMessage, the same +// LLPluginProcessChild object that created the LLPluginInstance. /** * Send message to plugin loader shell. * @@ -91,6 +96,17 @@ void BasicPluginBase::sendMessage(const LLPluginMessage &message) mSendMessageFunction(output.c_str(), &mPluginInstance); } +/** + * Send shutdown message to the plugin loader shell. + * + * This will cause the SLPlugin process that loaded this DSO to be terminated. + */ +void BasicPluginBase::sendShutdownMessage(void) +{ + LLPluginMessage shutdownmessage(LLPLUGIN_MESSAGE_CLASS_INTERNAL, "shutdown"); + sendMessage(shutdownmessage); +} + #if LL_WINDOWS # define LLSYMEXPORT __declspec(dllexport) #elif LL_LINUX diff --git a/indra/plugins/base_basic/basic_plugin_base.h b/indra/plugins/base_basic/basic_plugin_base.h index bbabb18b7..f615fce87 100755 --- a/indra/plugins/base_basic/basic_plugin_base.h +++ b/indra/plugins/base_basic/basic_plugin_base.h @@ -57,6 +57,9 @@ public: // This function is actually called and then calls the member function above. static void staticReceiveMessage(char const* message_string, BasicPluginBase** self_ptr); + // Shoot down the whole process. + void sendShutdownMessage(void); + protected: void sendMessage(LLPluginMessage const& message); diff --git a/indra/plugins/base_media/media_plugin_base.cpp b/indra/plugins/base_media/media_plugin_base.cpp index 102d18996..20769f2f7 100755 --- a/indra/plugins/base_media/media_plugin_base.cpp +++ b/indra/plugins/base_media/media_plugin_base.cpp @@ -49,7 +49,6 @@ MediaPluginBase::MediaPluginBase(LLPluginInstance::sendMessageFunction send_message_function, LLPluginInstance* plugin_instance) : BasicPluginBase(send_message_function, plugin_instance) { - mDeleteMe = false; mPixels = 0; mWidth = 0; mHeight = 0; diff --git a/indra/plugins/example_basic/CMakeLists.txt b/indra/plugins/example_basic/CMakeLists.txt index fdc71a60c..98f5d1657 100644 --- a/indra/plugins/example_basic/CMakeLists.txt +++ b/indra/plugins/example_basic/CMakeLists.txt @@ -17,13 +17,13 @@ include_directories( ### basic_plugin_example -if(NOT CMAKE_SIZEOF_VOID_P MATCHES 4) +if(NOT WORD_SIZE EQUAL 32) if(WINDOWS) add_definitions(/FIXED:NO) else(WINDOWS) # not windows therefore gcc LINUX and DARWIN add_definitions(-fPIC) endif(WINDOWS) -endif (NOT CMAKE_SIZEOF_VOID_P MATCHES 4) +endif (NOT WORD_SIZE EQUAL 32) set(basic_plugin_example_SOURCE_FILES basic_plugin_example.cpp diff --git a/indra/plugins/example_media/CMakeLists.txt b/indra/plugins/example_media/CMakeLists.txt index 99859ae8a..0a8214eef 100644 --- a/indra/plugins/example_media/CMakeLists.txt +++ b/indra/plugins/example_media/CMakeLists.txt @@ -28,13 +28,13 @@ include_directories( ### media_plugin_example -if(NOT CMAKE_SIZEOF_VOID_P MATCHES 4) +if(NOT WORD_SIZE EQUAL 32) if(WINDOWS) add_definitions(/FIXED:NO) else(WINDOWS) # not windows therefore gcc LINUX and DARWIN add_definitions(-fPIC) endif(WINDOWS) -endif (NOT CMAKE_SIZEOF_VOID_P MATCHES 4) +endif (NOT WORD_SIZE EQUAL 32) set(media_plugin_example_SOURCE_FILES media_plugin_example.cpp diff --git a/indra/plugins/filepicker/CMakeLists.txt b/indra/plugins/filepicker/CMakeLists.txt index cea18360a..d3b233e01 100644 --- a/indra/plugins/filepicker/CMakeLists.txt +++ b/indra/plugins/filepicker/CMakeLists.txt @@ -19,13 +19,13 @@ include_directories( ### basic_plugin_filepicker -if(NOT CMAKE_SIZEOF_VOID_P MATCHES 4) +if(NOT WORD_SIZE EQUAL 32) if(WINDOWS) add_definitions(/FIXED:NO) else(WINDOWS) # not windows therefore gcc LINUX and DARWIN add_definitions(-fPIC) endif(WINDOWS) -endif (NOT CMAKE_SIZEOF_VOID_P MATCHES 4) + endif (NOT WORD_SIZE EQUAL 32) set(basic_plugin_filepicker_SOURCE_FILES basic_plugin_filepicker.cpp diff --git a/indra/plugins/filepicker/basic_plugin_filepicker.cpp b/indra/plugins/filepicker/basic_plugin_filepicker.cpp index bd415c64a..498dff3f1 100644 --- a/indra/plugins/filepicker/basic_plugin_filepicker.cpp +++ b/indra/plugins/filepicker/basic_plugin_filepicker.cpp @@ -150,6 +150,10 @@ void FilepickerPlugin::receiveMessage(char const* message_string) message.setValue("plugin_version", plugin_version); sendMessage(message); } + else if (message_name == "cleanup") + { + // We have no resources that need care. Just do nothing. + } else if (message_name == "idle") { // This whole message should not have existed imho -- Aleric @@ -213,6 +217,8 @@ void FilepickerPlugin::receiveMessage(char const* message_string) message.setValueLLSD("filenames", filenames); sendMessage(message); } + // We're done. Exit the whole application. + sendShutdownMessage(); } else { diff --git a/indra/plugins/filepicker/llfilepicker.cpp b/indra/plugins/filepicker/llfilepicker.cpp index f9a3ab8c1..1b54265ff 100644 --- a/indra/plugins/filepicker/llfilepicker.cpp +++ b/indra/plugins/filepicker/llfilepicker.cpp @@ -1048,7 +1048,7 @@ void LLFilePickerBase::chooser_responder(GtkWidget *widget, gint response, gpoin if (response == GTK_RESPONSE_ACCEPT) { GSList *file_list = gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(widget)); - g_slist_foreach(file_list, (GFunc)add_to_selectedfiles, user_data); + g_slist_foreach(file_list, (GFunc)add_to_selectedfiles, picker); g_slist_foreach(file_list, (GFunc)g_free, NULL); g_slist_free (file_list); } diff --git a/indra/plugins/gstreamer010/media_plugin_gstreamer010.cpp b/indra/plugins/gstreamer010/media_plugin_gstreamer010.cpp index 8d0dc31e2..38a6805fe 100755 --- a/indra/plugins/gstreamer010/media_plugin_gstreamer010.cpp +++ b/indra/plugins/gstreamer010/media_plugin_gstreamer010.cpp @@ -652,7 +652,7 @@ bool MediaPluginGStreamer010::getTimePos(double &sec_out) { bool got_position = false; - if (mPlaybin) + if (mDoneInit && mPlaybin) { gint64 pos; GstFormat timefmt = GST_FORMAT_TIME; diff --git a/indra/plugins/quicktime/media_plugin_quicktime.cpp b/indra/plugins/quicktime/media_plugin_quicktime.cpp index a03cadf19..1c15b7483 100755 --- a/indra/plugins/quicktime/media_plugin_quicktime.cpp +++ b/indra/plugins/quicktime/media_plugin_quicktime.cpp @@ -40,6 +40,10 @@ #if defined(LL_DARWIN) #include #elif defined(LL_WINDOWS) + #undef __STDC_CONSTANT_MACROS //Needed, as boost/unordered_map.hpp already defines INT32_C, etc. + #if defined(_MSC_VER) && _MSC_VER >= 1600 + #define _STDINT_H //Visual Studio 2010 includes its own stdint header already + #endif #include "MacTypes.h" #include "QTML.h" #include "Movies.h" diff --git a/indra/plugins/webkit/CMakeLists.txt b/indra/plugins/webkit/CMakeLists.txt index 1ffa2608a..49ea3e7f6 100644 --- a/indra/plugins/webkit/CMakeLists.txt +++ b/indra/plugins/webkit/CMakeLists.txt @@ -51,9 +51,9 @@ set(media_plugin_webkit_LINK_LIBRARIES # Select which VolumeCatcher implementation to use if (LINUX) - if (PULSEAUDIO) + if (PULSEAUDIO_FOUND) list(APPEND media_plugin_webkit_SOURCE_FILES linux_volume_catcher.cpp) - endif (PULSEAUDIO) + endif (PULSEAUDIO_FOUND) list(APPEND media_plugin_webkit_LINK_LIBRARIES ${UI_LIBRARIES} # for glib/GTK ) diff --git a/indra/plugins/webkit/linux_volume_catcher.cpp b/indra/plugins/webkit/linux_volume_catcher.cpp index cc3836ea5..ca1b1cfa2 100644 --- a/indra/plugins/webkit/linux_volume_catcher.cpp +++ b/indra/plugins/webkit/linux_volume_catcher.cpp @@ -42,9 +42,8 @@ 5) Keep a list of all living audio players that we care about, adjust the volumes of all of them when we get a new setVolume() call */ -# include //imprudence - #include "linden_common.h" +# include #include "volume_catcher.h" diff --git a/indra/plugins/webkit/media_plugin_webkit.cpp b/indra/plugins/webkit/media_plugin_webkit.cpp index 97920cf9f..8067e25bc 100755 --- a/indra/plugins/webkit/media_plugin_webkit.cpp +++ b/indra/plugins/webkit/media_plugin_webkit.cpp @@ -79,20 +79,6 @@ extern "C" { } #endif -#ifdef LL_STANDALONE -#include -#elif defined(LL_LINUX) -// We don't provide Qt headers for non-standalone, therefore define this here. -// Our prebuilt is built with QT_NAMESPACE undefined. -#define QT_MANGLE_NAMESPACE(name) name -#define Q_INIT_RESOURCE(name) \ - do { extern int QT_MANGLE_NAMESPACE(qInitResources_ ## name) (); \ - QT_MANGLE_NAMESPACE(qInitResources_ ## name) (); } while (0) -#else -// Apparently this symbol doesn't exist in the windows and Mac tar balls provided by LL. -#define Q_INIT_RESOURCE(name) /*nothing*/ -#endif - //////////////////////////////////////////////////////////////////////////////// // class MediaPluginWebKit : @@ -138,6 +124,7 @@ private: F32 mBackgroundR; F32 mBackgroundG; F32 mBackgroundB; + std::string mTarget; VolumeCatcher mVolumeCatcher; @@ -326,11 +313,7 @@ private: LLQtWebKit::getInstance()->enableJavascript( mJavascriptEnabled ); // create single browser window -#if LLQTWEBKIT_API_VERSION >= 2 - mBrowserWindowId = LLQtWebKit::getInstance()->createBrowserWindow(mWidth, mHeight /*, mTarget*/ ); // We don't have mTarget yet. -#else - mBrowserWindowId = LLQtWebKit::getInstance()->createBrowserWindow( mWidth, mHeight ); -#endif + mBrowserWindowId = LLQtWebKit::getInstance()->createBrowserWindow(mWidth, mHeight, mTarget); // tell LLQtWebKit about the size of the browser window LLQtWebKit::getInstance()->setSize( mBrowserWindowId, mWidth, mHeight ); @@ -537,16 +520,9 @@ private: void onClickLinkHref(const EventType& event) { LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "click_href"); -#if LLQTWEBKIT_API_VERSION >= 2 message.setValue("uri", event.getEventUri()); message.setValue("target", event.getStringValue()); message.setValue("uuid", event.getStringValue2()); -#else - // This will work as long as we don't need "uuid", which will be needed for MoaP. - message.setValue("uri", event.getStringValue()); - message.setValue("target", event.getStringValue2()); - message.setValueU32("target_type", event.getLinkType()); -#endif sendMessage(message); } @@ -555,11 +531,7 @@ private: void onClickLinkNoFollow(const EventType& event) { LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "click_nofollow"); -#if LLQTWEBKIT_API_VERSION >= 2 message.setValue("uri", event.getEventUri()); -#else - message.setValue("uri", event.getStringValue()); -#endif sendMessage(message); } @@ -744,9 +716,6 @@ MediaPluginWebKit::MediaPluginWebKit(LLPluginInstance::sendMessageFunction send_ mJavascriptEnabled = true; // default to on mPluginsEnabled = true; // default to on mUserAgent = "LLPluginMedia Web Browser"; - - // Initialize WebCore resource. - Q_INIT_RESOURCE(WebCore); } MediaPluginWebKit::~MediaPluginWebKit() @@ -773,6 +742,8 @@ void MediaPluginWebKit::receiveMessage(const char *message_string) { if(message_name == "init") { + mTarget = message_in.getValue("target"); + LLPluginMessage message("base", "init_response"); LLSD versions = LLSD::emptyMap(); versions[LLPLUGIN_MESSAGE_CLASS_BASE] = LLPLUGIN_MESSAGE_CLASS_BASE_VERSION; @@ -1082,7 +1053,7 @@ void MediaPluginWebKit::receiveMessage(const char *message_string) else { // std::cerr << "MediaPluginWebKit::receiveMessage: unknown media message: " << message_string << std::endl; - }; + } } else if(message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER) {