Skip to content
Snippets Groups Projects
Commit 5eec36b4 authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Speed up web plugin a bit

parent 7f87fcce
No related branches found
No related tags found
No related merge requests found
...@@ -137,7 +137,9 @@ void LLPluginInstance::sendMessage(const std::string &message) ...@@ -137,7 +137,9 @@ void LLPluginInstance::sendMessage(const std::string &message)
{ {
if(mPluginSendMessageFunction) if(mPluginSendMessageFunction)
{ {
#ifdef SHOW_DEBUG
LL_DEBUGS("Plugin") << "sending message to plugin: \"" << message << "\"" << LL_ENDL; LL_DEBUGS("Plugin") << "sending message to plugin: \"" << message << "\"" << LL_ENDL;
#endif
mPluginSendMessageFunction(message.c_str(), &mPluginUserData); mPluginSendMessageFunction(message.c_str(), &mPluginUserData);
} }
else else
...@@ -172,7 +174,9 @@ void LLPluginInstance::receiveMessage(const char *message_string) ...@@ -172,7 +174,9 @@ void LLPluginInstance::receiveMessage(const char *message_string)
{ {
if(mOwner) if(mOwner)
{ {
LL_DEBUGS("Plugin") << "processing incoming message: \"" << message_string << "\"" << LL_ENDL; #if SHOW_DEBUG
LL_DEBUGS("Plugin") << "processing incoming message: \"" << message_string << "\"" << LL_ENDL;
#endif
mOwner->receivePluginMessage(message_string); mOwner->receivePluginMessage(message_string);
} }
else else
......
...@@ -320,7 +320,9 @@ void LLPluginProcessChild::sendMessageToPlugin(const LLPluginMessage &message) ...@@ -320,7 +320,9 @@ void LLPluginProcessChild::sendMessageToPlugin(const LLPluginMessage &message)
{ {
std::string buffer = message.generate(); std::string buffer = message.generate();
#ifdef SHOW_DEBUG
LL_DEBUGS("Plugin") << "Sending to plugin: " << buffer << LL_ENDL; LL_DEBUGS("Plugin") << "Sending to plugin: " << buffer << LL_ENDL;
#endif
LLTimer elapsed; LLTimer elapsed;
mInstance->sendMessage(buffer); mInstance->sendMessage(buffer);
...@@ -337,7 +339,9 @@ void LLPluginProcessChild::sendMessageToParent(const LLPluginMessage &message) ...@@ -337,7 +339,9 @@ void LLPluginProcessChild::sendMessageToParent(const LLPluginMessage &message)
{ {
std::string buffer = message.generate(); std::string buffer = message.generate();
#if SHOW_DEBUG
LL_DEBUGS("Plugin") << "Sending to parent: " << buffer << LL_ENDL; LL_DEBUGS("Plugin") << "Sending to parent: " << buffer << LL_ENDL;
#endif
writeMessageRaw(buffer); writeMessageRaw(buffer);
} }
...@@ -345,8 +349,9 @@ void LLPluginProcessChild::sendMessageToParent(const LLPluginMessage &message) ...@@ -345,8 +349,9 @@ void LLPluginProcessChild::sendMessageToParent(const LLPluginMessage &message)
void LLPluginProcessChild::receiveMessageRaw(const std::string &message) void LLPluginProcessChild::receiveMessageRaw(const std::string &message)
{ {
// Incoming message from the TCP Socket // Incoming message from the TCP Socket
#if SHOW_DEBUG
LL_DEBUGS("Plugin") << "Received from parent: " << message << LL_ENDL; LL_DEBUGS("Plugin") << "Received from parent: " << message << LL_ENDL;
#endif
// Decode this message // Decode this message
LLPluginMessage parsed; LLPluginMessage parsed;
...@@ -485,7 +490,9 @@ void LLPluginProcessChild::receiveMessageRaw(const std::string &message) ...@@ -485,7 +490,9 @@ void LLPluginProcessChild::receiveMessageRaw(const std::string &message)
/* virtual */ /* virtual */
void LLPluginProcessChild::receivePluginMessage(const std::string &message) void LLPluginProcessChild::receivePluginMessage(const std::string &message)
{ {
#if SHOW_DEBUG
LL_DEBUGS("Plugin") << "Received from plugin: " << message << LL_ENDL; LL_DEBUGS("Plugin") << "Received from plugin: " << message << LL_ENDL;
#endif
if (mBlockingRequest) if (mBlockingRequest)
{ {
...@@ -568,7 +575,9 @@ void LLPluginProcessChild::receivePluginMessage(const std::string &message) ...@@ -568,7 +575,9 @@ void LLPluginProcessChild::receivePluginMessage(const std::string &message)
if (passMessage) if (passMessage)
{ {
#if SHOW_DEBUG
LL_DEBUGS("Plugin") << "Passing through to parent: " << message << LL_ENDL; LL_DEBUGS("Plugin") << "Passing through to parent: " << message << LL_ENDL;
#endif
writeMessageRaw(message); writeMessageRaw(message);
} }
...@@ -589,7 +598,9 @@ void LLPluginProcessChild::receivePluginMessage(const std::string &message) ...@@ -589,7 +598,9 @@ void LLPluginProcessChild::receivePluginMessage(const std::string &message)
void LLPluginProcessChild::setState(EState state) void LLPluginProcessChild::setState(EState state)
{ {
#if SHOW_DEBUG
LL_DEBUGS("Plugin") << "setting state to " << state << LL_ENDL; LL_DEBUGS("Plugin") << "setting state to " << state << LL_ENDL;
#endif
mState = state; mState = state;
}; };
......
...@@ -120,7 +120,9 @@ LLPluginProcessParent::LLPluginProcessParent(LLPluginProcessParentOwner *owner): ...@@ -120,7 +120,9 @@ LLPluginProcessParent::LLPluginProcessParent(LLPluginProcessParentOwner *owner):
LLPluginProcessParent::~LLPluginProcessParent() LLPluginProcessParent::~LLPluginProcessParent()
{ {
#ifdef SHOW_DEBUG
LL_DEBUGS("Plugin") << "destructor" << LL_ENDL; LL_DEBUGS("Plugin") << "destructor" << LL_ENDL;
#endif
if (pProcessCreationThread) if (pProcessCreationThread)
{ {
if (!pProcessCreationThread->isStopped()) if (!pProcessCreationThread->isStopped())
...@@ -1295,7 +1297,9 @@ std::string LLPluginProcessParent::getPluginVersion(void) ...@@ -1295,7 +1297,9 @@ std::string LLPluginProcessParent::getPluginVersion(void)
void LLPluginProcessParent::setState(EState state) void LLPluginProcessParent::setState(EState state)
{ {
#ifdef SHOW_DEBUG
LL_DEBUGS("Plugin") << "setting state to " << state << LL_ENDL; LL_DEBUGS("Plugin") << "setting state to " << state << LL_ENDL;
#endif
mState = state; mState = state;
}; };
......
...@@ -862,17 +862,23 @@ void MediaPluginCEF::receiveMessage(const char* message_string) ...@@ -862,17 +862,23 @@ void MediaPluginCEF::receiveMessage(const char* message_string)
mCEFLib->mouseButton(btn, dullahan::ME_MOUSE_DOWN, x, y); mCEFLib->mouseButton(btn, dullahan::ME_MOUSE_DOWN, x, y);
mCEFLib->setFocus(); mCEFLib->setFocus();
std::stringstream str; if(mEnableMediaPluginDebugging)
str << "Mouse down at = " << x << ", " << y; {
postDebugMessage(str.str()); std::stringstream str;
str << "Mouse down at = " << x << ", " << y;
postDebugMessage(str.str());
}
} }
else if (event == "up" && button == 0) else if (event == "up" && button == 0)
{ {
mCEFLib->mouseButton(btn, dullahan::ME_MOUSE_UP, x, y); mCEFLib->mouseButton(btn, dullahan::ME_MOUSE_UP, x, y);
std::stringstream str; if (mEnableMediaPluginDebugging)
str << "Mouse up at = " << x << ", " << y; {
postDebugMessage(str.str()); std::stringstream str;
str << "Mouse up at = " << x << ", " << y;
postDebugMessage(str.str());
}
} }
else if (event == "double_click") else if (event == "double_click")
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment