diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llviewermedia.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/linden/indra/newview/llviewermedia.cpp b/linden/indra/newview/llviewermedia.cpp index f0faedf..c228468 100644 --- a/linden/indra/newview/llviewermedia.cpp +++ b/linden/indra/newview/llviewermedia.cpp | |||
@@ -267,6 +267,23 @@ std::string LLViewerMedia::getCurrentUserAgent() | |||
267 | 267 | ||
268 | return codec.str(); | 268 | return codec.str(); |
269 | } | 269 | } |
270 | |||
271 | ///////////////////////////////////////////////////////////////////////////////////////// | ||
272 | // static | ||
273 | void LLViewerMedia::setProxyConfig(bool enable, const std::string &host, int port) | ||
274 | { | ||
275 | // Set the proxy config for all loaded plugins | ||
276 | impl_list::iterator iter = sViewerMediaImplList.begin(); | ||
277 | impl_list::iterator end = sViewerMediaImplList.end(); | ||
278 | for (; iter != end; iter++) | ||
279 | { | ||
280 | LLViewerMediaImpl* pimpl = *iter; | ||
281 | if(pimpl->mMediaSource) | ||
282 | { | ||
283 | pimpl->mMediaSource->proxy_setup(enable, host, port); | ||
284 | } | ||
285 | } | ||
286 | } | ||
270 | 287 | ||
271 | ////////////////////////////////////////////////////////////////////////////////////////// | 288 | ////////////////////////////////////////////////////////////////////////////////////////// |
272 | // static | 289 | // static |
@@ -395,6 +412,19 @@ LLViewerMediaImpl::~LLViewerMediaImpl() | |||
395 | LLViewerMedia::removeMedia(this); | 412 | LLViewerMedia::removeMedia(this); |
396 | } | 413 | } |
397 | 414 | ||
415 | //static | ||
416 | void LLViewerMediaImpl::setProxy(LLPluginClassMedia* media_source) | ||
417 | { | ||
418 | // pass proxy settings to browser | ||
419 | bool proxy_enabled = gSavedSettings.getBOOL( "BrowserProxyEnabled" ); | ||
420 | std::string proxy_address = gSavedSettings.getString("BrowserProxyAddress"); | ||
421 | S32 proxy_port = gSavedSettings.getS32("BrowserProxyPort"); | ||
422 | media_source->proxy_setup(proxy_enabled, proxy_address, proxy_port); | ||
423 | LL_DEBUGS("Media") << "Proxy: " << (proxy_enabled ? "enabled" : "not enabled") | ||
424 | << " Address: " << proxy_address | ||
425 | << " Port: " << proxy_port << LL_ENDL; | ||
426 | } | ||
427 | |||
398 | ////////////////////////////////////////////////////////////////////////////////////////// | 428 | ////////////////////////////////////////////////////////////////////////////////////////// |
399 | bool LLViewerMediaImpl::initializeMedia(const std::string& mime_type) | 429 | bool LLViewerMediaImpl::initializeMedia(const std::string& mime_type) |
400 | { | 430 | { |
@@ -411,6 +441,11 @@ bool LLViewerMediaImpl::initializeMedia(const std::string& mime_type) | |||
411 | } | 441 | } |
412 | } | 442 | } |
413 | 443 | ||
444 | if(mMediaSource) | ||
445 | { | ||
446 | setProxy(mMediaSource); | ||
447 | } | ||
448 | |||
414 | // play(); | 449 | // play(); |
415 | return (mMediaSource != NULL); | 450 | return (mMediaSource != NULL); |
416 | } | 451 | } |
@@ -508,6 +543,8 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_ | |||
508 | bool javascript_enabled = gSavedSettings.getBOOL( "BrowserJavascriptEnabled" ); | 543 | bool javascript_enabled = gSavedSettings.getBOOL( "BrowserJavascriptEnabled" ); |
509 | media_source->setJavascriptEnabled( javascript_enabled ); | 544 | media_source->setJavascriptEnabled( javascript_enabled ); |
510 | 545 | ||
546 | setProxy(media_source); | ||
547 | |||
511 | if (media_source->init(launcher_name, plugin_name, gSavedSettings.getBOOL("PluginAttachDebuggerToPlugins"))) | 548 | if (media_source->init(launcher_name, plugin_name, gSavedSettings.getBOOL("PluginAttachDebuggerToPlugins"))) |
512 | { | 549 | { |
513 | return media_source; | 550 | return media_source; |
@@ -741,6 +778,7 @@ void LLViewerMediaImpl::navigateHome() | |||
741 | ////////////////////////////////////////////////////////////////////////////////////////// | 778 | ////////////////////////////////////////////////////////////////////////////////////////// |
742 | void LLViewerMediaImpl::navigateTo(const std::string& url, const std::string& mime_type, bool rediscover_type) | 779 | void LLViewerMediaImpl::navigateTo(const std::string& url, const std::string& mime_type, bool rediscover_type) |
743 | { | 780 | { |
781 | |||
744 | if(rediscover_type) | 782 | if(rediscover_type) |
745 | { | 783 | { |
746 | 784 | ||