diff options
-rwxr-xr-x | autobuild.xml | 10 | ||||
-rw-r--r-- | indra/media_plugins/cef/media_plugin_cef.cpp | 48 |
2 files changed, 52 insertions, 6 deletions
diff --git a/autobuild.xml b/autobuild.xml index 541005db79..d7f1e92141 100755 --- a/autobuild.xml +++ b/autobuild.xml @@ -1536,11 +1536,11 @@ <key>archive</key> <map> <key>hash</key> - <string>57d4b1a1066573bff5f9ef7e11e4157e</string> + <string>5a4a0ed7fa23e19e9b7513a29668d226</string> <key>hash_algorithm</key> <string>md5</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/llceflib_3p-llceflib/rev/303693/arch/Darwin/installer/llceflib-1.0.1.303693-darwin-303693.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/llceflib_3p-llceflib/rev/303823/arch/Darwin/installer/llceflib-1.0.1.303823-darwin-303823.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -1550,18 +1550,18 @@ <key>archive</key> <map> <key>hash</key> - <string>09b802c5bb6230958e2e7c7a8523f8ac</string> + <string>1327780d088ce50447f82aecdc5bbb4d</string> <key>hash_algorithm</key> <string>md5</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/llceflib_3p-llceflib/rev/303693/arch/CYGWIN/installer/llceflib-1.0.1.303693-windows-303693.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/llceflib_3p-llceflib/rev/303823/arch/CYGWIN/installer/llceflib-1.0.1.303823-windows-303823.tar.bz2</string> </map> <key>name</key> <string>windows</string> </map> </map> <key>version</key> - <string>1.0.1.303693</string> + <string>1.0.1.303823</string> </map> <key>llphysicsextensions_source</key> <map> diff --git a/indra/media_plugins/cef/media_plugin_cef.cpp b/indra/media_plugins/cef/media_plugin_cef.cpp index 4bde7e7d49..56bb4e469b 100644 --- a/indra/media_plugins/cef/media_plugin_cef.cpp +++ b/indra/media_plugins/cef/media_plugin_cef.cpp @@ -52,6 +52,7 @@ public: /*virtual*/
void receiveMessage(const char* message_string);
+
private:
bool init();
@@ -63,9 +64,10 @@ private: void onLoadStartCallback();
void onLoadEndCallback(int httpStatusCode);
void onNavigateURLCallback(std::string url);
+ bool onHTTPAuthCallback(const std::string host, const std::string realm, std::string& username, std::string& password);
void postDebugMessage(const std::string& msg);
-
+ void authResponse(LLPluginMessage &message);
EKeyboardModifier decodeModifiers(std::string &modifiers);
void deserializeKeyboardData(LLSD native_key_data, uint32_t& native_scan_code, uint32_t& native_virtual_key, uint32_t& native_modifiers);
@@ -77,6 +79,9 @@ private: bool mCookiesEnabled;
bool mPluginsEnabled;
bool mJavascriptEnabled;
+ std::string mAuthUsername;
+ std::string mAuthPassword;
+ bool mAuthOK;
LLCEFLib* mLLCEFLib;
};
@@ -94,6 +99,9 @@ MediaPluginBase(host_send_func, host_user_data) mCookiesEnabled = true;
mPluginsEnabled = false;
mJavascriptEnabled = true;
+ mAuthUsername = "";
+ mAuthPassword = "";
+ mAuthOK = false;
mLLCEFLib = new LLCEFLib();
}
@@ -205,6 +213,39 @@ void MediaPluginCEF::onNavigateURLCallback(std::string url) ////////////////////////////////////////////////////////////////////////////////
//
+bool MediaPluginCEF::onHTTPAuthCallback(const std::string host, const std::string realm, std::string& username, std::string& password) +{
+ mAuthOK = false;
+
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "auth_request");
+ message.setValue("url", host);
+ message.setValue("realm", realm);
+ message.setValueBoolean("blocking_request", true);
+
+ // The "blocking_request" key in the message means this sendMessage call will block until a response is received.
+ sendMessage(message);
+
+ if (mAuthOK)
+ {
+ username = mAuthUsername;
+ password = mAuthPassword;
+ }
+
+ return mAuthOK;
+}
+
+void MediaPluginCEF::authResponse(LLPluginMessage &message)
+{
+ mAuthOK = message.getValueBoolean("ok");
+ if (mAuthOK)
+ {
+ mAuthUsername = message.getValue("username");
+ mAuthPassword = message.getValue("password");
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
void MediaPluginCEF::receiveMessage(const char* message_string)
{
// std::cerr << "MediaPluginWebKit::receiveMessage: received message: \"" << message_string << "\"" << std::endl;
@@ -287,6 +328,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string) mLLCEFLib->setOnLoadStartCallback(boost::bind(&MediaPluginCEF::onLoadStartCallback, this));
mLLCEFLib->setOnLoadEndCallback(boost::bind(&MediaPluginCEF::onLoadEndCallback, this, _1));
mLLCEFLib->setOnNavigateURLCallback(boost::bind(&MediaPluginCEF::onNavigateURLCallback, this, _1));
+ mLLCEFLib->setOnHTTPAuthCallback(boost::bind(&MediaPluginCEF::onHTTPAuthCallback, this, _1, _2, _3, _4)); LLCEFLibSettings settings;
settings.inital_width = 1024;
@@ -451,6 +493,10 @@ void MediaPluginCEF::receiveMessage(const char* message_string) {
mEnableMediaPluginDebugging = message_in.getValueBoolean("enable");
}
+ if (message_name == "auth_response")
+ {
+ authResponse(message_in);
+ }
}
else if (message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER)
{
|