From ab9e83030671f0d309eada847af7055213dfe501 Mon Sep 17 00:00:00 2001
From: callum_linden <none@none>
Date: Tue, 24 Mar 2015 00:42:42 +0100
Subject: Refer to new QuickTime third party package with fixes for VS2013 &
 re-add QuickTime media plugin

---
 indra/newview/CMakeLists.txt | 30 +++++++++++++-----------------
 1 file changed, 13 insertions(+), 17 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 8c5bc9777c..82de50ee64 100755
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -44,7 +44,6 @@ include(OPENAL)
 include(OpenGL)
 include(OpenSSL)
 include(PNG)
-include(Prebuilt)
 include(TemplateCheck)
 include(UI)
 include(UnixInstall)
@@ -62,9 +61,6 @@ if(FMODEX)
   include_directories(${FMODEX_INCLUDE_DIR})
 endif(FMODEX)
 
-# install SLPlugin host executable and its dynamic-library plugins
-use_prebuilt_binary(slplugins)
-
 include_directories(
     ${DBUSGLIB_INCLUDE_DIRS}
     ${JSONCPP_INCLUDE_DIR}
@@ -1824,10 +1820,10 @@ if (WINDOWS)
       add_dependencies(${VIEWER_BINARY_NAME} copy_win_scripts)
     endif (EXISTS ${CMAKE_SOURCE_DIR}/copy_win_scripts)
 
-##  add_dependencies(${VIEWER_BINARY_NAME}
-##    SLPlugin
-##    windows-crash-logger
-##    )
+    add_dependencies(${VIEWER_BINARY_NAME}
+      SLPlugin
+   windows-crash-logger
+    )
 
     # sets the 'working directory' for debugging from visual studio.
     if (NOT UNATTENDED)
@@ -1994,9 +1990,9 @@ if (LINUX)
   set(COPY_INPUT_DEPENDENCIES
     ${VIEWER_BINARY_NAME}
     linux-crash-logger
-##  SLPlugin
-##  media_plugin_webkit
-##  media_plugin_gstreamer010
+    SLPlugin
+    media_plugin_webkit
+    media_plugin_gstreamer010
     llcommon
     )
 
@@ -2108,7 +2104,7 @@ if (DARWIN)
       ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
     )
 
-##add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_webkit mac-crash-logger)
+  add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_webkit mac-crash-logger)
   add_dependencies(${VIEWER_BINARY_NAME} mac-crash-logger)
 
   if (ENABLE_SIGNING)
@@ -2163,20 +2159,20 @@ if (PACKAGE)
   if (DARWIN)
     list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}")
     # *TODO: Generate these search dirs in the cmake files related to each binary.
-##  list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/llplugin/slplugin/${CMAKE_CFG_INTDIR}")
+    list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/llplugin/slplugin/${CMAKE_CFG_INTDIR}")
     list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/mac_crash_logger/${CMAKE_CFG_INTDIR}")
-##  list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/gstreamer010/${CMAKE_CFG_INTDIR}")
-##  list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/quicktime/${CMAKE_CFG_INTDIR}")
+    list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/gstreamer010/${CMAKE_CFG_INTDIR}")
+    list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/quicktime/${CMAKE_CFG_INTDIR}")
 ##  list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/webkit/${CMAKE_CFG_INTDIR}")
     set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-symbols-darwin.tar.bz2")
-##  set(VIEWER_EXE_GLOBS "'Second Life' SLPlugin mac-crash-logger")
+    set(VIEWER_EXE_GLOBS "'Second Life' SLPlugin mac-crash-logger")
     set(VIEWER_EXE_GLOBS "'Second Life' mac-crash-logger")
     set(VIEWER_LIB_GLOB "*.dylib")
   endif (DARWIN)
   if (LINUX)
     list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_CURRENT_BINARY_DIR}/packaged")
     set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-symbols-linux.tar.bz2")
-##  set(VIEWER_EXE_GLOBS "do-not-directly-run-secondlife-bin SLPlugin")
+    set(VIEWER_EXE_GLOBS "do-not-directly-run-secondlife-bin SLPlugin")
     set(VIEWER_EXE_GLOBS "do-not-directly-run-secondlife-bin")
     set(VIEWER_LIB_GLOB "*${CMAKE_SHARED_MODULE_SUFFIX}*")
     set(VIEWER_COPY_MANIFEST copy_l_viewer_manifest)
-- 
cgit v1.2.3


From f8989216a4dff518655a9af540f0404449e37a20 Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Tue, 24 Mar 2015 16:41:47 -0400
Subject: Attempt to restore copying newly-built SLPlugin et al. - UNTESTED

---
 indra/newview/viewer_manifest.py | 117 +++++++++++++++++++++++++--------------
 1 file changed, 74 insertions(+), 43 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index 32cf9d3df6..e7affd4f63 100755
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -340,9 +340,9 @@ class Windows_i686_Manifest(ViewerManifest):
             self.path(src='%s/secondlife-bin.exe' % self.args['configuration'], dst=self.final_exe())
 
         # Plugin host application
-        # The current slplugin package places slplugin.exe right into the
-        # packages base directory.
-        self.path2basename(pkgdir, "slplugin.exe")
+        self.path2basename(os.path.join(os.pardir,
+                                        'llplugin', 'slplugin', self.args['configuration']),
+                           "slplugin.exe")
         
         self.path2basename("../viewer_components/updater/scripts/windows", "update_install.bat")
         # Get shared libs from the shared libs staging directory
@@ -424,16 +424,63 @@ class Windows_i686_Manifest(ViewerManifest):
         self.path("featuretable_xp.txt")
 
         # Media plugins - QuickTime
-        # Media plugins - WebKit/Qt
-        if self.prefix(src=os.path.join(pkgdir, "llplugin"), dst="llplugin"):
+        if self.prefix(src='../media_plugins/quicktime/%s' % self.args['configuration'], dst="llplugin"):
             self.path("media_plugin_quicktime.dll")
+            self.end_prefix()
+
+        # Media plugins - WebKit/Qt
+        if self.prefix(src='../media_plugins/webkit/%s' % self.args['configuration'], dst="llplugin"):
             self.path("media_plugin_webkit.dll")
-            self.path("qtcore4.dll")
-            self.path("qtgui4.dll")
-            self.path("qtnetwork4.dll")
-            self.path("qtopengl4.dll")
-            self.path("qtwebkit4.dll")
-            self.path("qtxmlpatterns4.dll")
+            self.end_prefix()
+
+        # winmm.dll shim
+        if self.prefix(src='../media_plugins/winmmshim/%s' % self.args['configuration'], dst=""):
+            self.path("winmm.dll")
+            self.end_prefix()
+
+
+        if self.args['configuration'].lower() == 'debug':
+            if self.prefix(src=os.path.join(os.pardir, 'packages', 'lib', 'debug'),
+                           dst="llplugin"):
+                self.path("libeay32.dll")
+                self.path("qtcored4.dll")
+                self.path("qtguid4.dll")
+                self.path("qtnetworkd4.dll")
+                self.path("qtopengld4.dll")
+                self.path("qtwebkitd4.dll")
+                self.path("qtxmlpatternsd4.dll")
+                self.path("ssleay32.dll")
+
+                # For WebKit/Qt plugin runtimes (image format plugins)
+                if self.prefix(src="imageformats", dst="imageformats"):
+                    self.path("qgifd4.dll")
+                    self.path("qicod4.dll")
+                    self.path("qjpegd4.dll")
+                    self.path("qmngd4.dll")
+                    self.path("qsvgd4.dll")
+                    self.path("qtiffd4.dll")
+                    self.end_prefix()
+
+                # For WebKit/Qt plugin runtimes (codec/character encoding plugins)
+                if self.prefix(src="codecs", dst="codecs"):
+                    self.path("qcncodecsd4.dll")
+                    self.path("qjpcodecsd4.dll")
+                    self.path("qkrcodecsd4.dll")
+                    self.path("qtwcodecsd4.dll")
+                    self.end_prefix()
+
+                self.end_prefix()
+        else:
+            if self.prefix(src=os.path.join(os.pardir, 'packages', 'lib', 'release'),
+                           dst="llplugin"):
+                self.path("libeay32.dll")
+                self.path("qtcore4.dll")
+                self.path("qtgui4.dll")
+                self.path("qtnetwork4.dll")
+                self.path("qtopengl4.dll")
+                self.path("qtwebkit4.dll")
+                self.path("qtxmlpatterns4.dll")
+                self.path("ssleay32.dll")
 
             # For WebKit/Qt plugin runtimes (image format plugins)
             if self.prefix(src="imageformats", dst="imageformats"):
@@ -455,23 +502,6 @@ class Windows_i686_Manifest(ViewerManifest):
 
         self.end_prefix()
 
-        # winmm.dll shim
-        if self.prefix(src='../media_plugins/winmmshim/%s' % self.args['configuration'], dst=""):
-            self.path("winmm.dll")
-            self.end_prefix()
-
-        if self.args['configuration'].lower() == 'debug':
-            if self.prefix(src=debpkgdir, dst="llplugin"):
-                self.path("libeay32.dll")
-                self.path("ssleay32.dll")
-                self.end_prefix()
-
-        else:
-            if self.prefix(src=relpkgdir, dst="llplugin"):
-                self.path("libeay32.dll")
-                self.path("ssleay32.dll")
-                self.end_prefix()
-
         # pull in the crash logger and updater from other projects
         # tag:"crash-logger" here as a cue to the exporter
         self.path(src='../win_crash_logger/%s/windows-crash-logger.exe' % self.args['configuration'],
@@ -735,14 +765,13 @@ class Darwin_i386_Manifest(ViewerManifest):
                         dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile)
                 
                 # our apps
-                for app_bld_dir, app in ((os.path.join(os.pardir,
-                                                       "mac_crash_logger",
-                                                       self.args['configuration']),
-                                          "mac-crash-logger.app"),
+                for app_bld_dir, app in (("mac_crash_logger", "mac-crash-logger.app"),
                                          # plugin launcher
-                                         (pkgdir, "SLPlugin.app"),
+                                         (os.path.join("llplugin", "slplugin"), "SLPlugin.app"),
                                          ):
-                    self.path2basename(app_bld_dir, app)
+                    self.path2basename(os.path.join(os.pardir,
+                                                    app_bld_dir, self.args['configuration']),
+                                       app)
 
                     # our apps dependencies on shared libs
                     # for each app, for each dylib we collected in dylibs,
@@ -776,19 +805,21 @@ class Darwin_i386_Manifest(ViewerManifest):
 
                 # Qt4 codecs go to llplugin.  Not certain why but this is the first
                 # location probed according to dtruss so we'll go with that.
-                if self.prefix(src=os.path.join(pkgdir, "llplugin/codecs/"), dst="llplugin/codecs"):
+                if self.prefix(src="../packages/plugins/codecs/", dst="llplugin/codecs"):
                     self.path("libq*.dylib")
                     self.end_prefix("llplugin/codecs")
 
                 # Similarly for imageformats.
-                if self.prefix(src=os.path.join(pkgdir, "llplugin/imageformats/"), dst="llplugin/imageformats"):
+                if self.prefix(src="../packages/plugins/imageformats/", dst="llplugin/imageformats"):
                     self.path("libq*.dylib")
                     self.end_prefix("llplugin/imageformats")
 
                 # SLPlugin plugins proper
-                if self.prefix(src=os.path.join(pkgdir, "llplugin"), dst="llplugin"):
-                    self.path("media_plugin_quicktime.dylib")
-                    self.path("media_plugin_webkit.dylib")
+                if self.prefix(src="", dst="llplugin"):
+                    self.path2basename("../media_plugins/quicktime/" + self.args['configuration'],
+                                       "media_plugin_quicktime.dylib")
+                    self.path2basename("../media_plugins/webkit/" + self.args['configuration'],
+                                       "media_plugin_webkit.dylib")
                     self.end_prefix("llplugin")
 
                 self.end_prefix("Resources")
@@ -981,7 +1012,7 @@ class LinuxManifest(ViewerManifest):
         if self.prefix(src="", dst="bin"):
             self.path("secondlife-bin","do-not-directly-run-secondlife-bin")
             self.path("../linux_crash_logger/linux-crash-logger","linux-crash-logger.bin")
-            self.path2basename(pkgdir, "SLPlugin")
+            self.path2basename("../llplugin/slplugin", "SLPlugin")
             self.path2basename("../viewer_components/updater/scripts/linux", "update_install")
             self.end_prefix("bin")
 
@@ -1001,9 +1032,9 @@ class LinuxManifest(ViewerManifest):
             self.end_prefix(icon_path)
 
         # plugins
-        if self.prefix(src=os.path.join(pkgdir, "llplugin"), dst="bin/llplugin"):
-            self.path("libmedia_plugin_webkit.so")
-            self.path("libmedia_plugin_gstreamer.so")
+        if self.prefix(src="", dst="bin/llplugin"):
+            self.path2basename("../media_plugins/webkit", "libmedia_plugin_webkit.so")
+            self.path("../media_plugins/gstreamer010/libmedia_plugin_gstreamer010.so", "libmedia_plugin_gstreamer.so")
             self.end_prefix("bin/llplugin")
 
         # llcommon
-- 
cgit v1.2.3


From dbdef626d650de288697848977155e223cbba9ad Mon Sep 17 00:00:00 2001
From: callum_linden <none@none>
Date: Tue, 24 Mar 2015 17:22:58 -0700
Subject: Add new media plugin (currently renders squares as example) in
 preparation for new CEF code

---
 indra/newview/CMakeLists.txt                      |  4 +--
 indra/newview/llviewermedia.cpp                   |  2 +-
 indra/newview/skins/default/xui/en/mime_types.xml | 40 +++++++++++------------
 indra/newview/viewer_manifest.py                  |  6 ++--
 4 files changed, 26 insertions(+), 26 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 82de50ee64..b03f1717aa 100755
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -1775,7 +1775,7 @@ if (WINDOWS)
       ${ARCH_PREBUILT_DIRS_RELEASE}/codecs/qtwcodecsd4.dll
       SLPlugin
       media_plugin_quicktime
-      media_plugin_webkit
+      media_plugin_cef
       winmm_shim
       windows-crash-logger
       )
@@ -2104,7 +2104,7 @@ if (DARWIN)
       ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
     )
 
-  add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_webkit mac-crash-logger)
+  add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_cef mac-crash-logger)
   add_dependencies(${VIEWER_BINARY_NAME} mac-crash-logger)
 
   if (ENABLE_SIGNING)
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index c758bbcc9e..fd24bbf891 100755
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -1803,7 +1803,7 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_
 	// HACK: we always try to keep a spare running webkit plugin around to improve launch times.
 	// If a spare was already created before PluginAttachDebuggerToPlugins was set, don't use it.
     // Do not use a spare if launching with full viewer control (e.g. Facebook, Twitter and few others)
-	if ((plugin_basename == "media_plugin_webkit") &&
+	if ((plugin_basename == "media_plugin_cef") &&
         !gSavedSettings.getBOOL("PluginAttachDebuggerToPlugins") && !clean_browser)
 	{
 		media_source = LLViewerMedia::getSpareBrowserMediaSource();
diff --git a/indra/newview/skins/default/xui/en/mime_types.xml b/indra/newview/skins/default/xui/en/mime_types.xml
index f5f2223330..7cb4a6e53b 100755
--- a/indra/newview/skins/default/xui/en/mime_types.xml
+++ b/indra/newview/skins/default/xui/en/mime_types.xml
@@ -7,7 +7,7 @@
 		none
 	</defaultwidget>
 	<defaultimpl>
-		media_plugin_webkit
+		media_plugin_cef
 	</defaultimpl>
 	<widgetset name="web">
 		<label name="web_label">
@@ -141,7 +141,7 @@
 			none
 		</widgettype>
 		<impl>
-			media_plugin_webkit
+			media_plugin_cef
 		</impl>
 	</mimetype>
 	<mimetype name="none/none">
@@ -152,7 +152,7 @@
 			none
 		</widgettype>
 		<impl>
-			media_plugin_webkit
+			media_plugin_cef
 		</impl>
 	</mimetype>
 	<mimetype name="audio/*">
@@ -185,7 +185,7 @@
 			image
 		</widgettype>
 		<impl>
-			media_plugin_webkit
+			media_plugin_cef
 		</impl>
 	</mimetype>
 	<mimetype menu="1" name="video/vnd.secondlife.qt.legacy">
@@ -207,7 +207,7 @@
 			web
 		</widgettype>
 		<impl>
-			media_plugin_webkit
+			media_plugin_cef
 		</impl>
 	</mimetype>
 	<mimetype name="application/ogg">
@@ -229,7 +229,7 @@
 			image
 		</widgettype>
 		<impl>
-			media_plugin_webkit
+			media_plugin_cef
 		</impl>
 	</mimetype>
 	<mimetype name="application/postscript">
@@ -240,7 +240,7 @@
 			image
 		</widgettype>
 		<impl>
-			media_plugin_webkit
+			media_plugin_cef
 		</impl>
 	</mimetype>
 	<mimetype name="application/rtf">
@@ -251,7 +251,7 @@
 			image
 		</widgettype>
 		<impl>
-			media_plugin_webkit
+			media_plugin_cef
 		</impl>
 	</mimetype>
 	<mimetype name="application/smil">
@@ -262,7 +262,7 @@
 			movie
 		</widgettype>
 		<impl>
-			media_plugin_webkit
+			media_plugin_cef
 		</impl>
 	</mimetype>
 	<mimetype name="application/xhtml+xml">
@@ -273,7 +273,7 @@
 			web
 		</widgettype>
 		<impl>
-			media_plugin_webkit
+			media_plugin_cef
 		</impl>
 	</mimetype>
 	<mimetype name="application/x-director">
@@ -284,7 +284,7 @@
 			image
 		</widgettype>
 		<impl>
-			media_plugin_webkit
+			media_plugin_cef
 		</impl>
 	</mimetype>
 	<mimetype name="audio/mid">
@@ -339,7 +339,7 @@
 			image
 		</widgettype>
 		<impl>
-			media_plugin_webkit
+			media_plugin_cef
 		</impl>
 	</mimetype>
 	<mimetype menu="1" name="image/gif">
@@ -350,7 +350,7 @@
 			image
 		</widgettype>
 		<impl>
-			media_plugin_webkit
+			media_plugin_cef
 		</impl>
 	</mimetype>
 	<mimetype menu="1" name="image/jpeg">
@@ -361,7 +361,7 @@
 			image
 		</widgettype>
 		<impl>
-			media_plugin_webkit
+			media_plugin_cef
 		</impl>
 	</mimetype>
 	<mimetype menu="1" name="image/png">
@@ -372,7 +372,7 @@
 			image
 		</widgettype>
 		<impl>
-			media_plugin_webkit
+			media_plugin_cef
 		</impl>
 	</mimetype>
 	<mimetype name="image/svg+xml">
@@ -383,7 +383,7 @@
 			image
 		</widgettype>
 		<impl>
-			media_plugin_webkit
+			media_plugin_cef
 		</impl>
 	</mimetype>
 	<mimetype menu="1" name="image/tiff">
@@ -394,7 +394,7 @@
 			image
 		</widgettype>
 		<impl>
-			media_plugin_webkit
+			media_plugin_cef
 		</impl>
 	</mimetype>
 	<mimetype menu="1" name="text/html">
@@ -405,7 +405,7 @@
 			web
 		</widgettype>
 		<impl>
-			media_plugin_webkit
+			media_plugin_cef
 		</impl>
 	</mimetype>
 	<mimetype menu="1" name="text/plain">
@@ -416,7 +416,7 @@
 			text
 		</widgettype>
 		<impl>
-			media_plugin_webkit
+			media_plugin_cef
 		</impl>
 	</mimetype>
 	<mimetype name="text/xml">
@@ -427,7 +427,7 @@
 			text
 		</widgettype>
 		<impl>
-			media_plugin_webkit
+			media_plugin_cef
 		</impl>
 	</mimetype>
 	<mimetype menu="1" name="video/mpeg">
diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index e7affd4f63..62467750a0 100755
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -428,9 +428,9 @@ class Windows_i686_Manifest(ViewerManifest):
             self.path("media_plugin_quicktime.dll")
             self.end_prefix()
 
-        # Media plugins - WebKit/Qt
-        if self.prefix(src='../media_plugins/webkit/%s' % self.args['configuration'], dst="llplugin"):
-            self.path("media_plugin_webkit.dll")
+        # Media plugins - CEF
+        if self.prefix(src='../media_plugins/cef/%s' % self.args['configuration'], dst="llplugin"):
+            self.path("media_plugin_cef.dll")
             self.end_prefix()
 
         # winmm.dll shim
-- 
cgit v1.2.3


From 834a94caec7691a957c0816f38ac00d765fa5021 Mon Sep 17 00:00:00 2001
From: callum_linden <none@none>
Date: Thu, 26 Mar 2015 04:35:13 +0100
Subject: point to new cef tpl with right headers, update cmaake and
 viewer_manifest logic to copy files to right place

---
 indra/newview/viewer_manifest.py | 142 +++++++++++++++++++++++----------------
 1 file changed, 85 insertions(+), 57 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index 62467750a0..8613cbed57 100755
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -438,69 +438,97 @@ class Windows_i686_Manifest(ViewerManifest):
             self.path("winmm.dll")
             self.end_prefix()
 
-
+        # CEF runtime files - debug
         if self.args['configuration'].lower() == 'debug':
-            if self.prefix(src=os.path.join(os.pardir, 'packages', 'lib', 'debug'),
-                           dst="llplugin"):
-                self.path("libeay32.dll")
-                self.path("qtcored4.dll")
-                self.path("qtguid4.dll")
-                self.path("qtnetworkd4.dll")
-                self.path("qtopengld4.dll")
-                self.path("qtwebkitd4.dll")
-                self.path("qtxmlpatternsd4.dll")
-                self.path("ssleay32.dll")
-
-                # For WebKit/Qt plugin runtimes (image format plugins)
-                if self.prefix(src="imageformats", dst="imageformats"):
-                    self.path("qgifd4.dll")
-                    self.path("qicod4.dll")
-                    self.path("qjpegd4.dll")
-                    self.path("qmngd4.dll")
-                    self.path("qsvgd4.dll")
-                    self.path("qtiffd4.dll")
-                    self.end_prefix()
-
-                # For WebKit/Qt plugin runtimes (codec/character encoding plugins)
-                if self.prefix(src="codecs", dst="codecs"):
-                    self.path("qcncodecsd4.dll")
-                    self.path("qjpcodecsd4.dll")
-                    self.path("qkrcodecsd4.dll")
-                    self.path("qtwcodecsd4.dll")
-                    self.end_prefix()
-
+            if self.prefix(src=os.path.join(os.pardir, 'packages', 'bin', 'debug'), dst="llplugin"):
+                self.path("d3dcompiler_43.dll")
+                self.path("d3dcompiler_47.dll")
+                self.path("ffmpegsumo.dll")
+                self.path("libcef.dll")
+                self.path("libEGL.dll")
+                self.path("libGLESv2.dll")
+                self.path("llceflib_host.exe")
+                self.path("pdf.dll")
+                self.path("wow_helper.exe")
                 self.end_prefix()
         else:
-            if self.prefix(src=os.path.join(os.pardir, 'packages', 'lib', 'release'),
-                           dst="llplugin"):
-                self.path("libeay32.dll")
-                self.path("qtcore4.dll")
-                self.path("qtgui4.dll")
-                self.path("qtnetwork4.dll")
-                self.path("qtopengl4.dll")
-                self.path("qtwebkit4.dll")
-                self.path("qtxmlpatterns4.dll")
-                self.path("ssleay32.dll")
-
-            # For WebKit/Qt plugin runtimes (image format plugins)
-            if self.prefix(src="imageformats", dst="imageformats"):
-                self.path("qgif4.dll")
-                self.path("qico4.dll")
-                self.path("qjpeg4.dll")
-                self.path("qmng4.dll")
-                self.path("qsvg4.dll")
-                self.path("qtiff4.dll")
+        # CEF runtime files - not debug (release, relwithdebinfo etc.)
+            if self.prefix(src=os.path.join(os.pardir, 'packages', 'bin', 'release'), dst="llplugin"):
+                self.path("d3dcompiler_43.dll")
+                self.path("d3dcompiler_47.dll")
+                self.path("ffmpegsumo.dll")
+                self.path("libcef.dll")
+                self.path("libEGL.dll")
+                self.path("libGLESv2.dll")
+                self.path("llceflib_host.exe")
+                self.path("pdf.dll")
+                self.path("wow_helper.exe")
                 self.end_prefix()
 
-            # For WebKit/Qt plugin runtimes (codec/character encoding plugins)
-            if self.prefix(src="codecs", dst="codecs"):
-                self.path("qcncodecs4.dll")
-                self.path("qjpcodecs4.dll")
-                self.path("qkrcodecs4.dll")
-                self.path("qtwcodecs4.dll")
-                self.end_prefix()
+        # CEF files common to all configurations
+        if self.prefix(src=os.path.join(os.pardir, 'packages', 'resources'), dst="llplugin"):
+            self.path("cef.pak")
+            self.path("cef_100_percent.pak")
+            self.path("cef_200_percent.pak")
+            self.path("devtools_resources.pak")
+            self.path("icudtl.dat")
+            self.end_prefix()
 
-        self.end_prefix()
+        if self.prefix(src=os.path.join(os.pardir, 'packages', 'resources', 'locales'), dst=os.path.join('llplugin', 'locales')):
+            self.path("am.pak")
+            self.path("ar.pak")
+            self.path("bg.pak")
+            self.path("bn.pak")
+            self.path("ca.pak")
+            self.path("cs.pak")
+            self.path("da.pak")
+            self.path("de.pak")
+            self.path("el.pak")
+            self.path("en-GB.pak")
+            self.path("en-US.pak")
+            self.path("es-419.pak")
+            self.path("es.pak")
+            self.path("et.pak")
+            self.path("fa.pak")
+            self.path("fi.pak")
+            self.path("fil.pak")
+            self.path("fr.pak")
+            self.path("gu.pak")
+            self.path("he.pak")
+            self.path("hi.pak")
+            self.path("hr.pak")
+            self.path("hu.pak")
+            self.path("id.pak")
+            self.path("it.pak")
+            self.path("ja.pak")
+            self.path("kn.pak")
+            self.path("ko.pak")
+            self.path("lt.pak")
+            self.path("lv.pak")
+            self.path("ml.pak")
+            self.path("mr.pak")
+            self.path("ms.pak")
+            self.path("nb.pak")
+            self.path("nl.pak")
+            self.path("pl.pak")
+            self.path("pt-BR.pak")
+            self.path("pt-PT.pak")
+            self.path("ro.pak")
+            self.path("ru.pak")
+            self.path("sk.pak")
+            self.path("sl.pak")
+            self.path("sr.pak")
+            self.path("sv.pak")
+            self.path("sw.pak")
+            self.path("ta.pak")
+            self.path("te.pak")
+            self.path("th.pak")
+            self.path("tr.pak")
+            self.path("uk.pak")
+            self.path("vi.pak")
+            self.path("zh-CN.pak")
+            self.path("zh-TW.pak")
+            self.end_prefix()
 
         # pull in the crash logger and updater from other projects
         # tag:"crash-logger" here as a cue to the exporter
-- 
cgit v1.2.3


From 3298dccfee96600eaa2e824485f767dc1da677c6 Mon Sep 17 00:00:00 2001
From: Callum Prentice <callum@lindenlab.com>
Date: Thu, 4 Jun 2015 16:28:00 -0700
Subject: Copy OS X media plugin to right place

---
 indra/newview/viewer_manifest.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index 8613cbed57..1efe082325 100755
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -846,8 +846,8 @@ class Darwin_i386_Manifest(ViewerManifest):
                 if self.prefix(src="", dst="llplugin"):
                     self.path2basename("../media_plugins/quicktime/" + self.args['configuration'],
                                        "media_plugin_quicktime.dylib")
-                    self.path2basename("../media_plugins/webkit/" + self.args['configuration'],
-                                       "media_plugin_webkit.dylib")
+                    self.path2basename("../media_plugins/cef/" + self.args['configuration'],
+                                       "media_plugin_cef.dylib")
                     self.end_prefix("llplugin")
 
                 self.end_prefix("Resources")
-- 
cgit v1.2.3


From d0320020b3b556294773e5f94b740d79ca9318da Mon Sep 17 00:00:00 2001
From: Callum Prentice <callum@lindenlab.com>
Date: Thu, 4 Jun 2015 16:32:03 -0700
Subject: Point all media with MIME type that used to be webkit, at the new CEF
 plugin

---
 .../skins/default/xui/en/mime_types_mac.xml        | 38 +++++++++++-----------
 1 file changed, 19 insertions(+), 19 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/skins/default/xui/en/mime_types_mac.xml b/indra/newview/skins/default/xui/en/mime_types_mac.xml
index 90230f12dd..f71c24b2e4 100755
--- a/indra/newview/skins/default/xui/en/mime_types_mac.xml
+++ b/indra/newview/skins/default/xui/en/mime_types_mac.xml
@@ -7,7 +7,7 @@
 		none
 	</defaultwidget>
 	<defaultimpl>
-		media_plugin_webkit
+		media_plugin_cef
 	</defaultimpl>
 	<widgetset name="web">
 		<label name="web_label">
@@ -152,7 +152,7 @@
 			none
 		</widgettype>
 		<impl>
-			media_plugin_webkit
+			media_plugin_cef
 		</impl>
 	</mimetype>
 	<mimetype name="audio/*">
@@ -185,7 +185,7 @@
 			image
 		</widgettype>
         <impl>
-			media_plugin_webkit
+			media_plugin_cef
 		</impl>
 	</mimetype>
 	<mimetype menu="1" name="video/vnd.secondlife.qt.legacy">
@@ -207,7 +207,7 @@
 			web
 		</widgettype>
 		<impl>
-			media_plugin_webkit
+			media_plugin_cef
 		</impl>
 	</mimetype>
 	<mimetype name="application/ogg">
@@ -229,7 +229,7 @@
 			image
 		</widgettype>
 		<impl>
-			media_plugin_webkit
+			media_plugin_cef
 		</impl>
 	</mimetype>
 	<mimetype name="application/postscript">
@@ -240,7 +240,7 @@
 			image
 		</widgettype>
 		<impl>
-			media_plugin_webkit
+			media_plugin_cef
 		</impl>
 	</mimetype>
 	<mimetype name="application/rtf">
@@ -251,7 +251,7 @@
 			image
 		</widgettype>
 		<impl>
-			media_plugin_webkit
+			media_plugin_cef
 		</impl>
 	</mimetype>
 	<mimetype name="application/smil">
@@ -262,7 +262,7 @@
 			movie
 		</widgettype>
 		<impl>
-			media_plugin_webkit
+			media_plugin_cef
 		</impl>
 	</mimetype>
 	<mimetype name="application/xhtml+xml">
@@ -273,7 +273,7 @@
 			web
 		</widgettype>
 		<impl>
-			media_plugin_webkit
+			media_plugin_cef
 		</impl>
 	</mimetype>
 	<mimetype name="application/x-director">
@@ -284,7 +284,7 @@
 			image
 		</widgettype>
 		<impl>
-			media_plugin_webkit
+			media_plugin_cef
 		</impl>
 	</mimetype>
 	<mimetype name="audio/mid">
@@ -339,7 +339,7 @@
 			image
 		</widgettype>
 		<impl>
-			media_plugin_webkit
+			media_plugin_cef
 		</impl>
 	</mimetype>
 	<mimetype menu="1" name="image/gif">
@@ -350,7 +350,7 @@
 			image
 		</widgettype>
 		<impl>
-			media_plugin_webkit
+			media_plugin_cef
 		</impl>
 	</mimetype>
 	<mimetype menu="1" name="image/jpeg">
@@ -361,7 +361,7 @@
 			image
 		</widgettype>
 		<impl>
-			media_plugin_webkit
+			media_plugin_cef
 		</impl>
 	</mimetype>
 	<mimetype menu="1" name="image/png">
@@ -372,7 +372,7 @@
 			image
 		</widgettype>
 		<impl>
-			media_plugin_webkit
+			media_plugin_cef
 		</impl>
 	</mimetype>
 	<mimetype name="image/svg+xml">
@@ -383,7 +383,7 @@
 			image
 		</widgettype>
 		<impl>
-			media_plugin_webkit
+			media_plugin_cef
 		</impl>
 	</mimetype>
 	<mimetype menu="1" name="image/tiff">
@@ -394,7 +394,7 @@
 			image
 		</widgettype>
 		<impl>
-			media_plugin_webkit
+			media_plugin_cef
 		</impl>
 	</mimetype>
 	<mimetype menu="1" name="text/html">
@@ -405,7 +405,7 @@
 			web
 		</widgettype>
 		<impl>
-			media_plugin_webkit
+			media_plugin_cef
 		</impl>
 	</mimetype>
 	<mimetype menu="1" name="text/plain">
@@ -416,7 +416,7 @@
 			text
 		</widgettype>
 		<impl>
-			media_plugin_webkit
+			media_plugin_cef
 		</impl>
 	</mimetype>
 	<mimetype name="text/xml">
@@ -427,7 +427,7 @@
 			text
 		</widgettype>
 		<impl>
-			media_plugin_webkit
+			media_plugin_cef
 		</impl>
 	</mimetype>
 	<mimetype menu="1" name="video/mpeg">
-- 
cgit v1.2.3


From a2339f66e4a806e90469f24272ef8599375698fd Mon Sep 17 00:00:00 2001
From: Callum Prentice <callum@lindenlab.com>
Date: Thu, 11 Jun 2015 16:31:37 -0700
Subject: Add commands to move CEF runtime files to right place and fix up
 media_plugin_cef with install_name_tool (note, this generates 2 copies of CEF
 framework - will fix later)

---
 indra/newview/viewer_manifest.py | 52 ++++++++++++++++------------------------
 1 file changed, 20 insertions(+), 32 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index 1efe082325..83ba3e2ea0 100755
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -812,37 +812,16 @@ class Darwin_i386_Manifest(ViewerManifest):
                             symlinkf(src, dst)
                         except OSError as err:
                             print "Can't symlink %s -> %s: %s" % (src, dst, err)
-                # SLPlugin.app/Contents/Resources gets those Qt4 libraries it needs.
-                if self.prefix(src="", dst="SLPlugin.app/Contents/Resources"):
-                    for libfile in ('libQtCore.4.dylib',
-                                    'libQtCore.4.7.1.dylib',
-                                    'libQtGui.4.dylib',
-                                    'libQtGui.4.7.1.dylib',
-                                    'libQtNetwork.4.dylib',
-                                    'libQtNetwork.4.7.1.dylib',
-                                    'libQtOpenGL.4.dylib',
-                                    'libQtOpenGL.4.7.1.dylib',
-                                    'libQtSvg.4.dylib',
-                                    'libQtSvg.4.7.1.dylib',
-                                    'libQtWebKit.4.dylib',
-                                    'libQtWebKit.4.7.1.dylib',
-                                    'libQtXml.4.dylib',
-                                    'libQtXml.4.7.1.dylib'):
-                        self.path2basename(relpkgdir, libfile)
-                    self.end_prefix("SLPlugin.app/Contents/Resources")
-
-                # Qt4 codecs go to llplugin.  Not certain why but this is the first
-                # location probed according to dtruss so we'll go with that.
-                if self.prefix(src="../packages/plugins/codecs/", dst="llplugin/codecs"):
-                    self.path("libq*.dylib")
-                    self.end_prefix("llplugin/codecs")
-
-                # Similarly for imageformats.
-                if self.prefix(src="../packages/plugins/imageformats/", dst="llplugin/imageformats"):
-                    self.path("libq*.dylib")
-                    self.end_prefix("llplugin/imageformats")
-
-                # SLPlugin plugins proper
+
+                # LLCefLib helper apps go inside SLPlugin.app
+                if self.prefix(src="", dst="SLPlugin.app/Contents/Frameworks"):
+                    for helperappfile in ('LLCefLib Helper.app',
+                                          'Chromium Embedded Framework.framework',  # TODO replace with symlink
+                                          'LLCefLib Helper EH.app'):
+                        self.path2basename(relpkgdir, helperappfile)
+                    self.end_prefix()
+
+                # SLPlugin plugins
                 if self.prefix(src="", dst="llplugin"):
                     self.path2basename("../media_plugins/quicktime/" + self.args['configuration'],
                                        "media_plugin_quicktime.dylib")
@@ -852,8 +831,18 @@ class Darwin_i386_Manifest(ViewerManifest):
 
                 self.end_prefix("Resources")
 
+                # CEF framework goes inside Second Life.app/Contents/Frameworks
+                if self.prefix(src="", dst="Frameworks"):
+                    frameworkfile="Chromium Embedded Framework.framework"
+                    self.path2basename(relpkgdir, frameworkfile)
+                    self.end_prefix("Frameworks")
+
             self.end_prefix("Contents")
 
+        # fix up media_plugin.dylib so it knows where to look for CEF files it needs
+        self.run_command('install_name_tool -change "@executable_path/Chromium Embedded Framework" "@executable_path/../Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework" "%(config)s/Second Life.app/Contents/Resources/llplugin/media_plugin_cef.dylib"' %
+                        { 'config' : self.args['configuration'] })
+
         # NOTE: the -S argument to strip causes it to keep enough info for
         # annotated backtraces (i.e. function names in the crash log).  'strip' with no
         # arguments yields a slightly smaller binary but makes crash logs mostly useless.
@@ -863,7 +852,6 @@ class Darwin_i386_Manifest(ViewerManifest):
             self.run_command('strip -S %(viewer_binary)r' %
                              { 'viewer_binary' : self.dst_path_of('Contents/MacOS/Second Life')})
 
-
     def copy_finish(self):
         # Force executable permissions to be set for scripts
         # see CHOP-223 and http://mercurial.selenic.com/bts/issue1802
-- 
cgit v1.2.3


From f97fb4d80f7e6f4b810e06457afbd65a16390adc Mon Sep 17 00:00:00 2001
From: Callum Prentice <callum@lindenlab.com>
Date: Thu, 18 Jun 2015 12:01:13 -0700
Subject: Add code in viewer_manifest.py to create a symlink for second copy of
 CEF framework vs copying in second version

---
 indra/newview/viewer_manifest.py | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

(limited to 'indra/newview')

diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index 357124cfee..06deacee52 100755
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -820,9 +820,11 @@ class Darwin_i386_Manifest(ViewerManifest):
                 # LLCefLib helper apps go inside SLPlugin.app
                 if self.prefix(src="", dst="SLPlugin.app/Contents/Frameworks"):
                     for helperappfile in ('LLCefLib Helper.app',
-                                          'Chromium Embedded Framework.framework',  # TODO replace with symlink
                                           'LLCefLib Helper EH.app'):
                         self.path2basename(relpkgdir, helperappfile)
+
+                    pluginframeworkpath = self.dst_path_of('Chromium Embedded Framework.framework');
+
                     self.end_prefix()
 
                 # SLPlugin plugins
@@ -841,6 +843,24 @@ class Darwin_i386_Manifest(ViewerManifest):
                     self.path2basename(relpkgdir, frameworkfile)
                     self.end_prefix("Frameworks")
 
+                # This code constructs a relative path from the
+                # target framework folder back to the location of the symlink.
+                # It needs to be relative so that the symlink still works when
+                # (as is normal) the user moves the app bunlde out of the DMG
+                # and into the /Applications folder. Note we also call 'raise'
+                # to terminate the process if we get an error since without
+                # this symlink, Second Life web media can't possibly work.
+                # Real Framework folder:
+                #   Second Life.app/Contents/Frameworks/Chromium Embedded Framework.framework/
+                # Location of symlink and why it'ds relavie 
+                #   Second Life.app/Contents/Resources/SLPlugin.app/Contents/Frameworks/Chromium Embedded Framework.framework/
+                frameworkpath = os.path.join(os.pardir, os.pardir, os.pardir, os.pardir, "Frameworks", "Chromium Embedded Framework.framework")
+                try:
+                    symlinkf(frameworkpath, pluginframeworkpath)
+                except OSError as err:
+                    print "Can't symlink %s -> %s: %s" % (frameworkpath, pluginframeworkpath, err)
+                    raise
+
             self.end_prefix("Contents")
 
         # fix up media_plugin.dylib so it knows where to look for CEF files it needs
-- 
cgit v1.2.3


From f7908a50294adff3456436074075a677a9c6239b Mon Sep 17 00:00:00 2001
From: callum_linden <none@none>
Date: Tue, 30 Jun 2015 00:07:58 +0100
Subject: Point to new version of LLCefLib with support for second life URLs,
 version string, navigation commands

---
 indra/newview/llappviewer.cpp                  | 5 ++---
 indra/newview/skins/default/xui/en/strings.xml | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 6dc71bc94e..d2b9259ef7 100755
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -123,6 +123,7 @@
 #include "llleap.h"
 #include "stringize.h"
 #include "llcoros.h"
+#include "cef/llceflib.h"
 
 // Third party library includes
 #include <boost/bind.hpp>
@@ -130,7 +131,6 @@
 #include <boost/algorithm/string.hpp>
 #include <boost/regex.hpp>
 
-
 #if LL_WINDOWS
 #	include <share.h> // For _SH_DENYWR in processMarkerFiles
 #else
@@ -3369,8 +3369,7 @@ LLSD LLAppViewer::getViewerInfo() const
 		info["VOICE_VERSION"] = LLTrans::getString("NotConnected");
 	}
 
-	// TODO: Implement media plugin version query
-	info["QT_WEBKIT_VERSION"] = "4.7.1 (version number hard-coded)";
+	info["LLCEFLIB_VERSION"] = LLCEFLIB_VERSION;
 
 	S32 packets_in = LLViewerStats::instance().getRecording().getSum(LLStatViewer::PACKETS_IN);
 	if (packets_in > 0)
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index f77678e5f8..d6ac91e45f 100755
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -50,7 +50,7 @@ OpenGL Version: [OPENGL_VERSION]
 libcurl Version: [LIBCURL_VERSION]
 J2C Decoder Version: [J2C_VERSION]
 Audio Driver Version: [AUDIO_DRIVER_VERSION]
-Qt Webkit Version: [QT_WEBKIT_VERSION]
+LLCEFLib/CEF Version: [LLCEFLIB_VERSION]
 Voice Server Version: [VOICE_VERSION]
 	</string>
 	<string name="AboutTraffic">Packets Lost: [PACKETS_LOST,number,0]/[PACKETS_IN,number,0] ([PACKETS_PCT,number,1]%)</string>
-- 
cgit v1.2.3


From ca49ad736a06aa796610f068f6419c39b8535251 Mon Sep 17 00:00:00 2001
From: callum_linden <none@none>
Date: Fri, 10 Jul 2015 01:01:07 +0100
Subject: Initial support for keyboard (in progress) but includes many viewer
 changes to plumb in Key Up events

---
 indra/newview/llmediactrl.cpp        | 27 +++++++++++++++++++-----
 indra/newview/llmediactrl.h          |  3 ++-
 indra/newview/llviewerkeyboard.cpp   |  5 ++++-
 indra/newview/llviewerkeyboard.h     |  1 +
 indra/newview/llviewermedia.cpp      | 41 +++++++++++++++++++++++++++---------
 indra/newview/llviewermedia.h        |  1 +
 indra/newview/llviewermediafocus.cpp |  7 ++++++
 indra/newview/llviewermediafocus.h   |  1 +
 indra/newview/llviewerwindow.cpp     | 38 +++++++++++++++++++++++++++++++--
 indra/newview/llviewerwindow.h       |  3 ++-
 10 files changed, 107 insertions(+), 20 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp
index b96bdd73ff..d1bb799015 100755
--- a/indra/newview/llmediactrl.cpp
+++ b/indra/newview/llmediactrl.cpp
@@ -410,18 +410,35 @@ void LLMediaCtrl::onOpenWebInspector()
 
 ////////////////////////////////////////////////////////////////////////////////
 //
-BOOL LLMediaCtrl::handleKeyHere( KEY key, MASK mask )
+BOOL LLMediaCtrl::handleKeyHere(KEY key, MASK mask)
 {
 	BOOL result = FALSE;
-	
+
 	if (mMediaSource)
 	{
 		result = mMediaSource->handleKeyHere(key, mask);
 	}
-	
-	if ( ! result )
+
+	if (!result)
 		result = LLPanel::handleKeyHere(key, mask);
-		
+
+	return result;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+BOOL LLMediaCtrl::handleKeyUpHere(KEY key, MASK mask)
+{
+	BOOL result = FALSE;
+
+	if (mMediaSource)
+	{
+		result = mMediaSource->handleKeyUpHere(key, mask);
+	}
+
+	if (!result)
+		result = LLPanel::handleKeyUpHere(key, mask);
+
 	return result;
 }
 
diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h
index 785c57b78a..469ff38ee6 100755
--- a/indra/newview/llmediactrl.h
+++ b/indra/newview/llmediactrl.h
@@ -150,7 +150,8 @@ public:
 		void setTrustedContent(bool trusted);
 
 		// over-rides
-		virtual BOOL handleKeyHere( KEY key, MASK mask);
+		virtual BOOL handleKeyHere(KEY key, MASK mask);
+		virtual BOOL handleKeyUpHere(KEY key, MASK mask);
 		virtual void onVisibilityChange ( BOOL new_visibility );
 		virtual BOOL handleUnicodeCharHere(llwchar uni_char);
 		virtual void reshape( S32 width, S32 height, BOOL called_from_parent = TRUE);
diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp
index ada829eb4b..1ab672aafc 100755
--- a/indra/newview/llviewerkeyboard.cpp
+++ b/indra/newview/llviewerkeyboard.cpp
@@ -729,7 +729,10 @@ BOOL LLViewerKeyboard::handleKey(KEY translated_key,  MASK translated_mask, BOOL
 	return mKeyHandledByUI[translated_key];
 }
 
-
+BOOL LLViewerKeyboard::handleKeyUp(KEY translated_key, MASK translated_mask)
+{
+	return gViewerWindow->handleKeyUp(translated_key, translated_mask);
+}
 
 BOOL LLViewerKeyboard::bindKey(const S32 mode, const KEY key, const MASK mask, const std::string& function_name)
 {
diff --git a/indra/newview/llviewerkeyboard.h b/indra/newview/llviewerkeyboard.h
index ca73212ed1..110dc89d28 100755
--- a/indra/newview/llviewerkeyboard.h
+++ b/indra/newview/llviewerkeyboard.h
@@ -89,6 +89,7 @@ public:
 	LLViewerKeyboard();
 
 	BOOL			handleKey(KEY key, MASK mask, BOOL repeated);
+	BOOL			handleKeyUp(KEY key, MASK mask);
 
 	S32				loadBindings(const std::string& filename);										// returns number bound, 0 on error
 	S32				loadBindingsXML(const std::string& filename);										// returns number bound, 0 on error
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index aa4943b8e8..60a5f99e19 100755
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -2698,27 +2698,48 @@ void LLViewerMediaImpl::navigateStop()
 bool LLViewerMediaImpl::handleKeyHere(KEY key, MASK mask)
 {
 	bool result = false;
-	
+
 	if (mMediaSource)
 	{
 		// FIXME: THIS IS SO WRONG.
 		// Menu keys should be handled by the menu system and not passed to UI elements, but this is how LLTextEditor and LLLineEditor do it...
-		if( MASK_CONTROL & mask && key != KEY_LEFT && key != KEY_RIGHT && key != KEY_HOME && key != KEY_END)
+		if (MASK_CONTROL & mask && key != KEY_LEFT && key != KEY_RIGHT && key != KEY_HOME && key != KEY_END)
 		{
 			result = true;
 		}
-		
-		if(!result)
+
+		if (!result)
 		{
-			
+
 			LLSD native_key_data = gViewerWindow->getWindow()->getNativeKeyData();
-			
-			result = mMediaSource->keyEvent(LLPluginClassMedia::KEY_EVENT_DOWN ,key, mask, native_key_data);
-			// Since the viewer internal event dispatching doesn't give us key-up events, simulate one here.
-			(void)mMediaSource->keyEvent(LLPluginClassMedia::KEY_EVENT_UP ,key, mask, native_key_data);
+			result = mMediaSource->keyEvent(LLPluginClassMedia::KEY_EVENT_DOWN, key, mask, native_key_data);
 		}
 	}
-	
+
+	return result;
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+bool LLViewerMediaImpl::handleKeyUpHere(KEY key, MASK mask)
+{
+	bool result = false;
+
+	if (mMediaSource)
+	{
+		// FIXME: THIS IS SO WRONG.
+		// Menu keys should be handled by the menu system and not passed to UI elements, but this is how LLTextEditor and LLLineEditor do it...
+		if (MASK_CONTROL & mask && key != KEY_LEFT && key != KEY_RIGHT && key != KEY_HOME && key != KEY_END)
+		{
+			result = true;
+		}
+
+		if (!result)
+		{
+			LLSD native_key_data = gViewerWindow->getWindow()->getNativeKeyData();
+			result = mMediaSource->keyEvent(LLPluginClassMedia::KEY_EVENT_UP, key, mask, native_key_data);
+		}
+	}
+
 	return result;
 }
 
diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h
index 6803adfaa2..f2da30e10b 100755
--- a/indra/newview/llviewermedia.h
+++ b/indra/newview/llviewermedia.h
@@ -238,6 +238,7 @@ public:
 	void navigateInternal();
 	void navigateStop();
 	bool handleKeyHere(KEY key, MASK mask);
+	bool handleKeyUpHere(KEY key, MASK mask);
 	bool handleUnicodeCharHere(llwchar uni_char);
 	bool canNavigateForward();
 	bool canNavigateBack();
diff --git a/indra/newview/llviewermediafocus.cpp b/indra/newview/llviewermediafocus.cpp
index aa019dfdd8..1265ca0a70 100755
--- a/indra/newview/llviewermediafocus.cpp
+++ b/indra/newview/llviewermediafocus.cpp
@@ -352,6 +352,13 @@ BOOL LLViewerMediaFocus::handleKey(KEY key, MASK mask, BOOL called_from_parent)
 	return true;
 }
 
+BOOL LLViewerMediaFocus::handleKeyUp(KEY key, MASK mask, BOOL called_from_parent)
+{
+	return true;
+}
+
+
+
 BOOL LLViewerMediaFocus::handleUnicodeChar(llwchar uni_char, BOOL called_from_parent)
 {
 	LLViewerMediaImpl* media_impl = getFocusedMediaImpl();
diff --git a/indra/newview/llviewermediafocus.h b/indra/newview/llviewermediafocus.h
index f03dd8751e..42c841df15 100755
--- a/indra/newview/llviewermediafocus.h
+++ b/indra/newview/llviewermediafocus.h
@@ -56,6 +56,7 @@ public:
 	
 	/*virtual*/ bool	getFocus();
 	/*virtual*/ BOOL	handleKey(KEY key, MASK mask, BOOL called_from_parent);
+	/*virtual*/ BOOL	handleKeyUp(KEY key, MASK mask, BOOL called_from_parent);
 	/*virtual*/ BOOL	handleUnicodeChar(llwchar uni_char, BOOL called_from_parent);
 	BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
 
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index e317989f04..ed4acfddc4 100755
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1399,10 +1399,9 @@ BOOL LLViewerWindow::handleTranslatedKeyUp(KEY key,  MASK mask)
 		tool_inspectp->keyUp(key, mask);
 	}
 
-	return FALSE;
+	return gViewerKeyboard.handleKeyUp(key, mask);
 }
 
-
 void LLViewerWindow::handleScanKey(KEY key, BOOL key_down, BOOL key_up, BOOL key_level)
 {
 	LLViewerJoystick::getInstance()->setCameraNeedsUpdate(true);
@@ -2542,6 +2541,41 @@ void LLViewerWindow::draw()
 //#endif
 }
 
+// Takes a single keydown event, usually when UI is visible
+BOOL LLViewerWindow::handleKeyUp(KEY key, MASK mask)
+{
+	if (gFocusMgr.getKeyboardFocus()
+		&& !(mask & (MASK_CONTROL | MASK_ALT))
+		&& !gFocusMgr.getKeystrokesOnly())
+	{
+		// We have keyboard focus, and it's not an accelerator
+		if (key < 0x80)
+		{
+			// Not a special key, so likely (we hope) to generate a character.  Let it fall through to character handler first.
+			return (gFocusMgr.getKeyboardFocus() != NULL);
+		}
+	}
+
+	LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus();
+	if (keyboard_focus)
+	{
+		if (keyboard_focus->handleKeyUp(key, mask, FALSE))
+		{
+			LL_DEBUGS() << "LLviewerWindow::handleKeyUp - in 'traverse up' - no loops seen... just called keyboard_focus->handleKeyUp an it returned true" << LL_ENDL;
+			LLViewerEventRecorder::instance().logKeyEvent(key, mask);
+			return TRUE;
+		}
+		else {
+			LL_DEBUGS() << "LLviewerWindow::handleKeyUp - in 'traverse up' - no loops seen... just called keyboard_focus->handleKeyUp an it returned FALSE" << LL_ENDL;
+		}
+	}
+
+	// don't pass keys on to world when something in ui has focus
+	return gFocusMgr.childHasKeyboardFocus(mRootView)
+		|| LLMenuGL::getKeyboardMode()
+		|| (gMenuBarView && gMenuBarView->getHighlightedItem() && gMenuBarView->getHighlightedItem()->isActive());
+}
+
 // Takes a single keydown event, usually when UI is visible
 BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
 {
diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h
index 7fde52d4e1..dac6328eaa 100755
--- a/indra/newview/llviewerwindow.h
+++ b/indra/newview/llviewerwindow.h
@@ -314,7 +314,8 @@ public:
 	LLView*			getHintHolder() { return mHintHolder.get(); }
 	LLView*			getLoginPanelHolder() { return mLoginPanelHolder.get(); }
 	BOOL			handleKey(KEY key, MASK mask);
-	void			handleScrollWheel	(S32 clicks);
+	BOOL			handleKeyUp(KEY key, MASK mask);
+	void			handleScrollWheel(S32 clicks);
 
 	// add and remove views from "popup" layer
 	void			addPopup(LLView* popup);
-- 
cgit v1.2.3


From 0d6d281cb3c54b08eb845199ba24992bddcf9bae Mon Sep 17 00:00:00 2001
From: callum_linden <none@none>
Date: Thu, 16 Jul 2015 16:11:19 -0700
Subject: Point to LLCEFLib with updated 2357 version and support for setting
 language for embedded browser

---
 indra/newview/viewer_manifest.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index 06deacee52..ad8a236f92 100755
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -452,7 +452,8 @@ class Windows_i686_Manifest(ViewerManifest):
                 self.path("libEGL.dll")
                 self.path("libGLESv2.dll")
                 self.path("llceflib_host.exe")
-                self.path("pdf.dll")
+                self.path("natives_blob.bin")
+                self.path("snapshot_blob.bin")
                 self.path("wow_helper.exe")
                 self.end_prefix()
         else:
@@ -465,7 +466,8 @@ class Windows_i686_Manifest(ViewerManifest):
                 self.path("libEGL.dll")
                 self.path("libGLESv2.dll")
                 self.path("llceflib_host.exe")
-                self.path("pdf.dll")
+                self.path("natives_blob.bin")
+                self.path("snapshot_blob.bin")
                 self.path("wow_helper.exe")
                 self.end_prefix()
 
-- 
cgit v1.2.3


From a75a4e2a4f0b8bc65aa45368326fce0e6635c4ac Mon Sep 17 00:00:00 2001
From: callum_linden <none@none>
Date: Mon, 27 Jul 2015 16:09:04 -0700
Subject: Bring in lastest version of LLCEFLIb & set user agent string before
 browser instance created

---
 indra/newview/llviewermedia.cpp | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'indra/newview')

diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 60a5f99e19..5eab0a15ab 100755
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -1872,6 +1872,9 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_
 			bool media_plugin_debugging_enabled = gSavedSettings.getBOOL("MediaPluginDebugging");
 			media_source->enableMediaPluginDebugging( media_plugin_debugging_enabled  || clean_browser);
 
+			// need to set agent string here before instance created
+			media_source->setBrowserUserAgent(LLViewerMedia::getCurrentUserAgent());
+
 			media_source->setTarget(target);
 			
 			const std::string plugin_dir = gDirUtilp->getLLPluginDir();
-- 
cgit v1.2.3


From 236b3b9f842c86e1f176068ab70b82f83874e2ab Mon Sep 17 00:00:00 2001
From: callum_linden <none@none>
Date: Thu, 3 Sep 2015 18:16:46 -0700
Subject: support for external links and location_changed messages

---
 indra/newview/llmediactrl.cpp                     | 30 +++++++++++++----------
 indra/newview/skins/default/xui/en/menu_login.xml |  2 +-
 2 files changed, 18 insertions(+), 14 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp
index d1bb799015..40d352f9b7 100755
--- a/indra/newview/llmediactrl.cpp
+++ b/indra/newview/llmediactrl.cpp
@@ -993,19 +993,23 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event)
 			std::string target = self->getClickTarget();
 			std::string uuid = self->getClickUUID();
 
-			LLNotification::Params notify_params;
-			notify_params.name = "PopupAttempt";
-			notify_params.payload = LLSD().with("target", target).with("url", url).with("uuid", uuid).with("media_id", mMediaTextureID);
-			notify_params.functor.function = boost::bind(&LLMediaCtrl::onPopup, this, _1, _2);
-
-			if (mTrusted)
-			{
-				LLNotifications::instance().forceResponse(notify_params, 0);
-			}
-			else
-			{
-				LLNotifications::instance().add(notify_params);
-			}
+			LLWeb::loadURL(url, target, std::string());
+
+			// CP: removing this code because we no longer support popups so this breaks the flow.
+			//     replaced with a bare call to LLWeb::LoadURL(...)
+			//LLNotification::Params notify_params;
+			//notify_params.name = "PopupAttempt";
+			//notify_params.payload = LLSD().with("target", target).with("url", url).with("uuid", uuid).with("media_id", mMediaTextureID);
+			//notify_params.functor.function = boost::bind(&LLMediaCtrl::onPopup, this, _1, _2);
+
+			//if (mTrusted)
+			//{
+			//	LLNotifications::instance().forceResponse(notify_params, 0);
+			//}
+			//else
+			//{
+			//	LLNotifications::instance().add(notify_params);
+			//}
 			break;
 		};
 
diff --git a/indra/newview/skins/default/xui/en/menu_login.xml b/indra/newview/skins/default/xui/en/menu_login.xml
index e91eea04d1..f59c5e35a6 100755
--- a/indra/newview/skins/default/xui/en/menu_login.xml
+++ b/indra/newview/skins/default/xui/en/menu_login.xml
@@ -230,7 +230,7 @@
        name="Web Content Floater Debug Test">
         <menu_item_call.on_click
          function="Advanced.WebContentTest"
-         parameter="http://google.com"/>
+         parameter="https://callum-linden.s3.amazonaws.com/ceftests.html"/>
       </menu_item_call>
       <menu
        create_jump_keys="true"
-- 
cgit v1.2.3


From 83f26facbf717504b0ab4677cb6dd64534f6b844 Mon Sep 17 00:00:00 2001
From: callum_linden <none@none>
Date: Thu, 3 Sep 2015 19:59:57 -0700
Subject: point to new version of llceflib with fixed support for secondlife://
 URLs

---
 indra/newview/skins/default/xui/en/menu_viewer.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'indra/newview')

diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 2463c5f43b..a633ef3a52 100755
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -3185,7 +3185,7 @@
            shortcut="control|shift|Z">
             <menu_item_call.on_click
              function="Advanced.WebContentTest"
-             parameter="http://google.com"/>
+             parameter="https://callum-linden.s3.amazonaws.com/ceftests.html"/>
           </menu_item_call>
           <menu_item_call
            label="FB Connect Test"
-- 
cgit v1.2.3


From 533e4f3652b1b6da4a364117e20f6d88c4f9647a Mon Sep 17 00:00:00 2001
From: callum_linden <none@none>
Date: Mon, 21 Sep 2015 15:37:49 -0700
Subject: Remove UI for no longer used Enabled Media Popups checkbox

---
 .../skins/default/xui/en/panel_preferences_setup.xml        | 13 -------------
 1 file changed, 13 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml
index 1e9a1aa27c..eafe575a06 100755
--- a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml
@@ -224,19 +224,6 @@
     radio_style="false"
     width="400"
     top_pad="5"/>
-  <check_box
-    top_delta="4"
-    enabled="true"
-    follows="left|top"
-    height="14"
-    initial_value="false"
-    control_name="MediaEnablePopups"
-    label="Enable media browser pop-ups"
-    left_delta="0"
-    mouse_opaque="true"
-    name="media_popup_enabled"
-    width="400"           
-    top_pad="5"/>
   <text
      type="string"
      length="1"
-- 
cgit v1.2.3


From 3e20770f350652b91fd4b4a5bbef9b5f03561310 Mon Sep 17 00:00:00 2001
From: callum_linden <none@none>
Date: Sat, 26 Sep 2015 18:53:17 -0700
Subject: Point to new third party llcef package and fix typo in interface

---
 indra/newview/viewer_manifest.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index ad8a236f92..bc5be822d0 100755
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -447,13 +447,13 @@ class Windows_i686_Manifest(ViewerManifest):
             if self.prefix(src=os.path.join(os.pardir, 'packages', 'bin', 'debug'), dst="llplugin"):
                 self.path("d3dcompiler_43.dll")
                 self.path("d3dcompiler_47.dll")
-                self.path("ffmpegsumo.dll")
                 self.path("libcef.dll")
                 self.path("libEGL.dll")
                 self.path("libGLESv2.dll")
                 self.path("llceflib_host.exe")
                 self.path("natives_blob.bin")
                 self.path("snapshot_blob.bin")
+                self.path("widevinecdmadapter.dll")
                 self.path("wow_helper.exe")
                 self.end_prefix()
         else:
@@ -461,13 +461,13 @@ class Windows_i686_Manifest(ViewerManifest):
             if self.prefix(src=os.path.join(os.pardir, 'packages', 'bin', 'release'), dst="llplugin"):
                 self.path("d3dcompiler_43.dll")
                 self.path("d3dcompiler_47.dll")
-                self.path("ffmpegsumo.dll")
                 self.path("libcef.dll")
                 self.path("libEGL.dll")
                 self.path("libGLESv2.dll")
                 self.path("llceflib_host.exe")
                 self.path("natives_blob.bin")
                 self.path("snapshot_blob.bin")
+                self.path("widevinecdmadapter.dll")
                 self.path("wow_helper.exe")
                 self.end_prefix()
 
@@ -476,6 +476,7 @@ class Windows_i686_Manifest(ViewerManifest):
             self.path("cef.pak")
             self.path("cef_100_percent.pak")
             self.path("cef_200_percent.pak")
+            self.path("cef_extensions.pak")
             self.path("devtools_resources.pak")
             self.path("icudtl.dat")
             self.end_prefix()
-- 
cgit v1.2.3


From fba31a22a132f855dc59014f4e9b93f15d45708d Mon Sep 17 00:00:00 2001
From: callum_linden <none@none>
Date: Tue, 29 Sep 2015 14:06:00 -0700
Subject: SL-229 (fix) update viewer version number to 4.0.0

---
 indra/newview/VIEWER_VERSION.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'indra/newview')

diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt
index 0cbfaed0d9..fcdb2e109f 100644
--- a/indra/newview/VIEWER_VERSION.txt
+++ b/indra/newview/VIEWER_VERSION.txt
@@ -1 +1 @@
-3.8.5
+4.0.0
-- 
cgit v1.2.3


From cb7f84a470d7afeb1501cf5514333c6ee15d96df Mon Sep 17 00:00:00 2001
From: Rider Linden <rider@lindenlab.com>
Date: Fri, 2 Oct 2015 11:14:28 -0700
Subject: MAINT-5687: Remove old webkit from the make files and the repo. 
 Ensure that it is no longer meaningfully referenced.

---
 indra/newview/CMakeLists.txt     | 4 ----
 indra/newview/llappviewer.cpp    | 6 ++++++
 indra/newview/viewer_manifest.py | 2 --
 3 files changed, 6 insertions(+), 6 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index d575e5cd8c..087d508c42 100755
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -1764,7 +1764,6 @@ if (WINDOWS)
       ${ARCH_PREBUILT_DIRS_RELEASE}/qtgui4.dll
       ${ARCH_PREBUILT_DIRS_RELEASE}/qtnetwork4.dll
       ${ARCH_PREBUILT_DIRS_RELEASE}/qtopengl4.dll
-      ${ARCH_PREBUILT_DIRS_RELEASE}/qtwebkit4.dll
       ${ARCH_PREBUILT_DIRS_RELEASE}/qtxmlpatterns4.dll
       ${ARCH_PREBUILT_DIRS_RELEASE}/ssleay32.dll
       ${ARCH_PREBUILT_DIRS_RELEASE}/imageformats/qgif4.dll
@@ -1782,7 +1781,6 @@ if (WINDOWS)
       ${ARCH_PREBUILT_DIRS_DEBUG}/qtguid4.dll
       ${ARCH_PREBUILT_DIRS_DEBUG}/qtnetworkd4.dll
       ${ARCH_PREBUILT_DIRS_DEBUG}/qtopengld4.dll
-      ${ARCH_PREBUILT_DIRS_DEBUG}/qtwebkitd4.dll
       ${ARCH_PREBUILT_DIRS_DEBUG}/qtxmlpatternsd4.dll
       ${ARCH_PREBUILT_DIRS_DEBUG}/ssleay32.dll
       ${ARCH_PREBUILT_DIRS_DEBUG}/imageformats/qgifd4.dll
@@ -2013,7 +2011,6 @@ if (LINUX)
     ${VIEWER_BINARY_NAME}
     linux-crash-logger
     SLPlugin
-    media_plugin_webkit
     media_plugin_gstreamer010
     llcommon
     )
@@ -2185,7 +2182,6 @@ if (PACKAGE)
     list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/mac_crash_logger/${CMAKE_CFG_INTDIR}")
     list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/gstreamer010/${CMAKE_CFG_INTDIR}")
     list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/quicktime/${CMAKE_CFG_INTDIR}")
-##  list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/webkit/${CMAKE_CFG_INTDIR}")
     set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-symbols-darwin.tar.bz2")
     set(VIEWER_EXE_GLOBS "'Second Life' SLPlugin mac-crash-logger")
     set(VIEWER_EXE_GLOBS "'Second Life' mac-crash-logger")
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 663f1a3550..68976dcfe3 100755
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -124,7 +124,9 @@
 #include "llleap.h"
 #include "stringize.h"
 #include "llcoros.h"
+#if !LL_LINUX
 #include "cef/llceflib.h"
+#endif
 
 // Third party library includes
 #include <boost/bind.hpp>
@@ -3370,7 +3372,11 @@ LLSD LLAppViewer::getViewerInfo() const
 		info["VOICE_VERSION"] = LLTrans::getString("NotConnected");
 	}
 
+#if !LL_LINUX
 	info["LLCEFLIB_VERSION"] = LLCEFLIB_VERSION;
+#else
+	info["LLCEFLIB_VERSION"] = "Undefined";
+#endif
 
 	S32 packets_in = LLViewerStats::instance().getRecording().getSum(LLStatViewer::PACKETS_IN);
 	if (packets_in > 0)
diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index bc5be822d0..15ec946e63 100755
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -1076,7 +1076,6 @@ class LinuxManifest(ViewerManifest):
 
         # plugins
         if self.prefix(src="", dst="bin/llplugin"):
-            self.path2basename("../media_plugins/webkit", "libmedia_plugin_webkit.so")
             self.path("../media_plugins/gstreamer010/libmedia_plugin_gstreamer010.so", "libmedia_plugin_gstreamer.so")
             self.end_prefix("bin/llplugin")
 
@@ -1224,7 +1223,6 @@ class Linux_i686_Manifest(LinuxManifest):
                 self.path("libQtNetwork.so*")
                 self.path("libQtOpenGL.so*")
                 self.path("libQtSvg.so*")
-                self.path("libQtWebKit.so*")
                 self.path("libQtXml.so*")
                 self.end_prefix("lib")
 
-- 
cgit v1.2.3


From 2fc42c1221393161fcd882b6bb73a7a6da9d07e2 Mon Sep 17 00:00:00 2001
From: Rider Linden <rider@lindenlab.com>
Date: Fri, 2 Oct 2015 12:21:09 -0700
Subject: MAINT-5687: Further purge QT and webkit from the build.

---
 indra/newview/CMakeLists.txt     | 30 ------------------------------
 indra/newview/viewer_manifest.py | 30 ------------------------------
 2 files changed, 60 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 087d508c42..73ed651e65 100755
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -1760,39 +1760,9 @@ if (WINDOWS)
       ${CMAKE_CURRENT_SOURCE_DIR}/featuretable.txt
       ${CMAKE_CURRENT_SOURCE_DIR}/featuretable_xp.txt
       ${ARCH_PREBUILT_DIRS_RELEASE}/libeay32.dll
-      ${ARCH_PREBUILT_DIRS_RELEASE}/qtcore4.dll
-      ${ARCH_PREBUILT_DIRS_RELEASE}/qtgui4.dll
-      ${ARCH_PREBUILT_DIRS_RELEASE}/qtnetwork4.dll
-      ${ARCH_PREBUILT_DIRS_RELEASE}/qtopengl4.dll
-      ${ARCH_PREBUILT_DIRS_RELEASE}/qtxmlpatterns4.dll
       ${ARCH_PREBUILT_DIRS_RELEASE}/ssleay32.dll
-      ${ARCH_PREBUILT_DIRS_RELEASE}/imageformats/qgif4.dll
-      ${ARCH_PREBUILT_DIRS_RELEASE}/imageformats/qico4.dll
-      ${ARCH_PREBUILT_DIRS_RELEASE}/imageformats/qjpeg4.dll
-      ${ARCH_PREBUILT_DIRS_RELEASE}/imageformats/qmng4.dll
-      ${ARCH_PREBUILT_DIRS_RELEASE}/imageformats/qsvg4.dll
-      ${ARCH_PREBUILT_DIRS_RELEASE}/imageformats/qtiff4.dll
-      ${ARCH_PREBUILT_DIRS_RELEASE}/codecs/qcncodecs4.dll
-      ${ARCH_PREBUILT_DIRS_RELEASE}/codecs/qjpcodecs4.dll
-      ${ARCH_PREBUILT_DIRS_RELEASE}/codecs/qkrcodecs4.dll
-      ${ARCH_PREBUILT_DIRS_RELEASE}/codecs/qtwcodecs4.dll
       ${ARCH_PREBUILT_DIRS_DEBUG}/libeay32.dll
-      ${ARCH_PREBUILT_DIRS_DEBUG}/qtcored4.dll
-      ${ARCH_PREBUILT_DIRS_DEBUG}/qtguid4.dll
-      ${ARCH_PREBUILT_DIRS_DEBUG}/qtnetworkd4.dll
-      ${ARCH_PREBUILT_DIRS_DEBUG}/qtopengld4.dll
-      ${ARCH_PREBUILT_DIRS_DEBUG}/qtxmlpatternsd4.dll
       ${ARCH_PREBUILT_DIRS_DEBUG}/ssleay32.dll
-      ${ARCH_PREBUILT_DIRS_DEBUG}/imageformats/qgifd4.dll
-      ${ARCH_PREBUILT_DIRS_DEBUG}/imageformats/qicod4.dll
-      ${ARCH_PREBUILT_DIRS_DEBUG}/imageformats/qjpegd4.dll
-      ${ARCH_PREBUILT_DIRS_DEBUG}/imageformats/qmngd4.dll
-      ${ARCH_PREBUILT_DIRS_DEBUG}/imageformats/qsvgd4.dll
-      ${ARCH_PREBUILT_DIRS_DEBUG}/imageformats/qtiffd4.dll
-      ${ARCH_PREBUILT_DIRS_RELEASE}/codecs/qcncodecsd4.dll
-      ${ARCH_PREBUILT_DIRS_RELEASE}/codecs/qjpcodecsd4.dll
-      ${ARCH_PREBUILT_DIRS_RELEASE}/codecs/qkrcodecsd4.dll
-      ${ARCH_PREBUILT_DIRS_RELEASE}/codecs/qtwcodecsd4.dll
       SLPlugin
       media_plugin_quicktime
       media_plugin_cef
diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index 15ec946e63..9a65171d44 100755
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -1216,36 +1216,6 @@ class Linux_i686_Manifest(LinuxManifest):
                 self.path("libvivoxplatform.so")
                 self.end_prefix("lib")
 
-            # plugin runtime
-            if self.prefix(src=os.path.join(pkgdir, "lib"), dst="lib"):
-                self.path("libQtCore.so*")
-                self.path("libQtGui.so*")
-                self.path("libQtNetwork.so*")
-                self.path("libQtOpenGL.so*")
-                self.path("libQtSvg.so*")
-                self.path("libQtXml.so*")
-                self.end_prefix("lib")
-
-            # For WebKit/Qt plugin runtimes (image format plugins)
-            if self.prefix(src=os.path.join(pkgdir, "llplugin", "imageformats"),
-                           dst="bin/llplugin/imageformats"):
-                self.path("libqgif.so")
-                self.path("libqico.so")
-                self.path("libqjpeg.so")
-                self.path("libqmng.so")
-                self.path("libqsvg.so")
-                self.path("libqtiff.so")
-                self.end_prefix("bin/llplugin/imageformats")
-
-            # For WebKit/Qt plugin runtimes (codec/character encoding plugins)
-            if self.prefix(src=os.path.join(pkgdir, "llplugin", "codecs"),
-                           dst="bin/llplugin/codecs"):
-                self.path("libqcncodecs.so")
-                self.path("libqjpcodecs.so")
-                self.path("libqkrcodecs.so")
-                self.path("libqtwcodecs.so")
-                self.end_prefix("bin/llplugin/codecs")
-
             self.strip_binaries()
 
 
-- 
cgit v1.2.3


From 2a899b49dd5d0a4ff4b4ab2e36bda48ff1473f0a Mon Sep 17 00:00:00 2001
From: callum_linden <none@none>
Date: Mon, 19 Oct 2015 18:43:48 -0700
Subject: MAINT-5711 FIX profiles and marketplace are asking for a login each
 session

---
 indra/newview/llviewermedia.cpp | 41 +++++++++++++++++++++++++++++++++++++++++
 indra/newview/llviewermedia.h   |  1 +
 2 files changed, 42 insertions(+)

(limited to 'indra/newview')

diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 5eab0a15ab..3342fddade 100755
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -66,6 +66,7 @@
 #include "llvoavatar.h"
 #include "llvoavatarself.h"
 #include "llvovolume.h"
+#include "llfloaterreg.h"
 #include "llwebprofile.h"
 #include "llwindow.h"
 #include "llvieweraudio.h"
@@ -1388,6 +1389,28 @@ LLSD LLViewerMedia::getHeaders()
 	return headers;
 }
 
+ /////////////////////////////////////////////////////////////////////////////////////////
+ // static
+bool LLViewerMedia::parseRawCookie(const std::string raw_cookie, std::string& name, std::string& value, std::string& path)
+{
+	std::size_t name_pos = raw_cookie.find_first_of("=");
+	if (name_pos != std::string::npos)
+	{
+		name = raw_cookie.substr(0, name_pos);
+		std::size_t value_pos = raw_cookie.find_first_of(";", name_pos);
+		if (value_pos != std::string::npos)
+		{
+			value = raw_cookie.substr(name_pos + 1, value_pos - name_pos - 1);
+			path = "/";	// assume root path for now
+
+			return true;
+		}
+	}
+
+	return false;
+}
+
+
 /////////////////////////////////////////////////////////////////////////////////////////
 // static
 void LLViewerMedia::setOpenIDCookie()
@@ -1419,6 +1442,24 @@ void LLViewerMedia::setOpenIDCookie()
 		
 		getCookieStore()->setCookiesFromHost(sOpenIDCookie, authority.substr(host_start, host_end - host_start));
 
+		LLMediaCtrl* media_instance = LLFloaterReg::getInstance("destinations")->getChild<LLMediaCtrl>("destination_guide_contents");
+		if (media_instance)
+		{
+			std::string cookie_host = authority.substr(host_start, host_end - host_start);
+			std::string cookie_name = "";
+			std::string cookie_value = "";
+			std::string cookie_path = "";
+			if (parseRawCookie(sOpenIDCookie, cookie_name, cookie_value, cookie_path))
+			{
+				std::string url = "http://id.secondlife.com/openid/webkit";
+				media_instance->getMediaPlugin()->setCookie(url, cookie_name, cookie_value, cookie_host, cookie_path);
+			}
+		};
+
+		// NOTE: this is the original OpenID cookie code, so of which is no longer needed now that we
+		// are using CEF - it's very intertwined with other code so, for the moment, I'm going to 
+		// leave it alone and make a task to come back to it once we're sure the CEF cookie code is robust.
+
 		// Do a web profile get so we can store the cookie 
 		LLSD headers = LLSD::emptyMap();
 		headers[HTTP_OUT_HEADER_ACCEPT] = "*/*";
diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h
index f2da30e10b..0101c85e79 100755
--- a/indra/newview/llviewermedia.h
+++ b/indra/newview/llviewermedia.h
@@ -163,6 +163,7 @@ public:
 	static LLSD getHeaders();
 	
 private:
+	static bool parseRawCookie(const std::string raw_cookie, std::string& name, std::string& value, std::string& path);
 	static void setOpenIDCookie();
 	static void onTeleportFinished();
 	
-- 
cgit v1.2.3


From c16e726d0e2a8c607ce441eb5bf2419b16b41cab Mon Sep 17 00:00:00 2001
From: callum_linden <none@none>
Date: Tue, 20 Oct 2015 14:44:36 -0700
Subject: MAINT-5711 FIX2 auto login for profiles - final part retrieves the
 URL to set cookie for from the message sent over by login.cgi

---
 indra/newview/llviewermedia.cpp | 43 +++++++++++++++++++++++------------------
 indra/newview/llviewermedia.h   |  4 ++--
 2 files changed, 26 insertions(+), 21 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 3342fddade..1098b2a7e1 100755
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -285,13 +285,16 @@ public:
 		const LLChannelDescriptors& channels,
 		const LLIOPipe::buffer_ptr_t& buffer)
 	{
+		const std::string url = getURL();
+		llinfos << "@@@ URL to set cookie on" << url << llendl;
+
 		// We don't care about the content of the response, only the Set-Cookie header.
-		LL_DEBUGS("MediaAuth") << dumpResponse() 
-				<< " [headers:" << getResponseHeaders() << "]" << LL_ENDL;
+		llinfos << dumpResponse() 
+				<< " [headers:" << getResponseHeaders() << "]" << llendl;
 		const std::string& cookie = getResponseHeader(HTTP_IN_HEADER_SET_COOKIE);
 		
 		// *TODO: What about bad status codes?  Does this destroy previous cookies?
-		LLViewerMedia::openIDCookieResponse(cookie);
+		LLViewerMedia::openIDCookieResponse(url, cookie);
 	}
 
 };
@@ -1200,7 +1203,7 @@ void LLViewerMedia::clearAllCookies()
 	}
 	
 	// If we have an OpenID cookie, re-add it to the cookie store.
-	setOpenIDCookie();
+	setOpenIDCookie(std::string());
 }
 	
 /////////////////////////////////////////////////////////////////////////////////////////
@@ -1303,7 +1306,7 @@ void LLViewerMedia::loadCookieFile()
 	}
 	
 	// If we have an OpenID cookie, re-add it to the cookie store.
-	setOpenIDCookie();
+	setOpenIDCookie(std::string());
 }
 
 
@@ -1413,7 +1416,7 @@ bool LLViewerMedia::parseRawCookie(const std::string raw_cookie, std::string& na
 
 /////////////////////////////////////////////////////////////////////////////////////////
 // static
-void LLViewerMedia::setOpenIDCookie()
+void LLViewerMedia::setOpenIDCookie(const std::string& url)
 {
 	if(!sOpenIDCookie.empty())
 	{
@@ -1442,19 +1445,21 @@ void LLViewerMedia::setOpenIDCookie()
 		
 		getCookieStore()->setCookiesFromHost(sOpenIDCookie, authority.substr(host_start, host_end - host_start));
 
-		LLMediaCtrl* media_instance = LLFloaterReg::getInstance("destinations")->getChild<LLMediaCtrl>("destination_guide_contents");
-		if (media_instance)
-		{
-			std::string cookie_host = authority.substr(host_start, host_end - host_start);
-			std::string cookie_name = "";
-			std::string cookie_value = "";
-			std::string cookie_path = "";
-			if (parseRawCookie(sOpenIDCookie, cookie_name, cookie_value, cookie_path))
+		if (url.length())
+		{
+			LLMediaCtrl* media_instance = LLFloaterReg::getInstance("destinations")->getChild<LLMediaCtrl>("destination_guide_contents");
+			if (media_instance)
 			{
-				std::string url = "http://id.secondlife.com/openid/webkit";
-				media_instance->getMediaPlugin()->setCookie(url, cookie_name, cookie_value, cookie_host, cookie_path);
+				std::string cookie_host = authority.substr(host_start, host_end - host_start);
+				std::string cookie_name = "";
+				std::string cookie_value = "";
+				std::string cookie_path = "";
+				if (parseRawCookie(sOpenIDCookie, cookie_name, cookie_value, cookie_path))
+				{
+					media_instance->getMediaPlugin()->setCookie(url, cookie_name, cookie_value, cookie_host, cookie_path);
+				}
 			}
-		};
+		}
 
 		// NOTE: this is the original OpenID cookie code, so of which is no longer needed now that we
 		// are using CEF - it's very intertwined with other code so, for the moment, I'm going to 
@@ -1514,13 +1519,13 @@ void LLViewerMedia::openIDSetup(const std::string &openid_url, const std::string
 
 /////////////////////////////////////////////////////////////////////////////////////////
 // static
-void LLViewerMedia::openIDCookieResponse(const std::string &cookie)
+void LLViewerMedia::openIDCookieResponse(const std::string& url, const std::string &cookie)
 {
 	LL_DEBUGS("MediaAuth") << "Cookie received: \"" << cookie << "\"" << LL_ENDL;
 	
 	sOpenIDCookie += cookie;
 
-	setOpenIDCookie();
+	setOpenIDCookie(url);
 }
 
 /////////////////////////////////////////////////////////////////////////////////////////
diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h
index 0101c85e79..45d211f232 100755
--- a/indra/newview/llviewermedia.h
+++ b/indra/newview/llviewermedia.h
@@ -150,7 +150,7 @@ public:
 	static void removeCookie(const std::string &name, const std::string &domain, const std::string &path = std::string("/") );
 
 	static void openIDSetup(const std::string &openid_url, const std::string &openid_token);
-	static void openIDCookieResponse(const std::string &cookie);
+	static void openIDCookieResponse(const std::string& url, const std::string &cookie);
 	
 	static void proxyWindowOpened(const std::string &target, const std::string &uuid);
 	static void proxyWindowClosed(const std::string &uuid);
@@ -164,7 +164,7 @@ public:
 	
 private:
 	static bool parseRawCookie(const std::string raw_cookie, std::string& name, std::string& value, std::string& path);
-	static void setOpenIDCookie();
+	static void setOpenIDCookie(const std::string& url);
 	static void onTeleportFinished();
 	
 	static LLPluginCookieStore *sCookieStore;
-- 
cgit v1.2.3


From 8c74ed2a58f5443b931374489b04ba80fb11a590 Mon Sep 17 00:00:00 2001
From: callum_linden <none@none>
Date: Wed, 21 Oct 2015 09:05:19 -0700
Subject: Fix windows line endings

---
 indra/newview/llviewermedia.cpp | 624 ++++++++++++++++++++--------------------
 1 file changed, 312 insertions(+), 312 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 1098b2a7e1..49d6c1021e 100755
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -5,21 +5,21 @@
  * $LicenseInfo:firstyear=2007&license=viewerlgpl$
  * Second Life Viewer Source Code
  * Copyright (C) 2010, Linden Research, Inc.
- * 
+ *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation;
  * version 2.1 of the License only.
- * 
+ *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
+ *
  * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
  * $/LicenseInfo$
  */
@@ -168,7 +168,7 @@ public:
 		{
 			LL_ERRS() << "impl already has an outstanding responder" << LL_ENDL;
 		}
-		
+
 		mMediaImpl->mMimeTypeProbe = this;
 	}
 
@@ -190,19 +190,19 @@ private:
 		std::string mime_type = media_type.substr(0, idx1);
 
 		LL_DEBUGS() << "status is " << getStatus() << ", media type \"" << media_type << "\"" << LL_ENDL;
-		
+
 		// 2xx status codes indicate success.
 		// Most 4xx status codes are successful enough for our purposes.
 		// 499 is the error code for host not found, timeout, etc.
-		// 500 means "Internal Server error" but we decided it's okay to 
+		// 500 means "Internal Server error" but we decided it's okay to
 		//     accept this and go past it in the MIME type probe
 		// 302 means the resource can be found temporarily in a different place - added this for join.secondlife.com
 		// 499 is a code specifc to join.secondlife.com apparently safe to ignore
 //		if(	((status >= 200) && (status < 300))	||
-//			((status >= 400) && (status < 499))	|| 
+//			((status >= 400) && (status < 499))	||
 //			(status == 500) ||
 //			(status == 302) ||
-//			(status == 499) 
+//			(status == 499)
 //			)
 		// We now no longer check the error code returned from the probe.
 		// If we have a mime type, use it.  If not, default to the web plugin and let it handle error reporting.
@@ -230,7 +230,7 @@ private:
 		// the call to initializeMedia may disconnect the responder, which will clear mMediaImpl.
 		// Make a local copy so we can call loadURI() afterwards.
 		LLViewerMediaImpl *impl = mMediaImpl;
-		
+
 		if(impl && !mInitialized && ! mime_type.empty())
 		{
 			if(impl->initializeMedia(mime_type))
@@ -241,13 +241,13 @@ private:
 			}
 		}
 	}
-	
+
 public:
 	void cancelRequest()
 	{
 		disconnectOwner();
 	}
-	
+
 private:
 	void disconnectOwner()
 	{
@@ -262,8 +262,8 @@ private:
 		}
 		mMediaImpl = NULL;
 	}
-	
-	
+
+
 public:
 		LLViewerMediaImpl *mMediaImpl;
 		bool mInitialized;
@@ -289,10 +289,10 @@ public:
 		llinfos << "@@@ URL to set cookie on" << url << llendl;
 
 		// We don't care about the content of the response, only the Set-Cookie header.
-		llinfos << dumpResponse() 
+		llinfos << dumpResponse()
 				<< " [headers:" << getResponseHeaders() << "]" << llendl;
 		const std::string& cookie = getResponseHeader(HTTP_IN_HEADER_SET_COOKIE);
-		
+
 		// *TODO: What about bad status codes?  Does this destroy previous cookies?
 		LLViewerMedia::openIDCookieResponse(url, cookie);
 	}
@@ -317,7 +317,7 @@ public:
 		const LLIOPipe::buffer_ptr_t& buffer)
 	{
 		// We don't care about the content of the response, only the set-cookie header.
-		LL_WARNS("MediaAuth") << dumpResponse() 
+		LL_WARNS("MediaAuth") << dumpResponse()
 				<< " [headers:" << getResponseHeaders() << "]" << LL_ENDL;
 
 		LLSD stripped_content = getResponseHeaders();
@@ -368,7 +368,7 @@ static void remove_media_impl(LLViewerMediaImpl* media)
 {
 	LLViewerMedia::impl_list::iterator iter = sViewerMediaImplList.begin();
 	LLViewerMedia::impl_list::iterator end = sViewerMediaImplList.end();
-	
+
 	for(; iter != end; iter++)
 	{
 		if(media == *iter)
@@ -395,8 +395,8 @@ static bool sViewerMediaMuteListObserverInitialized = false;
 // static
 viewer_media_t LLViewerMedia::newMediaImpl(
 											 const LLUUID& texture_id,
-											 S32 media_width, 
-											 S32 media_height, 
+											 S32 media_width,
+											 S32 media_height,
 											 U8 media_auto_scale,
 											 U8 media_loop)
 {
@@ -420,24 +420,24 @@ viewer_media_t LLViewerMedia::newMediaImpl(
 }
 
 viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const std::string& previous_url, bool update_from_self)
-{	
+{
 	// Try to find media with the same media ID
 	viewer_media_t media_impl = getMediaImplFromTextureID(media_entry->getMediaID());
-	
-	LL_DEBUGS() << "called, current URL is \"" << media_entry->getCurrentURL() 
-			<< "\", previous URL is \"" << previous_url 
+
+	LL_DEBUGS() << "called, current URL is \"" << media_entry->getCurrentURL()
+			<< "\", previous URL is \"" << previous_url
 			<< "\", update_from_self is " << (update_from_self?"true":"false")
 			<< LL_ENDL;
-			
+
 	bool was_loaded = false;
 	bool needs_navigate = false;
-	
+
 	if(media_impl)
-	{	
+	{
 		was_loaded = media_impl->hasMedia();
-		
+
 		media_impl->setHomeURL(media_entry->getHomeURL());
-		
+
 		media_impl->mMediaAutoScale = media_entry->getAutoScale();
 		media_impl->mMediaLoop = media_entry->getAutoLoop();
 		media_impl->mMediaWidth = media_entry->getWidthPixels();
@@ -450,7 +450,7 @@ viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const s
 			media_impl->mMediaSource->setLoop(media_impl->mMediaLoop);
 			media_impl->mMediaSource->setSize(media_entry->getWidthPixels(), media_entry->getHeightPixels());
 		}
-		
+
 		bool url_changed = (media_impl->mMediaEntryURL != previous_url);
 		if(media_impl->mMediaEntryURL.empty())
 		{
@@ -458,7 +458,7 @@ viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const s
 			{
 				// The current media URL is now empty.  Unload the media source.
 				media_impl->unload();
-			
+
 				LL_DEBUGS() << "Unloading media instance (new current URL is empty)." << LL_ENDL;
 			}
 		}
@@ -467,26 +467,26 @@ viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const s
 			// The current media URL is not empty.
 			// If (the media was already loaded OR the media was set to autoplay) AND this update didn't come from this agent,
 			// do a navigate.
-			bool auto_play = media_impl->isAutoPlayable();			
+			bool auto_play = media_impl->isAutoPlayable();
 			if((was_loaded || auto_play) && !update_from_self)
 			{
 				needs_navigate = url_changed;
 			}
-			
-			LL_DEBUGS() << "was_loaded is " << (was_loaded?"true":"false") 
-					<< ", auto_play is " << (auto_play?"true":"false") 
+
+			LL_DEBUGS() << "was_loaded is " << (was_loaded?"true":"false")
+					<< ", auto_play is " << (auto_play?"true":"false")
 					<< ", needs_navigate is " << (needs_navigate?"true":"false") << LL_ENDL;
 		}
 	}
 	else
 	{
 		media_impl = newMediaImpl(
-			media_entry->getMediaID(), 
+			media_entry->getMediaID(),
 			media_entry->getWidthPixels(),
-			media_entry->getHeightPixels(), 
-			media_entry->getAutoScale(), 
+			media_entry->getHeightPixels(),
+			media_entry->getAutoScale(),
 			media_entry->getAutoLoop());
-		
+
 		media_impl->setHomeURL(media_entry->getHomeURL());
 		media_impl->mMediaAutoPlay = media_entry->getAutoPlay();
 		media_impl->mMediaEntryURL = media_entry->getCurrentURL();
@@ -495,7 +495,7 @@ viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const s
 			needs_navigate = true;
 		}
 	}
-	
+
 	if(media_impl)
 	{
 		if(needs_navigate)
@@ -514,7 +514,7 @@ viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const s
 			LL_DEBUGS() << "updating URL in the media impl to " << media_impl->mMediaEntryURL << LL_ENDL;
 		}
 	}
-	
+
 	return media_impl;
 }
 
@@ -523,7 +523,7 @@ viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const s
 LLViewerMediaImpl* LLViewerMedia::getMediaImplFromTextureID(const LLUUID& texture_id)
 {
 	LLViewerMediaImpl* result = NULL;
-	
+
 	// Look up the texture ID in the texture id->impl map.
 	impl_id_map::iterator iter = sViewerMediaTextureIDMap.find(texture_id);
 	if(iter != sViewerMediaTextureIDMap.end())
@@ -538,7 +538,7 @@ LLViewerMediaImpl* LLViewerMedia::getMediaImplFromTextureID(const LLUUID& textur
 // static
 std::string LLViewerMedia::getCurrentUserAgent()
 {
-	// Don't use user-visible string to avoid 
+	// Don't use user-visible string to avoid
 	// punctuation and strange characters.
 	std::string skin_name = gSavedSettings.getString("SkinCurrent");
 
@@ -557,7 +557,7 @@ std::string LLViewerMedia::getCurrentUserAgent()
 	codec << LLVersionInfo::getVersion();
 	codec << " (" << channel << "; " << skin_name << " skin)";
 	LL_INFOS() << codec.str() << LL_ENDL;
-	
+
 	return codec.str();
 }
 
@@ -566,7 +566,7 @@ std::string LLViewerMedia::getCurrentUserAgent()
 void LLViewerMedia::updateBrowserUserAgent()
 {
 	std::string user_agent = getCurrentUserAgent();
-	
+
 	impl_list::iterator iter = sViewerMediaImplList.begin();
 	impl_list::iterator end = sViewerMediaImplList.end();
 
@@ -655,7 +655,7 @@ void LLViewerMedia::muteListChanged()
 bool LLViewerMedia::isInterestingEnough(const LLVOVolume *object, const F64 &object_interest)
 {
 	bool result = false;
-	
+
 	if (NULL == object)
 	{
 		result = false;
@@ -671,13 +671,13 @@ bool LLViewerMedia::isInterestingEnough(const LLVOVolume *object, const F64 &obj
 	{
 		result = true;
 	}
-	else 
+	else
 	{
 		LL_DEBUGS() << "object interest = " << object_interest << ", lowest loadable = " << sLowestLoadableImplInterest << LL_ENDL;
 		if(object_interest >= sLowestLoadableImplInterest)
 			result = true;
 	}
-	
+
 	return result;
 }
 
@@ -784,13 +784,13 @@ static LLTrace::BlockTimerStatHandle FTM_MEDIA_MISC("Misc");
 void LLViewerMedia::updateMedia(void *dummy_arg)
 {
 	LL_RECORD_BLOCK_TIME(FTM_MEDIA_UPDATE);
-	
+
 	// Enable/disable the plugin read thread
 	LLPluginProcessParent::setUseReadThread(gSavedSettings.getBOOL("PluginUseReadThread"));
-	
+
 	// HACK: we always try to keep a spare running webkit plugin around to improve launch times.
 	createSpareBrowserMediaSource();
-	
+
 	sAnyMediaShowing = false;
 	sUpdatedCookies = getCookieStore()->getChangedCookies();
 	if(!sUpdatedCookies.empty())
@@ -798,7 +798,7 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
 		LL_DEBUGS() << "updated cookies will be sent to all loaded plugins: " << LL_ENDL;
 		LL_DEBUGS() << sUpdatedCookies << LL_ENDL;
 	}
-	
+
 	impl_list::iterator iter = sViewerMediaImplList.begin();
 	impl_list::iterator end = sViewerMediaImplList.end();
 
@@ -811,14 +811,14 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
 			pimpl->calculateInterest();
 		}
 	}
-	
+
 	// Let the spare media source actually launch
 	if(sSpareBrowserMediaSource)
 	{
 		LL_RECORD_BLOCK_TIME(FTM_MEDIA_SPARE_IDLE);
 		sSpareBrowserMediaSource->idle();
 	}
-		
+
 	{
 		LL_RECORD_BLOCK_TIME(FTM_MEDIA_SORT);
 		// Sort the static instance list using our interest criteria
@@ -828,14 +828,14 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
 	// Go through the list again and adjust according to priority.
 	iter = sViewerMediaImplList.begin();
 	end = sViewerMediaImplList.end();
-	
+
 	F64 total_cpu = 0.0f;
 	int impl_count_total = 0;
 	int impl_count_interest_low = 0;
 	int impl_count_interest_normal = 0;
-	
+
 	std::vector<LLViewerMediaImpl*> proximity_order;
-	
+
 	bool inworld_media_enabled = gSavedSettings.getBOOL("AudioStreamingMedia");
 	bool inworld_audio_enabled = gSavedSettings.getBOOL("AudioStreamingMusic");
 	U32 max_instances = gSavedSettings.getU32("PluginInstancesTotal");
@@ -844,19 +844,19 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
 	F32 max_cpu = gSavedSettings.getF32("PluginInstancesCPULimit");
 	// Setting max_cpu to 0.0 disables CPU usage checking.
 	bool check_cpu_usage = (max_cpu != 0.0f);
-	
+
 	LLViewerMediaImpl* lowest_interest_loadable = NULL;
-	
+
 	// Notes on tweakable params:
 	// max_instances must be set high enough to allow the various instances used in the UI (for the help browser, search, etc.) to be loaded.
 	// If max_normal + max_low is less than max_instances, things will tend to get unloaded instead of being set to slideshow.
-	
+
 	{
 		LL_RECORD_BLOCK_TIME(FTM_MEDIA_MISC);
 		for(; iter != end; iter++)
 		{
 			LLViewerMediaImpl* pimpl = *iter;
-		
+
 			LLPluginClassMedia::EPriority new_priority = LLPluginClassMedia::PRIORITY_NORMAL;
 
 			if(pimpl->isForcedUnloaded() || (impl_count_total >= (int)max_instances))
@@ -887,7 +887,7 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
 			else
 			{
 				// Look at interest and CPU usage for instances that aren't in any of the above states.
-			
+
 				// Heuristic -- if the media texture's approximate screen area is less than 1/4 of the native area of the texture,
 				// turn it down to low instead of normal.  This may downsample for plugins that support it.
 				bool media_is_small = false;
@@ -901,7 +901,7 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
 				{
 					media_is_small = true;
 				}
-			
+
 				if(pimpl->getInterest() == 0.0f)
 				{
 					// This media is completely invisible, due to being outside the view frustrum or out of range.
@@ -923,11 +923,11 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
 					// The next max_low inworld get turned down
 					new_priority = LLPluginClassMedia::PRIORITY_LOW;
 					impl_count_interest_low++;
-				
+
 					// Set the low priority size for downsampling to approximately the size the texture is displayed at.
 					{
 						F32 approximate_interest_dimension = (F32) sqrt(pimpl->getInterest());
-					
+
 						pimpl->setLowPrioritySizeLimit(ll_round(approximate_interest_dimension));
 					}
 				}
@@ -937,18 +937,18 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
 					new_priority = LLPluginClassMedia::PRIORITY_SLIDESHOW;
 				}
 			}
-		
+
 			if(!pimpl->getUsedInUI() && (new_priority != LLPluginClassMedia::PRIORITY_UNLOADED))
 			{
 				// This is a loadable inworld impl -- the last one in the list in this class defines the lowest loadable interest.
 				lowest_interest_loadable = pimpl;
-			
+
 				impl_count_total++;
 			}
 
 			// Overrides if the window is minimized or we lost focus (taking care
 			// not to accidentally "raise" the priority either)
-			if (!gViewerWindow->getActive() /* viewer window minimized? */ 
+			if (!gViewerWindow->getActive() /* viewer window minimized? */
 				&& new_priority > LLPluginClassMedia::PRIORITY_HIDDEN)
 			{
 				new_priority = LLPluginClassMedia::PRIORITY_HIDDEN;
@@ -958,7 +958,7 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
 			{
 				new_priority = LLPluginClassMedia::PRIORITY_LOW;
 			}
-		
+
 			if(!inworld_media_enabled)
 			{
 				// If inworld media is locked out, force all inworld media to stay unloaded.
@@ -976,7 +976,7 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
 				}
 			}
 			pimpl->setPriority(new_priority);
-		
+
 			if(pimpl->getUsedInUI())
 			{
 				// Any impls used in the UI should not be in the proximity list.
@@ -988,7 +988,7 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
 			}
 
 			total_cpu += pimpl->getCPUUsage();
-		
+
 			if (!pimpl->getUsedInUI() && pimpl->hasMedia())
 			{
 				sAnyMediaShowing = true;
@@ -1012,7 +1012,7 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
 			sLowestLoadableImplInterest = object->getPixelArea();
 		}
 	}
-	
+
 	if(gSavedSettings.getBOOL("MediaPerformanceManagerDebug"))
 	{
 		// Give impls the same ordering as the priority list
@@ -1021,7 +1021,7 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
 	else
 	{
 		LL_RECORD_BLOCK_TIME(FTM_MEDIA_SORT2);
-		// Use a distance-based sort for proximity values.  
+		// Use a distance-based sort for proximity values.
 		std::stable_sort(proximity_order.begin(), proximity_order.end(), proximity_comparitor);
 	}
 
@@ -1030,7 +1030,7 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
 	{
 		proximity_order[i]->mProximity = i;
 	}
-	
+
 	LL_DEBUGS("PluginPriority") << "Total reported CPU usage is " << total_cpu << LL_ENDL;
 
 }
@@ -1049,11 +1049,11 @@ void LLViewerMedia::setAllMediaEnabled(bool val)
 	// Set "tentative" autoplay first.  We need to do this here or else
 	// re-enabling won't start up the media below.
 	gSavedSettings.setBOOL("MediaTentativeAutoPlay", val);
-	
-	// Then 
+
+	// Then
 	impl_list::iterator iter = sViewerMediaImplList.begin();
 	impl_list::iterator end = sViewerMediaImplList.end();
-	
+
 	for(; iter != end; iter++)
 	{
 		LLViewerMediaImpl* pimpl = *iter;
@@ -1062,18 +1062,18 @@ void LLViewerMedia::setAllMediaEnabled(bool val)
 			pimpl->setDisabled(!val);
 		}
 	}
-	
+
 	// Also do Parcel Media and Parcel Audio
 	if (val)
 	{
 		if (!LLViewerMedia::isParcelMediaPlaying() && LLViewerMedia::hasParcelMedia())
-		{	
+		{
 			LLViewerParcelMedia::play(LLViewerParcelMgr::getInstance()->getAgentParcel());
 		}
-		
+
 		if (gSavedSettings.getBOOL("AudioStreamingMusic") &&
 			!LLViewerMedia::isParcelAudioPlaying() &&
-			gAudiop && 
+			gAudiop &&
 			LLViewerMedia::hasParcelAudio())
 		{
 			if (LLAudioEngine::AUDIO_PAUSED == gAudiop->isInternetStreamPlaying())
@@ -1146,26 +1146,26 @@ void LLViewerMedia::clearAllCookies()
 			pimpl->mMediaSource->clear_cookies();
 		}
 	}
-	
+
 	// Clear all cookies from the cookie store
 	getCookieStore()->setAllCookies("");
 
 	// FIXME: this may not be sufficient, since the on-disk cookie file won't get written until some browser instance exits cleanly.
 	// It also won't clear cookies for other accounts, or for any account if we're not logged in, and won't do anything at all if there are no webkit plugins loaded.
 	// Until such time as we can centralize cookie storage, the following hack should cover these cases:
-	
+
 	// HACK: Look for cookie files in all possible places and delete them.
 	// NOTE: this assumes knowledge of what happens inside the webkit plugin (it's what adds 'browser_profile' to the path and names the cookie file)
-	
+
 	// Places that cookie files can be:
 	// <getOSUserAppDir>/browser_profile/cookies
 	// <getOSUserAppDir>/first_last/browser_profile/cookies  (note that there may be any number of these!)
 	// <getOSUserAppDir>/first_last/plugin_cookies.txt  (note that there may be any number of these!)
-	
+
 	std::string base_dir = gDirUtilp->getOSUserAppDir() + gDirUtilp->getDirDelimiter();
 	std::string target;
 	std::string filename;
-	
+
 	LL_DEBUGS() << "base dir = " << base_dir << LL_ENDL;
 
 	// The non-logged-in version is easy
@@ -1178,7 +1178,7 @@ void LLViewerMedia::clearAllCookies()
 	{
 		LLFile::remove(target);
 	}
-	
+
 	// the hard part: iterate over all user directories and delete the cookie file from each one
 	LLDirIterator dir_iter(base_dir, "*_*");
 	while (dir_iter.next(filename))
@@ -1188,26 +1188,26 @@ void LLViewerMedia::clearAllCookies()
 		gDirUtilp->append(target, "cookies");
 		LL_DEBUGS() << "target = " << target << LL_ENDL;
 		if(LLFile::isfile(target))
-		{	
+		{
 			LLFile::remove(target);
 		}
-		
+
 		// Other accounts may have new-style cookie files too -- delete them as well
 		target = gDirUtilp->add(base_dir, filename);
 		gDirUtilp->append(target, PLUGIN_COOKIE_FILE_NAME);
 		LL_DEBUGS() << "target = " << target << LL_ENDL;
 		if(LLFile::isfile(target))
-		{	
+		{
 			LLFile::remove(target);
 		}
 	}
-	
+
 	// If we have an OpenID cookie, re-add it to the cookie store.
 	setOpenIDCookie(std::string());
 }
-	
+
 /////////////////////////////////////////////////////////////////////////////////////////
-// static 
+// static
 void LLViewerMedia::clearAllCaches()
 {
 	// Clear all plugins' caches
@@ -1219,9 +1219,9 @@ void LLViewerMedia::clearAllCaches()
 		pimpl->clearCache();
 	}
 }
-	
+
 /////////////////////////////////////////////////////////////////////////////////////////
-// static 
+// static
 void LLViewerMedia::setCookiesEnabled(bool enabled)
 {
 	// Set the "cookies enabled" flag for all loaded plugins
@@ -1236,9 +1236,9 @@ void LLViewerMedia::setCookiesEnabled(bool enabled)
 		}
 	}
 }
-	
+
 /////////////////////////////////////////////////////////////////////////////////////////
-// static 
+// static
 void LLViewerMedia::setProxyConfig(bool enable, const std::string &host, int port)
 {
 	// Set the proxy config for all loaded plugins
@@ -1255,7 +1255,7 @@ void LLViewerMedia::setProxyConfig(bool enable, const std::string &host, int por
 }
 
 /////////////////////////////////////////////////////////////////////////////////////////
-// static 
+// static
 /////////////////////////////////////////////////////////////////////////////////////////
 // static
 LLPluginCookieStore *LLViewerMedia::getCookieStore()
@@ -1264,7 +1264,7 @@ LLPluginCookieStore *LLViewerMedia::getCookieStore()
 	{
 		sCookieStore = new LLPluginCookieStore;
 	}
-	
+
 	return sCookieStore;
 }
 
@@ -1280,7 +1280,7 @@ void LLViewerMedia::loadCookieFile()
 		LL_INFOS() << "can't get path to plugin cookie file - probably not logged in yet." << LL_ENDL;
 		return;
 	}
-	
+
 	// open the file for reading
 	llifstream file(resolved_filename.c_str());
 	if (!file.is_open())
@@ -1288,11 +1288,11 @@ void LLViewerMedia::loadCookieFile()
 		LL_WARNS() << "can't load plugin cookies from file \"" << PLUGIN_COOKIE_FILE_NAME << "\"" << LL_ENDL;
 		return;
 	}
-	
+
 	getCookieStore()->readAllCookies(file, true);
 
 	file.close();
-	
+
 	// send the clear_cookies message to all loaded plugins
 	impl_list::iterator iter = sViewerMediaImplList.begin();
 	impl_list::iterator end = sViewerMediaImplList.end();
@@ -1304,7 +1304,7 @@ void LLViewerMedia::loadCookieFile()
 			pimpl->mMediaSource->clear_cookies();
 		}
 	}
-	
+
 	// If we have an OpenID cookie, re-add it to the cookie store.
 	setOpenIDCookie(std::string());
 }
@@ -1341,23 +1341,23 @@ void LLViewerMedia::saveCookieFile()
 void LLViewerMedia::addCookie(const std::string &name, const std::string &value, const std::string &domain, const LLDate &expires, const std::string &path, bool secure)
 {
 	std::stringstream cookie;
-	
+
 	cookie << name << "=" << LLPluginCookieStore::quoteString(value);
-	
+
 	if(expires.notNull())
 	{
 		cookie << "; expires=" << expires.asRFC1123();
 	}
-	
+
 	cookie << "; domain=" << domain;
 
 	cookie << "; path=" << path;
-	
+
 	if(secure)
 	{
 		cookie << "; secure";
 	}
-	
+
 	getCookieStore()->setCookies(cookie.str());
 }
 
@@ -1374,7 +1374,7 @@ void LLViewerMedia::addSessionCookie(const std::string &name, const std::string
 void LLViewerMedia::removeCookie(const std::string &name, const std::string &domain, const std::string &path )
 {
 	// To remove a cookie, add one with the same name, domain, and path that expires in the past.
-	
+
 	addCookie(name, "", domain, LLDate(LLDate::now().secondsSinceEpoch() - 1.0), path);
 }
 
@@ -1392,26 +1392,26 @@ LLSD LLViewerMedia::getHeaders()
 	return headers;
 }
 
- /////////////////////////////////////////////////////////////////////////////////////////
- // static
-bool LLViewerMedia::parseRawCookie(const std::string raw_cookie, std::string& name, std::string& value, std::string& path)
-{
-	std::size_t name_pos = raw_cookie.find_first_of("=");
-	if (name_pos != std::string::npos)
-	{
-		name = raw_cookie.substr(0, name_pos);
-		std::size_t value_pos = raw_cookie.find_first_of(";", name_pos);
-		if (value_pos != std::string::npos)
-		{
-			value = raw_cookie.substr(name_pos + 1, value_pos - name_pos - 1);
-			path = "/";	// assume root path for now
-
-			return true;
-		}
-	}
-
-	return false;
-}
+ /////////////////////////////////////////////////////////////////////////////////////////
+ // static
+bool LLViewerMedia::parseRawCookie(const std::string raw_cookie, std::string& name, std::string& value, std::string& path)
+{
+	std::size_t name_pos = raw_cookie.find_first_of("=");
+	if (name_pos != std::string::npos)
+	{
+		name = raw_cookie.substr(0, name_pos);
+		std::size_t value_pos = raw_cookie.find_first_of(";", name_pos);
+		if (value_pos != std::string::npos)
+		{
+			value = raw_cookie.substr(name_pos + 1, value_pos - name_pos - 1);
+			path = "/";	// assume root path for now
+
+			return true;
+		}
+	}
+
+	return false;
+}
 
 
 /////////////////////////////////////////////////////////////////////////////////////////
@@ -1424,7 +1424,7 @@ void LLViewerMedia::setOpenIDCookie(const std::string& url)
 		// We want just the hostname for the cookie code, but LLURL doesn't seem to have a way to extract that.
 		// We therefore do it here.
 		std::string authority = sOpenIDURL.mAuthority;
-		std::string::size_type host_start = authority.find('@'); 
+		std::string::size_type host_start = authority.find('@');
 		if(host_start == std::string::npos)
 		{
 			// no username/password
@@ -1432,40 +1432,40 @@ void LLViewerMedia::setOpenIDCookie(const std::string& url)
 		}
 		else
 		{
-			// Hostname starts after the @. 
+			// Hostname starts after the @.
 			// (If the hostname part is empty, this may put host_start at the end of the string.  In that case, it will end up passing through an empty hostname, which is correct.)
 			++host_start;
 		}
-		std::string::size_type host_end = authority.rfind(':'); 
+		std::string::size_type host_end = authority.rfind(':');
 		if((host_end == std::string::npos) || (host_end < host_start))
 		{
 			// no port
 			host_end = authority.size();
 		}
-		
+
 		getCookieStore()->setCookiesFromHost(sOpenIDCookie, authority.substr(host_start, host_end - host_start));
 
 		if (url.length())
 		{
-			LLMediaCtrl* media_instance = LLFloaterReg::getInstance("destinations")->getChild<LLMediaCtrl>("destination_guide_contents");
-			if (media_instance)
-			{
-				std::string cookie_host = authority.substr(host_start, host_end - host_start);
-				std::string cookie_name = "";
-				std::string cookie_value = "";
-				std::string cookie_path = "";
-				if (parseRawCookie(sOpenIDCookie, cookie_name, cookie_value, cookie_path))
-				{
-					media_instance->getMediaPlugin()->setCookie(url, cookie_name, cookie_value, cookie_host, cookie_path);
-				}
-			}
-		}
-
-		// NOTE: this is the original OpenID cookie code, so of which is no longer needed now that we
-		// are using CEF - it's very intertwined with other code so, for the moment, I'm going to 
-		// leave it alone and make a task to come back to it once we're sure the CEF cookie code is robust.
-
-		// Do a web profile get so we can store the cookie 
+			LLMediaCtrl* media_instance = LLFloaterReg::getInstance("destinations")->getChild<LLMediaCtrl>("destination_guide_contents");
+			if (media_instance)
+			{
+				std::string cookie_host = authority.substr(host_start, host_end - host_start);
+				std::string cookie_name = "";
+				std::string cookie_value = "";
+				std::string cookie_path = "";
+				if (parseRawCookie(sOpenIDCookie, cookie_name, cookie_value, cookie_path))
+				{
+					media_instance->getMediaPlugin()->setCookie(url, cookie_name, cookie_value, cookie_host, cookie_path);
+				}
+			}
+		}
+
+		// NOTE: this is the original OpenID cookie code, so of which is no longer needed now that we
+		// are using CEF - it's very intertwined with other code so, for the moment, I'm going to
+		// leave it alone and make a task to come back to it once we're sure the CEF cookie code is robust.
+
+		// Do a web profile get so we can store the cookie
 		LLSD headers = LLSD::emptyMap();
 		headers[HTTP_OUT_HEADER_ACCEPT] = "*/*";
 		headers[HTTP_OUT_HEADER_COOKIE] = sOpenIDCookie;
@@ -1476,7 +1476,7 @@ void LLViewerMedia::setOpenIDCookie(const std::string& url)
 
 		LL_DEBUGS("MediaAuth") << "Requesting " << profile_url << LL_ENDL;
 		LL_DEBUGS("MediaAuth") << "sOpenIDCookie = [" << sOpenIDCookie << "]" << LL_ENDL;
-		LLHTTPClient::get(profile_url,  
+		LLHTTPClient::get(profile_url,
 			new LLViewerMediaWebProfileResponder(raw_profile_url.getAuthority()),
 			headers);
 	}
@@ -1488,12 +1488,12 @@ void LLViewerMedia::openIDSetup(const std::string &openid_url, const std::string
 {
 	LL_DEBUGS("MediaAuth") << "url = \"" << openid_url << "\", token = \"" << openid_token << "\"" << LL_ENDL;
 
-	// post the token to the url 
+	// post the token to the url
 	// the responder will need to extract the cookie(s).
 
 	// Save the OpenID URL for later -- we may need the host when adding the cookie.
 	sOpenIDURL.init(openid_url.c_str());
-	
+
 	// We shouldn't ever do this twice, but just in case this code gets repurposed later, clear existing cookies.
 	sOpenIDCookie.clear();
 
@@ -1508,13 +1508,13 @@ void LLViewerMedia::openIDSetup(const std::string &openid_url, const std::string
 	U8 *data = new U8[size];
 	memcpy(data, openid_token.data(), size);
 
-	LLHTTPClient::postRaw( 
-		openid_url, 
-		data, 
-		size, 
+	LLHTTPClient::postRaw(
+		openid_url,
+		data,
+		size,
 		new LLViewerMediaOpenIDResponder(),
 		headers);
-			
+
 }
 
 /////////////////////////////////////////////////////////////////////////////////////////
@@ -1522,7 +1522,7 @@ void LLViewerMedia::openIDSetup(const std::string &openid_url, const std::string
 void LLViewerMedia::openIDCookieResponse(const std::string& url, const std::string &cookie)
 {
 	LL_DEBUGS("MediaAuth") << "Cookie received: \"" << cookie << "\"" << LL_ENDL;
-	
+
 	sOpenIDCookie += cookie;
 
 	setOpenIDCookie(url);
@@ -1534,7 +1534,7 @@ void LLViewerMedia::proxyWindowOpened(const std::string &target, const std::stri
 {
 	if(uuid.empty())
 		return;
-		
+
 	for (impl_list::iterator iter = sViewerMediaImplList.begin(); iter != sViewerMediaImplList.end(); iter++)
 	{
 		if((*iter)->mMediaSource && (*iter)->mMediaSource->pluginSupportsMediaBrowser())
@@ -1571,7 +1571,7 @@ void LLViewerMedia::createSpareBrowserMediaSource()
 	if (!sSpareBrowserMediaSource && !gSavedSettings.getBOOL("PluginAttachDebuggerToPlugins"))
 	{
 		// The null owner will keep the browser plugin from fully initializing
-		// (specifically, it keeps LLPluginClassMedia from negotiating a size change, 
+		// (specifically, it keeps LLPluginClassMedia from negotiating a size change,
 		// which keeps MediaPluginWebkit::initBrowserWindow from doing anything until we have some necessary data, like the background color)
 		sSpareBrowserMediaSource = LLViewerMediaImpl::newSourceFromMediaType(HTTP_CONTENT_TEXT_HTML, NULL, 0, 0);
 	}
@@ -1583,7 +1583,7 @@ LLPluginClassMedia* LLViewerMedia::getSpareBrowserMediaSource()
 {
 	LLPluginClassMedia* result = sSpareBrowserMediaSource;
 	sSpareBrowserMediaSource = NULL;
-	return result; 
+	return result;
 };
 
 bool LLViewerMedia::hasInWorldMedia()
@@ -1672,12 +1672,12 @@ void LLViewerMedia::setOnlyAudibleMediaTextureID(const LLUUID& texture_id)
 //////////////////////////////////////////////////////////////////////////////////////////
 // LLViewerMediaImpl
 //////////////////////////////////////////////////////////////////////////////////////////
-LLViewerMediaImpl::LLViewerMediaImpl(	  const LLUUID& texture_id, 
-										  S32 media_width, 
-										  S32 media_height, 
-										  U8 media_auto_scale, 
+LLViewerMediaImpl::LLViewerMediaImpl(	  const LLUUID& texture_id,
+										  S32 media_width,
+										  S32 media_height,
+										  U8 media_auto_scale,
 										  U8 media_loop)
-:	
+:
 	mMediaSource( NULL ),
 	mMovieImageHasMips(false),
 	mMediaWidth(media_width),
@@ -1718,7 +1718,7 @@ LLViewerMediaImpl::LLViewerMediaImpl(	  const LLUUID& texture_id,
 	mTrustedBrowser(false),
 	mZoomFactor(1.0),
     mCleanBrowser(false)
-{ 
+{
 
 	// Set up the mute list observer if it hasn't been set up already.
 	if(!sViewerMediaMuteListObserverInitialized)
@@ -1726,11 +1726,11 @@ LLViewerMediaImpl::LLViewerMediaImpl(	  const LLUUID& texture_id,
 		LLMuteList::getInstance()->addObserver(&sViewerMediaMuteListObserver);
 		sViewerMediaMuteListObserverInitialized = true;
 	}
-	
+
 	add_media_impl(this);
 
 	setTextureID(texture_id);
-	
+
 	// connect this media_impl to the media texture, creating it if it doesn't exist.0
 	// This is necessary because we need to be able to use getMaxVirtualSize() even if the media plugin is not loaded.
 	LLViewerMediaTexture* media_tex = LLViewerTextureManager::getMediaTexture(mTextureId);
@@ -1745,7 +1745,7 @@ LLViewerMediaImpl::LLViewerMediaImpl(	  const LLUUID& texture_id,
 LLViewerMediaImpl::~LLViewerMediaImpl()
 {
 	destroyMediaSource();
-	
+
 	LLViewerMediaTexture::removeMediaImplFromTexture(mTextureId) ;
 
 	setTextureID();
@@ -1757,7 +1757,7 @@ void LLViewerMediaImpl::emitEvent(LLPluginClassMedia* plugin, LLViewerMediaObser
 {
 	// Broadcast to observers using the superclass version
 	LLViewerMediaEventEmitter::emitEvent(plugin, event);
-	
+
 	// If this media is on one or more LLVOVolume objects, tell them about the event as well.
 	std::list< LLVOVolume* >::iterator iter = mObjectList.begin() ;
 	while(iter != mObjectList.end())
@@ -1773,7 +1773,7 @@ bool LLViewerMediaImpl::initializeMedia(const std::string& mime_type)
 {
 	bool mimeTypeChanged = (mMimeType != mime_type);
 	bool pluginChanged = (LLMIMETypes::implType(mCurrentMimeType) != LLMIMETypes::implType(mime_type));
-	
+
 	if(!mMediaSource || pluginChanged)
 	{
 		// We don't have a plugin at all, or the new mime type is handled by a different plugin than the old mime type.
@@ -1796,7 +1796,7 @@ void LLViewerMediaImpl::createMediaSource()
 		// This media shouldn't be created yet.
 		return;
 	}
-	
+
 	if(! mMediaURL.empty())
 	{
 		navigateInternal();
@@ -1822,15 +1822,15 @@ void LLViewerMediaImpl::destroyMediaSource()
 	{
 		oldImage->setPlaying(FALSE) ;
 	}
-	
+
 	cancelMimeTypeProbe();
-	
+
 	if(mMediaSource)
 	{
 		mMediaSource->setDeleteOK(true) ;
 		delete mMediaSource;
 		mMediaSource = NULL;
-	}	
+	}
 }
 
 //////////////////////////////////////////////////////////////////////////////////////////
@@ -1845,7 +1845,7 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_
 {
 	std::string plugin_basename = LLMIMETypes::implType(media_type);
 	LLPluginClassMedia* media_source = NULL;
-	
+
 	// HACK: we always try to keep a spare running webkit plugin around to improve launch times.
 	// If a spare was already created before PluginAttachDebuggerToPlugins was set, don't use it.
     // Do not use a spare if launching with full viewer control (e.g. Facebook, Twitter and few others)
@@ -1858,7 +1858,7 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_
 			media_source->setOwner(owner);
 			media_source->setTarget(target);
 			media_source->setSize(default_width, default_height);
-						
+
 			return media_source;
 		}
 	}
@@ -1914,7 +1914,7 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_
 			// collect 'javascript enabled' setting from prefs and send to embedded browser
 			bool javascript_enabled = gSavedSettings.getBOOL( "BrowserJavascriptEnabled" );
 			media_source->setJavascriptEnabled( javascript_enabled || clean_browser);
-		
+
 			bool media_plugin_debugging_enabled = gSavedSettings.getBOOL("MediaPluginDebugging");
 			media_source->enableMediaPluginDebugging( media_plugin_debugging_enabled  || clean_browser);
 
@@ -1922,7 +1922,7 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_
 			media_source->setBrowserUserAgent(LLViewerMedia::getCurrentUserAgent());
 
 			media_source->setTarget(target);
-			
+
 			const std::string plugin_dir = gDirUtilp->getLLPluginDir();
 			if (media_source->init(launcher_name, plugin_dir, plugin_name, gSavedSettings.getBOOL("PluginAttachDebuggerToPlugins")))
 			{
@@ -1935,14 +1935,14 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_
 			}
 		}
 	}
-	
+
 	LL_WARNS_ONCE("Plugin") << "plugin initialization failed for mime type: " << media_type << LL_ENDL;
 	LLSD args;
 	args["MIME_TYPE"] = media_type;
 	LLNotificationsUtil::add("NoPlugin", args);
 
 	return NULL;
-}							
+}
 
 //////////////////////////////////////////////////////////////////////////////////////////
 bool LLViewerMediaImpl::initializePlugin(const std::string& media_type)
@@ -1953,10 +1953,10 @@ bool LLViewerMediaImpl::initializePlugin(const std::string& media_type)
 		mMediaWidth = mMediaSource->getSetWidth();
 		mMediaHeight = mMediaSource->getSetHeight();
 	}
-	
+
 	// Always delete the old media impl first.
 	destroyMediaSource();
-	
+
 	// and unconditionally set the mime type
 	mMimeType = media_type;
 
@@ -1964,7 +1964,7 @@ bool LLViewerMediaImpl::initializePlugin(const std::string& media_type)
 	{
 		// This impl should not be loaded at this time.
 		LL_DEBUGS("PluginPriority") << this << "Not loading (PRIORITY_UNLOADED)" << LL_ENDL;
-		
+
 		return false;
 	}
 
@@ -1975,7 +1975,7 @@ bool LLViewerMediaImpl::initializePlugin(const std::string& media_type)
 	mCurrentMimeType = mMimeType;
 
 	LLPluginClassMedia* media_source = newSourceFromMediaType(mMimeType, this, mMediaWidth, mMediaHeight, mTarget, mCleanBrowser);
-	
+
 	if (media_source)
 	{
 		media_source->setDisableTimeout(gSavedSettings.getBOOL("DebugPluginDisableTimeout"));
@@ -1984,7 +1984,7 @@ bool LLViewerMediaImpl::initializePlugin(const std::string& media_type)
 		media_source->setBrowserUserAgent(LLViewerMedia::getCurrentUserAgent());
 		media_source->focus(mHasFocus);
 		media_source->setBackgroundColor(mBackgroundColor);
-		
+
 		if(gSavedSettings.getBOOL("BrowserIgnoreSSLCertErrors"))
 		{
 			media_source->ignore_ssl_cert_errors(true);
@@ -1992,19 +1992,19 @@ bool LLViewerMediaImpl::initializePlugin(const std::string& media_type)
 
 		// the correct way to deal with certs it to load ours from CA.pem and append them to the ones
 		// Qt/WebKit loads from your system location.
-		// Note: This needs the new CA.pem file with the Equifax Secure Certificate Authority 
+		// Note: This needs the new CA.pem file with the Equifax Secure Certificate Authority
 		// cert at the bottom: (MIIDIDCCAomgAwIBAgIENd70zzANBg)
 		std::string ca_path = gDirUtilp->getExpandedFilename( LL_PATH_APP_SETTINGS, "CA.pem" );
 		media_source->addCertificateFilePath( ca_path );
 
 		media_source->proxy_setup(gSavedSettings.getBOOL("BrowserProxyEnabled"), gSavedSettings.getString("BrowserProxyAddress"), gSavedSettings.getS32("BrowserProxyPort"));
-		
+
 		if(mClearCache)
 		{
 			mClearCache = false;
 			media_source->clear_cache();
 		}
-		
+
 		// TODO: Only send cookies to plugins that need them
 		//  Ideally, the plugin should tell us whether it handles cookies or not -- either via the init response or through a separate message.
 		//  Due to the ordering of messages, it's possible we wouldn't get that information back in time to send cookies before sending a navigate message,
@@ -2015,7 +2015,7 @@ bool LLViewerMediaImpl::initializePlugin(const std::string& media_type)
 		{
 			media_source->set_cookies(all_cookies);
 		}
-				
+
 		mMediaSource = media_source;
 		mMediaSource->setDeleteOK(false) ;
 		updateVolume();
@@ -2058,16 +2058,16 @@ void LLViewerMediaImpl::loadURI()
             std::string sanitized_uri = (u.query().empty() ? uri : u.scheme() + "://" + u.authority() + u.path());
             LL_INFOS() << "Asking media source to load URI: " << sanitized_uri << LL_ENDL;
         }
-		
+
 		mMediaSource->loadURI( uri );
-		
-		// A non-zero mPreviousMediaTime means that either this media was previously unloaded by the priority code while playing/paused, 
+
+		// A non-zero mPreviousMediaTime means that either this media was previously unloaded by the priority code while playing/paused,
 		// or a seek happened before the media loaded.  In either case, seek to the saved time.
 		if(mPreviousMediaTime != 0.0f)
 		{
 			seek(mPreviousMediaTime);
 		}
-			
+
 		if(mPreviousMediaState == MEDIA_PLAYING)
 		{
 			// This media was playing before this instance was unloaded.
@@ -2120,11 +2120,11 @@ void LLViewerMediaImpl::play()
 			// This may be the case where the plugin's priority is PRIORITY_UNLOADED
 			return;
 		}
-		
+
 		// Only do this if the media source was just loaded.
 		loadURI();
 	}
-	
+
 	// always start the media
 	start();
 }
@@ -2225,10 +2225,10 @@ void LLViewerMediaImpl::updateVolume()
 {
 	if(mMediaSource)
 	{
-		// always scale the volume by the global media volume 
+		// always scale the volume by the global media volume
 		F32 volume = mRequestedVolume * LLViewerMedia::getVolume();
 
-		if (mProximityCamera > 0) 
+		if (mProximityCamera > 0)
 		{
 			if (mProximityCamera > gSavedSettings.getF32("MediaRollOffMax"))
 			{
@@ -2267,7 +2267,7 @@ F32 LLViewerMediaImpl::getVolume()
 void LLViewerMediaImpl::focus(bool focus)
 {
 	mHasFocus = focus;
-	
+
 	if (mMediaSource)
 	{
 		// call focus just for the hell of it, even though this apopears to be a nop
@@ -2295,7 +2295,7 @@ std::string LLViewerMediaImpl::getCurrentMediaURL()
 	{
 		return mCurrentMediaURL;
 	}
-	
+
 	return mMediaURL;
 }
 
@@ -2363,17 +2363,17 @@ void LLViewerMediaImpl::mouseMove(S32 x, S32 y, MASK mask)
 }
 
 //////////////////////////////////////////////////////////////////////////////////////////
-//static 
+//static
 void LLViewerMediaImpl::scaleTextureCoords(const LLVector2& texture_coords, S32 *x, S32 *y)
 {
 	F32 texture_x = texture_coords.mV[VX];
 	F32 texture_y = texture_coords.mV[VY];
-	
+
 	// Deal with repeating textures by wrapping the coordinates into the range [0, 1.0)
 	texture_x = fmodf(texture_x, 1.0f);
 	if(texture_x < 0.0f)
 		texture_x = 1.0 + texture_x;
-		
+
 	texture_y = fmodf(texture_y, 1.0f);
 	if(texture_y < 0.0f)
 		texture_y = 1.0 + texture_y;
@@ -2401,7 +2401,7 @@ void LLViewerMediaImpl::mouseDown(const LLVector2& texture_coords, MASK mask, S3
 void LLViewerMediaImpl::mouseUp(const LLVector2& texture_coords, MASK mask, S32 button)
 {
 	if(mMediaSource)
-	{		
+	{
 		S32 x, y;
 		scaleTextureCoords(texture_coords, &x, &y);
 
@@ -2412,7 +2412,7 @@ void LLViewerMediaImpl::mouseUp(const LLVector2& texture_coords, MASK mask, S32
 void LLViewerMediaImpl::mouseMove(const LLVector2& texture_coords, MASK mask)
 {
 	if(mMediaSource)
-	{		
+	{
 		S32 x, y;
 		scaleTextureCoords(texture_coords, &x, &y);
 
@@ -2454,18 +2454,18 @@ void LLViewerMediaImpl::onMouseCaptureLost()
 }
 
 //////////////////////////////////////////////////////////////////////////////////////////
-BOOL LLViewerMediaImpl::handleMouseUp(S32 x, S32 y, MASK mask) 
-{ 
+BOOL LLViewerMediaImpl::handleMouseUp(S32 x, S32 y, MASK mask)
+{
 	// NOTE: this is called when the mouse is released when we have capture.
 	// Due to the way mouse coordinates are mapped to the object, we can't use the x and y coordinates that come in with the event.
-	
+
 	if(hasMouseCapture())
 	{
 		// Release the mouse -- this will also send a mouseup to the media
 		gFocusMgr.setMouseCapture( FALSE );
 	}
 
-	return TRUE; 
+	return TRUE;
 }
 
 //////////////////////////////////////////////////////////////////////////////////////////
@@ -2541,14 +2541,14 @@ void LLViewerMediaImpl::updateJavascriptObject()
 }
 
 //////////////////////////////////////////////////////////////////////////////////////////
-const std::string& LLViewerMediaImpl::getName() const 
-{ 
+const std::string& LLViewerMediaImpl::getName() const
+{
 	if (mMediaSource)
 	{
 		return mMediaSource->getMediaName();
 	}
-	
-	return LLStringUtil::null; 
+
+	return LLStringUtil::null;
 };
 
 //////////////////////////////////////////////////////////////////////////////////////////
@@ -2604,21 +2604,21 @@ void LLViewerMediaImpl::navigateTo(const std::string& url, const std::string& mi
 		// Don't carry media play state across distinct URLs.
 		resetPreviousMediaState();
 	}
-	
+
 	// Always set the current URL and MIME type.
 	mMediaURL = url;
 	mMimeType = mime_type;
     mCleanBrowser = clean_browser;
-	
+
 	// Clear the current media URL, since it will no longer be correct.
 	mCurrentMediaURL.clear();
-	
+
 	// if mime type discovery was requested, we'll need to do it when the media loads
 	mNavigateRediscoverType = rediscover_type;
-	
+
 	// and if this was a server request, the navigate on load will also need to be one.
 	mNavigateServerRequest = server_request;
-	
+
 	// An explicit navigate resets the "failed" flag.
 	mMediaSourceFailed = false;
 
@@ -2634,7 +2634,7 @@ void LLViewerMediaImpl::navigateTo(const std::string& url, const std::string& mi
 
 		// This impl should not be loaded at this time.
 		LL_DEBUGS("PluginPriority") << this << "Not loading (PRIORITY_UNLOADED)" << LL_ENDL;
-		
+
 		return;
 	}
 
@@ -2658,13 +2658,13 @@ void LLViewerMediaImpl::navigateInternal()
 		mNavigateSuspendedDeferred = true;
 		return;
 	}
-	
+
 	if(mMimeTypeProbe != NULL)
 	{
 		LL_WARNS() << "MIME type probe already in progress -- bailing out." << LL_ENDL;
 		return;
 	}
-	
+
 	if(mNavigateServerRequest)
 	{
 		setNavState(MEDIANAVSTATE_SERVER_SENT);
@@ -2673,12 +2673,12 @@ void LLViewerMediaImpl::navigateInternal()
 	{
 		setNavState(MEDIANAVSTATE_NONE);
 	}
-			
+
 	// If the caller has specified a non-empty MIME type, look that up in our MIME types list.
 	// If we have a plugin for that MIME type, use that instead of attempting auto-discovery.
 	// This helps in supporting legacy media content where the server the media resides on returns a bogus MIME type
 	// but the parcel owner has correctly set the MIME type in the parcel media settings.
-	
+
 	if(!mMimeType.empty() && (mMimeType != LLMIMETypes::getDefaultMimeType()))
 	{
 		std::string plugin_basename = LLMIMETypes::implType(mMimeType);
@@ -2796,7 +2796,7 @@ bool LLViewerMediaImpl::handleKeyUpHere(KEY key, MASK mask)
 bool LLViewerMediaImpl::handleUnicodeCharHere(llwchar uni_char)
 {
 	bool result = false;
-	
+
 	if (mMediaSource)
 	{
 		// only accept 'printable' characters, sigh...
@@ -2804,11 +2804,11 @@ bool LLViewerMediaImpl::handleUnicodeCharHere(llwchar uni_char)
 			&& uni_char != 127) // SDL thinks this is 'delete' - yuck.
 		{
 			LLSD native_key_data = gViewerWindow->getWindow()->getNativeKeyData();
-			
+
 			mMediaSource->textInput(wstring_to_utf8str(LLWString(1, uni_char)), gKeyboard->currentMask(FALSE), native_key_data);
 		}
 	}
-	
+
 	return result;
 }
 
@@ -2887,15 +2887,15 @@ void LLViewerMediaImpl::update()
 		}
 	}
 
-	
+
 	if(mMediaSource == NULL)
 	{
 		return;
 	}
-	
+
 	// Make sure a navigate doesn't happen during the idle -- it can cause mMediaSource to get destroyed, which can cause a crash.
 	setNavigateSuspended(true);
-	
+
 	mMediaSource->idle();
 
 	setNavigateSuspended(false);
@@ -2904,7 +2904,7 @@ void LLViewerMediaImpl::update()
 	{
 		return;
 	}
-	
+
 	if(mMediaSource->isPluginExited())
 	{
 		resetPreviousMediaState();
@@ -2916,18 +2916,18 @@ void LLViewerMediaImpl::update()
 	{
 		return;
 	}
-	
+
 	if(mSuspendUpdates || !mVisible)
 	{
 		return;
 	}
-	
+
 	LLViewerMediaTexture* placeholder_image = updatePlaceholderImage();
-		
+
 	if(placeholder_image)
 	{
 		LLRect dirty_rect;
-		
+
 		// Since we're updating this texture, we know it's playing.  Tell the texture to do its replacement magic so it gets rendered.
 		placeholder_image->setPlaying(TRUE);
 
@@ -2938,7 +2938,7 @@ void LLViewerMediaImpl::update()
 			S32 y_pos = llmax(dirty_rect.mBottom, 0);
 			S32 width = llmin(dirty_rect.mRight, placeholder_image->getWidth()) - x_pos;
 			S32 height = llmin(dirty_rect.mTop, placeholder_image->getHeight()) - y_pos;
-			
+
 			if(width > 0 && height > 0)
 			{
 
@@ -2951,21 +2951,21 @@ void LLViewerMediaImpl::update()
 				// Offset the pixels pointer to match x_pos and y_pos
 				data += ( x_pos * mMediaSource->getTextureDepth() * mMediaSource->getBitsWidth() );
 				data += ( y_pos * mMediaSource->getTextureDepth() );
-				
+
 				{
 					LL_RECORD_BLOCK_TIME(FTM_MEDIA_SET_SUBIMAGE);
 					placeholder_image->setSubImage(
-							data, 
-							mMediaSource->getBitsWidth(), 
+							data,
+							mMediaSource->getBitsWidth(),
 							mMediaSource->getBitsHeight(),
-							x_pos, 
-							y_pos, 
-							width, 
+							x_pos,
+							y_pos,
+							width,
 							height);
 				}
 
 			}
-			
+
 			mMediaSource->resetDirty();
 		}
 	}
@@ -2986,10 +2986,10 @@ LLViewerMediaTexture* LLViewerMediaImpl::updatePlaceholderImage()
 		// The code that created this instance will read from the plugin's bits.
 		return NULL;
 	}
-	
+
 	LLViewerMediaTexture* placeholder_image = LLViewerTextureManager::getMediaTexture( mTextureId );
-	
-	if (mNeedsNewTexture 
+
+	if (mNeedsNewTexture
 		|| placeholder_image->getUseMipMaps()
 		|| (placeholder_image->getWidth() != mMediaSource->getTextureWidth())
 		|| (placeholder_image->getHeight() != mMediaSource->getTextureHeight())
@@ -3003,7 +3003,7 @@ LLViewerMediaTexture* LLViewerMediaImpl::updatePlaceholderImage()
 		int texture_width = mMediaSource->getTextureWidth();
 		int texture_height = mMediaSource->getTextureHeight();
 		int texture_depth = mMediaSource->getTextureDepth();
-		
+
 		// MEDIAOPT: check to see if size actually changed before doing work
 		placeholder_image->destroyGLTexture();
 		// MEDIAOPT: apparently just calling setUseMipMaps(FALSE) doesn't work?
@@ -3029,13 +3029,13 @@ LLViewerMediaTexture* LLViewerMediaImpl::updatePlaceholderImage()
 		// FIXME
 //		placeholder_image->mIsMediaTexture = true;
 		mNeedsNewTexture = false;
-				
-		// If the amount of the texture being drawn by the media goes down in either width or height, 
+
+		// If the amount of the texture being drawn by the media goes down in either width or height,
 		// recreate the texture to avoid leaving parts of the old image behind.
 		mTextureUsedWidth = mMediaSource->getWidth();
 		mTextureUsedHeight = mMediaSource->getHeight();
 	}
-	
+
 	return placeholder_image;
 }
 
@@ -3050,14 +3050,14 @@ LLUUID LLViewerMediaImpl::getMediaTextureID() const
 void LLViewerMediaImpl::setVisible(bool visible)
 {
 	mVisible = visible;
-	
+
 	if(mVisible)
 	{
 		if(mMediaSource && mMediaSource->isPluginExited())
 		{
 			destroyMediaSource();
 		}
-		
+
 		if(!mMediaSource)
 		{
 			createMediaSource();
@@ -3091,12 +3091,12 @@ void LLViewerMediaImpl::scaleMouse(S32 *mouse_x, S32 *mouse_y)
 bool LLViewerMediaImpl::isMediaTimeBased()
 {
 	bool result = false;
-	
+
 	if(mMediaSource)
 	{
 		result = mMediaSource->pluginSupportsMediaTime();
 	}
-	
+
 	return result;
 }
 
@@ -3104,14 +3104,14 @@ bool LLViewerMediaImpl::isMediaTimeBased()
 bool LLViewerMediaImpl::isMediaPlaying()
 {
 	bool result = false;
-	
+
 	if(mMediaSource)
 	{
 		EMediaStatus status = mMediaSource->getStatus();
 		if(status == MEDIA_PLAYING || status == MEDIA_LOADING)
 			result = true;
 	}
-	
+
 	return result;
 }
 //////////////////////////////////////////////////////////////////////////////////////////
@@ -3124,7 +3124,7 @@ bool LLViewerMediaImpl::isMediaPaused()
 		if(mMediaSource->getStatus() == MEDIA_PAUSED)
 			result = true;
 	}
-	
+
 	return result;
 }
 
@@ -3152,7 +3152,7 @@ void LLViewerMediaImpl::setDisabled(bool disabled, bool forcePlayOnEnable)
 	{
 		// Only do this on actual state transitions.
 		mIsDisabled = disabled;
-		
+
 		if(mIsDisabled)
 		{
 			// We just disabled this media.  Clear all state.
@@ -3178,13 +3178,13 @@ bool LLViewerMediaImpl::isForcedUnloaded() const
 	{
 		return true;
 	}
-	
+
 	// If this media's class is not supposed to be shown, unload
 	if (!shouldShowBasedOnClass())
 	{
 		return true;
 	}
-	
+
 	return false;
 }
 
@@ -3197,19 +3197,19 @@ bool LLViewerMediaImpl::isPlayable() const
 		// All of the forced-unloaded criteria also imply not playable.
 		return false;
 	}
-	
+
 	if(hasMedia())
 	{
 		// Anything that's already playing is, by definition, playable.
 		return true;
 	}
-	
+
 	if(!mMediaURL.empty())
 	{
 		// If something has navigated the instance, it's ready to be played.
 		return true;
 	}
-	
+
 	return false;
 }
 
@@ -3221,7 +3221,7 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla
 	{
 		case MEDIA_EVENT_CLICK_LINK_NOFOLLOW:
 		{
-			LL_DEBUGS("Media") << "MEDIA_EVENT_CLICK_LINK_NOFOLLOW, uri is: " << plugin->getClickURL() << LL_ENDL; 
+			LL_DEBUGS("Media") << "MEDIA_EVENT_CLICK_LINK_NOFOLLOW, uri is: " << plugin->getClickURL() << LL_ENDL;
 			std::string url = plugin->getClickURL();
 			std::string nav_type = plugin->getClickNavType();
 			LLURLDispatcher::dispatch(url, nav_type, NULL, mTrustedBrowser);
@@ -3240,7 +3240,7 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla
 
 			// Reset the last known state of the media to defaults.
 			resetPreviousMediaState();
-			
+
 			// TODO: may want a different message for this case?
 			LLSD args;
 			args["PLUGIN"] = LLMIMETypes::implType(mCurrentMimeType);
@@ -3262,13 +3262,13 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla
 			//LLNotificationsUtil::add("MediaPluginFailed", args);
 		}
 		break;
-		
+
 		case MEDIA_EVENT_CURSOR_CHANGED:
 		{
 			LL_DEBUGS("Media") <<  "Media event:  MEDIA_EVENT_CURSOR_CHANGED, new cursor is " << plugin->getCursorName() << LL_ENDL;
 
 			std::string cursor = plugin->getCursorName();
-			
+
 			if(cursor == "arrow")
 				mLastSetCursor = UI_CURSOR_ARROW;
 			else if(cursor == "ibeam")
@@ -3329,7 +3329,7 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla
 			}
 		}
 		break;
-		
+
 		case LLViewerMediaObserver::MEDIA_EVENT_LOCATION_CHANGED:
 		{
 			LL_DEBUGS("Media") << "MEDIA_EVENT_LOCATION_CHANGED, uri is: " << plugin->getLocation() << LL_ENDL;
@@ -3366,15 +3366,15 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla
 		{
 			// Display a file picker
 			std::string response;
-			
+
 			LLFilePicker& picker = LLFilePicker::instance();
 			if (!picker.getOpenFile(LLFilePicker::FFLOAD_ALL))
 			{
 				// The user didn't pick a file -- the empty response string will indicate this.
 			}
-			
+
 			response = picker.getFirstFile();
-			
+
 			plugin->sendPickFileResponse(response);
 		}
 		break;
@@ -3530,7 +3530,7 @@ void LLViewerMediaImpl::calculateInterest()
 {
 	LL_RECORD_BLOCK_TIME(FTM_MEDIA_CALCULATE_INTEREST);
 	LLViewerMediaTexture* texture = LLViewerTextureManager::findMediaTexture( mTextureId );
-	
+
 	if(texture != NULL)
 	{
 		mInterest = texture->getMaxVirtualSize();
@@ -3540,7 +3540,7 @@ void LLViewerMediaImpl::calculateInterest()
 		// This will be a relatively common case now, since it will always be true for unloaded media.
 		mInterest = 0.0f;
 	}
-	
+
 	// Calculate distance from the avatar, for use in the proximity calculation.
 	mProximityDistance = 0.0f;
 	mProximityCamera = 0.0f;
@@ -3550,7 +3550,7 @@ void LLViewerMediaImpl::calculateInterest()
 		std::list< LLVOVolume* >::iterator iter = mObjectList.begin() ;
 		LLVOVolume* objp = *iter ;
 		llassert_always(objp != NULL) ;
-		
+
 		// The distance calculation is invalid for HUD attachments -- leave both mProximityDistance and mProximityCamera at 0 for them.
 		if(!objp->isHUDAttachment())
 		{
@@ -3563,12 +3563,12 @@ void LLViewerMediaImpl::calculateInterest()
 			mProximityCamera = camera_delta.magVec();
 		}
 	}
-	
+
 	if(mNeedsMuteCheck)
 	{
 		// Check all objects this instance is associated with, and those objects' owners, against the mute list
 		mIsMuted = false;
-		
+
 		std::list< LLVOVolume* >::iterator iter = mObjectList.begin() ;
 		for(; iter != mObjectList.end() ; ++iter)
 		{
@@ -3595,7 +3595,7 @@ void LLViewerMediaImpl::calculateInterest()
 				}
 			}
 		}
-		
+
 		mNeedsMuteCheck = false;
 	}
 }
@@ -3603,7 +3603,7 @@ void LLViewerMediaImpl::calculateInterest()
 F64 LLViewerMediaImpl::getApproximateTextureInterest()
 {
 	F64 result = 0.0f;
-	
+
 	if(mMediaSource)
 	{
 		result = mMediaSource->getFullWidth();
@@ -3621,8 +3621,8 @@ F64 LLViewerMediaImpl::getApproximateTextureInterest()
 
 void LLViewerMediaImpl::setUsedInUI(bool used_in_ui)
 {
-	mUsedInUI = used_in_ui; 
-	
+	mUsedInUI = used_in_ui;
+
 	// HACK: Force elements used in UI to load right away.
 	// This fixes some issues where UI code that uses the browser instance doesn't expect it to be unloaded.
 	if(mUsedInUI && (mPriority == LLPluginClassMedia::PRIORITY_UNLOADED))
@@ -3642,7 +3642,7 @@ void LLViewerMediaImpl::setUsedInUI(bool used_in_ui)
 
 void LLViewerMediaImpl::setBackgroundColor(LLColor4 color)
 {
-	mBackgroundColor = color; 
+	mBackgroundColor = color;
 
 	if(mMediaSource)
 	{
@@ -3653,12 +3653,12 @@ void LLViewerMediaImpl::setBackgroundColor(LLColor4 color)
 F64 LLViewerMediaImpl::getCPUUsage() const
 {
 	F64 result = 0.0f;
-	
+
 	if(mMediaSource)
 	{
 		result = mMediaSource->getCPUUsage();
 	}
-	
+
 	return result;
 }
 
@@ -3672,19 +3672,19 @@ void LLViewerMediaImpl::setPriority(LLPluginClassMedia::EPriority priority)
 			<< " to " << LLPluginClassMedia::priorityToString(priority)
 			<< LL_ENDL;
 	}
-	
+
 	mPriority = priority;
-	
+
 	if(priority == LLPluginClassMedia::PRIORITY_UNLOADED)
 	{
 		if(mMediaSource)
 		{
 			// Need to unload the media source
-			
+
 			// First, save off previous media state
 			mPreviousMediaState = mMediaSource->getStatus();
 			mPreviousMediaTime = mMediaSource->getCurrentTime();
-			
+
 			destroyMediaSource();
 		}
 	}
@@ -3693,7 +3693,7 @@ void LLViewerMediaImpl::setPriority(LLPluginClassMedia::EPriority priority)
 	{
 		mMediaSource->setPriority(mPriority);
 	}
-	
+
 	// NOTE: loading (or reloading) media sources whose priority has risen above PRIORITY_UNLOADED is done in update().
 }
 
@@ -3708,8 +3708,8 @@ void LLViewerMediaImpl::setLowPrioritySizeLimit(int size)
 void LLViewerMediaImpl::setNavState(EMediaNavState state)
 {
 	mMediaNavState = state;
-	
-	switch (state) 
+
+	switch (state)
 	{
 		case MEDIANAVSTATE_NONE: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_NONE" << LL_ENDL; break;
 		case MEDIANAVSTATE_BEGUN: LL_DEBUGS("Media") << "Setting nav state to MEDIANAVSTATE_BEGUN" << LL_ENDL; break;
@@ -3748,7 +3748,7 @@ void LLViewerMediaImpl::cancelMimeTypeProbe()
 		// There doesn't seem to be a way to actually cancel an outstanding request.
 		// Simulate it by telling the LLMimeDiscoveryResponder not to write back any results.
 		mMimeTypeProbe->cancelRequest();
-		
+
 		// The above should already have set mMimeTypeProbe to NULL.
 		if(mMimeTypeProbe != NULL)
 		{
@@ -3757,7 +3757,7 @@ void LLViewerMediaImpl::cancelMimeTypeProbe()
 	}
 }
 
-void LLViewerMediaImpl::addObject(LLVOVolume* obj) 
+void LLViewerMediaImpl::addObject(LLVOVolume* obj)
 {
 	std::list< LLVOVolume* >::iterator iter = mObjectList.begin() ;
 	for(; iter != mObjectList.end() ; ++iter)
@@ -3771,14 +3771,14 @@ void LLViewerMediaImpl::addObject(LLVOVolume* obj)
 	mObjectList.push_back(obj) ;
 	mNeedsMuteCheck = true;
 }
-	
-void LLViewerMediaImpl::removeObject(LLVOVolume* obj) 
+
+void LLViewerMediaImpl::removeObject(LLVOVolume* obj)
 {
-	mObjectList.remove(obj) ;	
+	mObjectList.remove(obj) ;
 	mNeedsMuteCheck = true;
 }
-	
-const std::list< LLVOVolume* >* LLViewerMediaImpl::getObjectList() const 
+
+const std::list< LLVOVolume* >* LLViewerMediaImpl::getObjectList() const
 {
 	return &mObjectList ;
 }
@@ -3786,13 +3786,13 @@ const std::list< LLVOVolume* >* LLViewerMediaImpl::getObjectList() const
 LLVOVolume *LLViewerMediaImpl::getSomeObject()
 {
 	LLVOVolume *result = NULL;
-	
+
 	std::list< LLVOVolume* >::iterator iter = mObjectList.begin() ;
 	if(iter != mObjectList.end())
 	{
 		result = *iter;
 	}
-	
+
 	return result;
 }
 
@@ -3805,12 +3805,12 @@ void LLViewerMediaImpl::setTextureID(LLUUID id)
 			// Remove this item's entry from the map
 			sViewerMediaTextureIDMap.erase(mTextureId);
 		}
-		
+
 		if(id.notNull())
 		{
 			sViewerMediaTextureIDMap.insert(LLViewerMedia::impl_id_map::value_type(id, this));
 		}
-		
+
 		mTextureId = id;
 	}
 }
@@ -3819,7 +3819,7 @@ void LLViewerMediaImpl::setTextureID(LLUUID id)
 //
 bool LLViewerMediaImpl::isAutoPlayable() const
 {
-	return (mMediaAutoPlay && 
+	return (mMediaAutoPlay &&
 			gSavedSettings.getBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING) &&
 			gSavedSettings.getBOOL("MediaTentativeAutoPlay"));
 }
@@ -3830,20 +3830,20 @@ bool LLViewerMediaImpl::shouldShowBasedOnClass() const
 {
 	// If this is parcel media or in the UI, return true always
 	if (getUsedInUI() || isParcelMedia()) return true;
-	
+
 	bool attached_to_another_avatar = isAttachedToAnotherAvatar();
 	bool inside_parcel = isInAgentParcel();
-	
+
 	//	LL_INFOS() << " hasFocus = " << hasFocus() <<
 	//	" others = " << (attached_to_another_avatar && gSavedSettings.getBOOL(LLViewerMedia::SHOW_MEDIA_ON_OTHERS_SETTING)) <<
 	//	" within = " << (inside_parcel && gSavedSettings.getBOOL(LLViewerMedia::SHOW_MEDIA_WITHIN_PARCEL_SETTING)) <<
 	//	" outside = " << (!inside_parcel && gSavedSettings.getBOOL(LLViewerMedia::SHOW_MEDIA_OUTSIDE_PARCEL_SETTING)) << LL_ENDL;
-	
+
 	// If it has focus, we should show it
 	// This is incorrect, and causes EXT-6750 (disabled attachment media still plays)
 //	if (hasFocus())
 //		return true;
-	
+
 	// If it is attached to an avatar and the pref is off, we shouldn't show it
 	if (attached_to_another_avatar)
 	{
@@ -3856,7 +3856,7 @@ bool LLViewerMediaImpl::shouldShowBasedOnClass() const
 
 		return show_media_within_parcel;
 	}
-	else 
+	else
 	{
 		static LLCachedControl<bool> show_media_outside_parcel(gSavedSettings, LLViewerMedia::SHOW_MEDIA_OUTSIDE_PARCEL_SETTING, true);
 
@@ -3869,7 +3869,7 @@ bool LLViewerMediaImpl::shouldShowBasedOnClass() const
 bool LLViewerMediaImpl::isAttachedToAnotherAvatar() const
 {
 	bool result = false;
-	
+
 	std::list< LLVOVolume* >::const_iterator iter = mObjectList.begin();
 	std::list< LLVOVolume* >::const_iterator end = mObjectList.end();
 	for ( ; iter != end; iter++)
@@ -3913,7 +3913,7 @@ bool LLViewerMediaImpl::isObjectAttachedToAnotherAvatar(LLVOVolume *obj)
 bool LLViewerMediaImpl::isInAgentParcel() const
 {
 	bool result = false;
-	
+
 	std::list< LLVOVolume* >::const_iterator iter = mObjectList.begin();
 	std::list< LLVOVolume* >::const_iterator end = mObjectList.end();
 	for ( ; iter != end; iter++)
-- 
cgit v1.2.3


From 16cd296e30e95fbacefff4e291fbdd6fbf0c2c43 Mon Sep 17 00:00:00 2001
From: callum_linden <none@none>
Date: Thu, 22 Oct 2015 13:24:43 -0700
Subject: MAINT-5775 FIX Split out cookies and cache directories into separate
 folders and move cache to same place as viewer cache

---
 indra/newview/llviewermedia.cpp | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 49d6c1021e..7e3d88fa64 100755
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -286,11 +286,7 @@ public:
 		const LLIOPipe::buffer_ptr_t& buffer)
 	{
 		const std::string url = getURL();
-		llinfos << "@@@ URL to set cookie on" << url << llendl;
 
-		// We don't care about the content of the response, only the Set-Cookie header.
-		llinfos << dumpResponse()
-				<< " [headers:" << getResponseHeaders() << "]" << llendl;
 		const std::string& cookie = getResponseHeader(HTTP_IN_HEADER_SET_COOKIE);
 
 		// *TODO: What about bad status codes?  Does this destroy previous cookies?
@@ -1870,8 +1866,12 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_
 	{
 		std::string launcher_name = gDirUtilp->getLLPluginLauncher();
 		std::string plugin_name = gDirUtilp->getLLPluginFilename(plugin_basename);
-		std::string user_data_path = gDirUtilp->getOSUserAppDir();
-		user_data_path += gDirUtilp->getDirDelimiter();
+
+		std::string user_data_path_cache = gDirUtilp->getCacheDir(false);
+		user_data_path_cache += gDirUtilp->getDirDelimiter();
+
+		std::string user_data_path_cookies = gDirUtilp->getOSUserAppDir();
+		user_data_path_cookies += gDirUtilp->getDirDelimiter();
 
 		// Fix for EXT-5960 - make browser profile specific to user (cache, cookies etc.)
 		// If the linden username returned is blank, that can only mean we are
@@ -1882,8 +1882,8 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_
 		if ( ! linden_user_dir.empty() )
 		{
 			// gDirUtilp->getLindenUserDir() is whole path, not just Linden name
-			user_data_path = linden_user_dir;
-			user_data_path += gDirUtilp->getDirDelimiter();
+			user_data_path_cookies = linden_user_dir;
+			user_data_path_cookies += gDirUtilp->getDirDelimiter();
 		};
 
 		// See if the plugin executable exists
@@ -1900,7 +1900,7 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_
 		{
 			media_source = new LLPluginClassMedia(owner);
 			media_source->setSize(default_width, default_height);
-			media_source->setUserDataPath(user_data_path);
+			media_source->setUserDataPath(user_data_path_cache, user_data_path_cookies);
 			media_source->setLanguageCode(LLUI::getLanguage());
 
 			// collect 'cookies enabled' setting from prefs and send to embedded browser
-- 
cgit v1.2.3


From 9833a50260fb45d5f0033200ae756834c0cc9940 Mon Sep 17 00:00:00 2001
From: Rider Linden <rider@lindenlab.com>
Date: Tue, 27 Oct 2015 15:17:12 -0700
Subject: MAINT-5754: For MoaP and MediaCtrls forward all events including
 KEYUP and KEYDOWN to the CEF plugin.

---
 indra/newview/llinventoryfunctions.cpp |  2 +-
 indra/newview/llmediactrl.cpp          | 10 ++++++++++
 indra/newview/llmediactrl.h            |  4 ++++
 indra/newview/llviewermedia.cpp        |  9 ++++-----
 indra/newview/llviewermediafocus.cpp   | 17 ++++++++++++++++-
 indra/newview/llviewermediafocus.h     |  4 ++++
 indra/newview/llviewerwindow.cpp       | 34 ++++++++++++++++++++++++----------
 7 files changed, 63 insertions(+), 17 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 6aaf45c35d..984c650128 100755
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -1605,7 +1605,7 @@ bool sort_alpha(const LLViewerInventoryCategory* cat1, const LLViewerInventoryCa
 
 void dump_trace(std::string& message, S32 depth, LLError::ELevel log_level)
 {
-    llinfos << "validate_marketplacelistings : error = "<< log_level << ", depth = " << depth << ", message = " << message <<  llendl;
+    LL_INFOS() << "validate_marketplacelistings : error = "<< log_level << ", depth = " << depth << ", message = " << message <<  LL_ENDL;
 }
 
 // Make all relevant business logic checks on the marketplace listings starting with the folder as argument.
diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp
index d999c6f52b..9b8e24a8e8 100755
--- a/indra/newview/llmediactrl.cpp
+++ b/indra/newview/llmediactrl.cpp
@@ -1171,3 +1171,13 @@ void LLMediaCtrl::updateContextMenuParent(LLView* pNewParent)
 {
 	mContextMenu->updateParent(pNewParent);
 }
+
+bool LLMediaCtrl::wantsKeyUpKeyDown() const
+{
+    return true;
+}
+
+bool LLMediaCtrl::wantsReturnKey() const
+{
+    return true;
+}
diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h
index cb3a864d63..291d87073e 100755
--- a/indra/newview/llmediactrl.h
+++ b/indra/newview/llmediactrl.h
@@ -172,6 +172,10 @@ public:
 
 		void updateContextMenuParent(LLView* pNewParent);
 
+        // The Browser windows want keyup and keydown events. Overridden from LLFocusableElement to return true.
+        virtual bool    wantsKeyUpKeyDown() const;
+        virtual bool    wantsReturnKey() const;
+
 	protected:
 		void convertInputCoords(S32& x, S32& y);
 
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 49d6c1021e..8a16243ec1 100755
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -286,11 +286,11 @@ public:
 		const LLIOPipe::buffer_ptr_t& buffer)
 	{
 		const std::string url = getURL();
-		llinfos << "@@@ URL to set cookie on" << url << llendl;
+		LL_INFOS() << "@@@ URL to set cookie on" << url << LL_ENDL;
 
 		// We don't care about the content of the response, only the Set-Cookie header.
-		llinfos << dumpResponse()
-				<< " [headers:" << getResponseHeaders() << "]" << llendl;
+		LL_INFOS() << dumpResponse()
+				<< " [headers:" << getResponseHeaders() << "]" << LL_ENDL;
 		const std::string& cookie = getResponseHeader(HTTP_IN_HEADER_SET_COOKIE);
 
 		// *TODO: What about bad status codes?  Does this destroy previous cookies?
@@ -2759,8 +2759,7 @@ bool LLViewerMediaImpl::handleKeyHere(KEY key, MASK mask)
 
 		if (!result)
 		{
-
-			LLSD native_key_data = gViewerWindow->getWindow()->getNativeKeyData();
+            LLSD native_key_data = gViewerWindow->getWindow()->getNativeKeyData();
 			result = mMediaSource->keyEvent(LLPluginClassMedia::KEY_EVENT_DOWN, key, mask, native_key_data);
 		}
 	}
diff --git a/indra/newview/llviewermediafocus.cpp b/indra/newview/llviewermediafocus.cpp
index 1265ca0a70..7b4df3d3da 100755
--- a/indra/newview/llviewermediafocus.cpp
+++ b/indra/newview/llviewermediafocus.cpp
@@ -354,7 +354,12 @@ BOOL LLViewerMediaFocus::handleKey(KEY key, MASK mask, BOOL called_from_parent)
 
 BOOL LLViewerMediaFocus::handleKeyUp(KEY key, MASK mask, BOOL called_from_parent)
 {
-	return true;
+    LLViewerMediaImpl* media_impl = getFocusedMediaImpl();
+    if (media_impl)
+    {
+        media_impl->handleKeyUpHere(key, mask);
+    }
+    return true;
 }
 
 
@@ -610,3 +615,13 @@ LLUUID LLViewerMediaFocus::getControlsMediaID()
 	
 	return LLUUID::null;
 }
+
+bool LLViewerMediaFocus::wantsKeyUpKeyDown() const
+{
+    return true;
+}
+
+bool LLViewerMediaFocus::wantsReturnKey() const
+{
+    return true;
+}
diff --git a/indra/newview/llviewermediafocus.h b/indra/newview/llviewermediafocus.h
index 42c841df15..0b2a64868e 100755
--- a/indra/newview/llviewermediafocus.h
+++ b/indra/newview/llviewermediafocus.h
@@ -88,6 +88,10 @@ public:
 	// Return the ID of the media instance the controls are currently attached to (either focus or hover).
 	LLUUID getControlsMediaID();
 
+    // The MoaP object wants keyup and keydown events.  Overridden to return true.
+    virtual bool    wantsKeyUpKeyDown() const;
+    virtual bool    wantsReturnKey() const;
+
 protected:
 	/*virtual*/ void	onFocusReceived();
 	/*virtual*/ void	onFocusLost();
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index b6212e0958..6be63ef889 100755
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1381,7 +1381,11 @@ BOOL LLViewerWindow::handleTranslatedKeyDown(KEY key,  MASK mask, BOOL repeated)
 	// it's all entered/processed.
 	if (key == KEY_RETURN && mask == MASK_NONE)
 	{
-		return FALSE;
+        // RIDER: although, at times some of the controlls (in particular the CEF viewer
+        // would like to know about the KEYDOWN for an enter key... so ask and pass it along.
+        LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus();
+        if (keyboard_focus && !keyboard_focus->wantsReturnKey())
+    		return FALSE;
 	}
 
 	return gViewerKeyboard.handleKey(key, mask, repeated);
@@ -2543,22 +2547,27 @@ void LLViewerWindow::draw()
 //#endif
 }
 
-// Takes a single keydown event, usually when UI is visible
+// Takes a single keyup event, usually when UI is visible
 BOOL LLViewerWindow::handleKeyUp(KEY key, MASK mask)
 {
-	if (gFocusMgr.getKeyboardFocus()
+    LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus();
+
+    if (keyboard_focus
 		&& !(mask & (MASK_CONTROL | MASK_ALT))
 		&& !gFocusMgr.getKeystrokesOnly())
 	{
 		// We have keyboard focus, and it's not an accelerator
-		if (key < 0x80)
+        if (keyboard_focus && keyboard_focus->wantsKeyUpKeyDown())
+        {
+            return keyboard_focus->handleKey(key, mask, FALSE);
+        }
+        else if (key < 0x80)
 		{
 			// Not a special key, so likely (we hope) to generate a character.  Let it fall through to character handler first.
 			return (gFocusMgr.getKeyboardFocus() != NULL);
 		}
 	}
 
-	LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus();
 	if (keyboard_focus)
 	{
 		if (keyboard_focus->handleKeyUp(key, mask, FALSE))
@@ -2584,15 +2593,21 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
 	// hide tooltips on keypress
 	LLToolTipMgr::instance().blockToolTips();
 
-	if (gFocusMgr.getKeyboardFocus() 
+    LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus();
+
+    if (keyboard_focus
 		&& !(mask & (MASK_CONTROL | MASK_ALT))
 		&& !gFocusMgr.getKeystrokesOnly())
 	{
 		// We have keyboard focus, and it's not an accelerator
-		if (key < 0x80)
+        if (keyboard_focus && keyboard_focus->wantsKeyUpKeyDown())
+        {
+            return keyboard_focus->handleKey(key, mask, FALSE );
+        }
+		else if (key < 0x80)
 		{
 			// Not a special key, so likely (we hope) to generate a character.  Let it fall through to character handler first.
-			return (gFocusMgr.getKeyboardFocus() != NULL);
+            return (keyboard_focus != NULL);
 		}
 	}
 
@@ -2606,7 +2621,6 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
 		return TRUE;
 	}
 
-	LLFocusableElement* keyboard_focus = gFocusMgr.getKeyboardFocus();
 
 	// give menus a chance to handle modified (Ctrl, Alt) shortcut keys before current focus 
 	// as long as focus isn't locked
@@ -2632,7 +2646,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)
 	// give floaters first chance to handle TAB key
 	// so frontmost floater gets focus
 	// if nothing has focus, go to first or last UI element as appropriate
-	if (key == KEY_TAB && (mask & MASK_CONTROL || gFocusMgr.getKeyboardFocus() == NULL))
+    if (key == KEY_TAB && (mask & MASK_CONTROL || keyboard_focus == NULL))
 	{
 		LL_WARNS() << "LLviewerWindow::handleKey give floaters first chance at tab key " << LL_ENDL;
 		if (gMenuHolder) gMenuHolder->hideMenus();
-- 
cgit v1.2.3


From bd817f6f422991c2653493436c7845e75ea9d855 Mon Sep 17 00:00:00 2001
From: rider <rider@lindenlab.com>
Date: Fri, 6 Nov 2015 14:12:30 -0800
Subject: MAINT-5754: Basic keyboard functionality on the Mac.  Still
 incomplete

---
 indra/newview/llappviewer.cpp    | 2 +-
 indra/newview/llviewermedia.cpp  | 3 ++-
 indra/newview/llviewerwindow.cpp | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 9e80e26e3f..03a8756ac8 100755
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -2786,7 +2786,7 @@ bool LLAppViewer::initConfiguration()
 	//
 	gWindowTitle = LLTrans::getString("APP_NAME");
 #if LL_DEBUG
-	gWindowTitle += std::string(" [DEBUG]")
+    gWindowTitle += std::string(" [DEBUG]");
 #endif
 	if (!gArgs.empty())
 	{
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 0824a7def7..626938f7b5 100755
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -1450,7 +1450,8 @@ void LLViewerMedia::setOpenIDCookie(const std::string& url)
 				std::string cookie_name = "";
 				std::string cookie_value = "";
 				std::string cookie_path = "";
-				if (parseRawCookie(sOpenIDCookie, cookie_name, cookie_value, cookie_path))
+				if (parseRawCookie(sOpenIDCookie, cookie_name, cookie_value, cookie_path) &&
+                    media_instance->getMediaPlugin())
 				{
 					media_instance->getMediaPlugin()->setCookie(url, cookie_name, cookie_value, cookie_host, cookie_path);
 				}
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 6be63ef889..86a90a2c24 100755
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -2559,7 +2559,7 @@ BOOL LLViewerWindow::handleKeyUp(KEY key, MASK mask)
 		// We have keyboard focus, and it's not an accelerator
         if (keyboard_focus && keyboard_focus->wantsKeyUpKeyDown())
         {
-            return keyboard_focus->handleKey(key, mask, FALSE);
+            return keyboard_focus->handleKeyUp(key, mask, FALSE);
         }
         else if (key < 0x80)
 		{
-- 
cgit v1.2.3


From abc9df45dae46e7372e8beb840a1294e5a64a94d Mon Sep 17 00:00:00 2001
From: callum_linden <none@none>
Date: Mon, 9 Nov 2015 15:09:41 -0800
Subject: Fix MAINT-5773 Surface Plugins Enabled as a preference and default to
 OFF

---
 indra/newview/app_settings/settings.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'indra/newview')

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 5f378c64e8..6fac330db4 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -2005,7 +2005,7 @@
       <key>Type</key>
       <string>Boolean</string>
       <key>Value</key>
-      <integer>1</integer>
+      <integer>0</integer>
     </map>
     <key>ChatBarCustomWidth</key>
     <map>
-- 
cgit v1.2.3


From 059925eafb66dc0e2d8ef9c113ca8980a34c655d Mon Sep 17 00:00:00 2001
From: Rider Linden <rider@lindenlab.com>
Date: Tue, 10 Nov 2015 13:45:30 -0800
Subject: Added code to initiate controlled shutdown of plugins with timeouts
 for misbeahving plugin.

---
 indra/newview/llappviewer.cpp                  | 3 +++
 indra/newview/tests/llmediadataclient_test.cpp | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 03a8756ac8..f0cfd052cf 100755
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -1730,6 +1730,9 @@ bool LLAppViewer::cleanup()
 	// to ensure shutdown order
 	LLMortician::setZealous(TRUE);
 
+    // Give any remaining SLPlugin instances a chance to exit cleanly.
+    LLPluginProcessParent::shutdown();
+
 	LLVoiceClient::getInstance()->terminate();
 	
 	disconnectViewer();
diff --git a/indra/newview/tests/llmediadataclient_test.cpp b/indra/newview/tests/llmediadataclient_test.cpp
index 6f57daf151..7cb4aeb121 100755
--- a/indra/newview/tests/llmediadataclient_test.cpp
+++ b/indra/newview/tests/llmediadataclient_test.cpp
@@ -26,7 +26,7 @@
 
 #include "linden_common.h"
 #include "../llviewerprecompiledheaders.h"
- 
+
 #include <iostream>
 #include "../test/lltut.h"
 
-- 
cgit v1.2.3


From ec55f2cd10db838140b34b04717e9e50a6b736ce Mon Sep 17 00:00:00 2001
From: callum_linden <none@none>
Date: Fri, 13 Nov 2015 16:19:16 -0800
Subject: MAINT-5862 Fix Provide a way for new Linux users to accept ToS

---
 indra/newview/llfloaterpreference.cpp              | 11 +++++++++
 indra/newview/llfloatertos.cpp                     | 26 ++++++++++++++++++++--
 indra/newview/llweb.cpp                            |  4 ++++
 indra/newview/skins/default/xui/en/floater_tos.xml | 15 +++++++++++++
 4 files changed, 54 insertions(+), 2 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index dac610eda1..f7861fb4fd 100755
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -108,6 +108,7 @@
 #include "llpluginclassmedia.h"
 #include "llteleporthistorystorage.h"
 #include "llproxy.h"
+#include "llweb.h"
 
 #include "lllogininstance.h"        // to check if logged in yet
 #include "llsdserialize.h"
@@ -1942,6 +1943,16 @@ BOOL LLPanelPreference::postBuild()
 		gSavedSettings.getControl("ThrottleBandwidthKBPS")->getSignal()->connect(boost::bind(&LLPanelPreference::Updater::update, mBandWidthUpdater, _2));
 	}
 
+#ifdef EXTERNAL_TOS
+	LLRadioGroup* ext_browser_settings = getChild<LLRadioGroup>("preferred_browser_behavior");
+	if (ext_browser_settings)
+	{
+		// turn off ability to set external/internal browser
+		ext_browser_settings->setSelectedByValue(LLWeb::BROWSER_EXTERNAL_ONLY, true);
+		ext_browser_settings->setEnabled(false);
+	}
+#endif
+
 	apply();
 	return true;
 }
diff --git a/indra/newview/llfloatertos.cpp b/indra/newview/llfloatertos.cpp
index ae33acb842..4cb1ca6cc0 100755
--- a/indra/newview/llfloatertos.cpp
+++ b/indra/newview/llfloatertos.cpp
@@ -46,7 +46,6 @@
 #include "message.h"
 #include "llstartup.h"              // login_alert_done
 
-
 LLFloaterTOS::LLFloaterTOS(const LLSD& data)
 :	LLModalDialog( data["message"].asString() ),
 	mMessage(data["message"].asString()),
@@ -85,7 +84,7 @@ protected:
 	{
 		if ( mParent )
 		{
-			mParent->setSiteIsAlive( true );
+			mParent->setSiteIsAlive(true);
 		}
 	}
 
@@ -136,6 +135,20 @@ BOOL LLFloaterTOS::postBuild()
 	LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("tos_html");
 	if ( web_browser )
 	{
+// if we are forced to send users to an external site in their system browser
+// (e.g.) Linux users because of lack of media support for HTML ToS page
+// remove exisiting UI and replace with a link to external page where users can accept ToS
+#ifdef EXTERNAL_TOS
+		LLTextBox* header = getChild<LLTextBox>("tos_heading");
+		if (header)
+			header->setVisible(false);
+
+		LLTextBox* external_prompt = getChild<LLTextBox>("external_tos_required");
+		if (external_prompt)
+			external_prompt->setVisible(true);
+
+		web_browser->setVisible(false);
+#else
 		web_browser->addObserver(this);
 
 		// Don't use the start_url parameter for this browser instance -- it may finish loading before we get to add our observer.
@@ -147,6 +160,7 @@ BOOL LLFloaterTOS::postBuild()
 			// All links from tos_html should be opened in external browser
 			media_plugin->setOverrideClickTarget("_external");
 		}
+#endif
 	}
 
 	return TRUE;
@@ -154,6 +168,13 @@ BOOL LLFloaterTOS::postBuild()
 
 void LLFloaterTOS::setSiteIsAlive( bool alive )
 {
+// if we are forced to send users to an external site in their system browser
+// (e.g.) Linux users because of lack of media support for HTML ToS page
+// force the regular HTML UI to deactivate so alternative is rendered instead.
+#ifdef EXTERNAL_TOS
+	mSiteAlive = false;
+#else
+
 	mSiteAlive = alive;
 	
 	// only do this for TOS pages
@@ -182,6 +203,7 @@ void LLFloaterTOS::setSiteIsAlive( bool alive )
 			tos_agreement->setEnabled( true );
 		}
 	}
+#endif
 }
 
 LLFloaterTOS::~LLFloaterTOS()
diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp
index 0be6e49834..b37e41fb85 100755
--- a/indra/newview/llweb.cpp
+++ b/indra/newview/llweb.cpp
@@ -234,6 +234,9 @@ std::string LLWeb::expandURLSubstitutions(const std::string &url,
 //static
 bool LLWeb::useExternalBrowser(const std::string &url)
 {
+#ifdef EXTERNAL_TOS
+	return true;
+#else
 	if (gSavedSettings.getU32("PreferredBrowserBehavior") == BROWSER_EXTERNAL_ONLY)
 	{
 		return true;
@@ -250,4 +253,5 @@ bool LLWeb::useExternalBrowser(const std::string &url)
 		return !(boost::regex_search(uri_string, matches, pattern));
 	}
 	return false;
+#endif
 }
diff --git a/indra/newview/skins/default/xui/en/floater_tos.xml b/indra/newview/skins/default/xui/en/floater_tos.xml
index af1617eb39..c5313391c6 100755
--- a/indra/newview/skins/default/xui/en/floater_tos.xml
+++ b/indra/newview/skins/default/xui/en/floater_tos.xml
@@ -57,6 +57,21 @@
      width="552">
         Please read the following Terms of Service and Privacy Policy carefully. To continue logging in to [SECOND_LIFE], you must accept the agreement.
     </text>
+     <text
+     type="string"
+     length="1"
+     follows="left|top"
+     font="SansSerif"
+     height="30"
+     layout="topleft"
+     left="16"
+     name="external_tos_required"
+     visible="false"
+     top="32"
+     word_wrap="true"
+     width="552">
+       To continue logging in to [SECOND_LIFE], you must accept the [https://id.secondlife.com/openid/login?return_to=https%3A%2F%2Fmy.secondlife.com%2Fopenid Terms of Service and Privacy Policy].
+     </text>
     <web_browser
       trusted_content="true" 
      follows="left|top"
-- 
cgit v1.2.3


From e63aeb29ab8e0c173f17a2c343c66ab4ef84c0ad Mon Sep 17 00:00:00 2001
From: callum_linden <none@none>
Date: Mon, 16 Nov 2015 10:55:00 -0800
Subject: Fix MAINT-5855 media navigation bars overlap all floaters in viewer

---
 indra/newview/llviewerwindow.cpp | 1 +
 1 file changed, 1 insertion(+)

(limited to 'indra/newview')

diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 86a90a2c24..4d1cacca1f 100755
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -2022,6 +2022,7 @@ void LLViewerWindow::initWorldUI()
 		}
 		gHUDView = new LLHUDView(hud_rect);
 		getRootView()->addChild(gHUDView);
+		getRootView()->sendChildToBack(gHUDView);
 	}
 
 	LLPanel* panel_ssf_container = getRootView()->getChild<LLPanel>("state_management_buttons_container");
-- 
cgit v1.2.3


From 311b376ab50bacf2bf113616af2a5bbedfcd5ee5 Mon Sep 17 00:00:00 2001
From: callum_linden <none@none>
Date: Mon, 16 Nov 2015 16:09:40 -0800
Subject: Update SetCookie code for new LLCEFLib API and add support for
 shoing/hising developer console (Inspector)

---
 indra/newview/llviewermedia.cpp | 11 ++++++++---
 indra/newview/llviewermedia.h   |  2 +-
 2 files changed, 9 insertions(+), 4 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 626938f7b5..cc56a9db8d 100755
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -1390,7 +1390,7 @@ LLSD LLViewerMedia::getHeaders()
 
  /////////////////////////////////////////////////////////////////////////////////////////
  // static
-bool LLViewerMedia::parseRawCookie(const std::string raw_cookie, std::string& name, std::string& value, std::string& path)
+bool LLViewerMedia::parseRawCookie(const std::string raw_cookie, std::string& name, std::string& value, std::string& path, bool& httponly, bool& secure)
 {
 	std::size_t name_pos = raw_cookie.find_first_of("=");
 	if (name_pos != std::string::npos)
@@ -1402,6 +1402,9 @@ bool LLViewerMedia::parseRawCookie(const std::string raw_cookie, std::string& na
 			value = raw_cookie.substr(name_pos + 1, value_pos - name_pos - 1);
 			path = "/";	// assume root path for now
 
+			httponly = true;	// hard coded for now
+			secure = true;
+
 			return true;
 		}
 	}
@@ -1450,10 +1453,12 @@ void LLViewerMedia::setOpenIDCookie(const std::string& url)
 				std::string cookie_name = "";
 				std::string cookie_value = "";
 				std::string cookie_path = "";
-				if (parseRawCookie(sOpenIDCookie, cookie_name, cookie_value, cookie_path) &&
+				bool httponly = true;
+				bool secure = true;
+				if (parseRawCookie(sOpenIDCookie, cookie_name, cookie_value, cookie_path, httponly, secure) &&
                     media_instance->getMediaPlugin())
 				{
-					media_instance->getMediaPlugin()->setCookie(url, cookie_name, cookie_value, cookie_host, cookie_path);
+					media_instance->getMediaPlugin()->setCookie(url, cookie_name, cookie_value, cookie_host, cookie_path, httponly, secure);
 				}
 			}
 		}
diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h
index 4ee1b56a2a..01d4b0786f 100755
--- a/indra/newview/llviewermedia.h
+++ b/indra/newview/llviewermedia.h
@@ -163,7 +163,7 @@ public:
 	static LLSD getHeaders();
 	
 private:
-	static bool parseRawCookie(const std::string raw_cookie, std::string& name, std::string& value, std::string& path);
+	static bool parseRawCookie(const std::string raw_cookie, std::string& name, std::string& value, std::string& path, bool& httponly, bool& secure);
 	static void setOpenIDCookie(const std::string& url);
 	static void onTeleportFinished();
 	
-- 
cgit v1.2.3


From d61e1ce11ab35b54141eff355e1477ff8172aa41 Mon Sep 17 00:00:00 2001
From: Rider Linden <rider@lindenlab.com>
Date: Thu, 19 Nov 2015 10:23:32 -0800
Subject: MAINT-5846: Change media roll of begining to 10m

---
 indra/newview/app_settings/settings.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'indra/newview')

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 6fac330db4..bedbed2dcc 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -8081,7 +8081,7 @@
     <key>Type</key>
     <string>F32</string>
     <key>Value</key>
-    <real>5.0</real>
+    <real>10.0</real>
   </map>
   <key>MediaRollOffMax</key>
   <map>
-- 
cgit v1.2.3


From b5c4565c62433d603a673d94f691c687ac907c7d Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Wed, 25 Nov 2015 15:33:05 -0500
Subject: MAINT-5901: Make avatar auto pilot work correctly through transparent
 objects

---
 indra/newview/lltoolpie.cpp | 86 ++++++++++++++++++++++++++++++++-------------
 1 file changed, 61 insertions(+), 25 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp
index 2081297717..60a7d284ef 100755
--- a/indra/newview/lltoolpie.cpp
+++ b/indra/newview/lltoolpie.cpp
@@ -106,7 +106,7 @@ BOOL LLToolPie::handleMouseDown(S32 x, S32 y, MASK mask)
 	mMouseDownX = x;
 	mMouseDownY = y;
 
-	//left mouse down always picks transparent
+	//left mouse down always picks transparent (but see handleMouseUp)
 	mPick = gViewerWindow->pickImmediate(x, y, TRUE);
 	mPick.mKeyMask = mask;
 
@@ -661,30 +661,52 @@ BOOL LLToolPie::handleMouseUp(S32 x, S32 y, MASK mask)
 		&& gAgentAvatarp
 		&& !gAgentAvatarp->isSitting()
 		&& !mBlockClickToWalk							// another behavior hasn't cancelled click to walk
-		&& !mPick.mPosGlobal.isExactlyZero()			// valid coordinates for pick
-		&& (mPick.mPickType == LLPickInfo::PICK_LAND	// we clicked on land
-			|| mPick.mObjectID.notNull()))				// or on an object
-	{
-		// handle special cases of steering picks
-		LLViewerObject* avatar_object = mPick.getObject();
-
-		// get pointer to avatar
-		while (avatar_object && !avatar_object->isAvatar())
-		{
-			avatar_object = (LLViewerObject*)avatar_object->getParent();
-		}
-
-		if (avatar_object && ((LLVOAvatar*)avatar_object)->isSelf())
-		{
-			const F64 SELF_CLICK_WALK_DISTANCE = 3.0;
-			// pretend we picked some point a bit in front of avatar
-			mPick.mPosGlobal = gAgent.getPositionGlobal() + LLVector3d(LLViewerCamera::instance().getAtAxis()) * SELF_CLICK_WALK_DISTANCE;
-		}
-		gAgentCamera.setFocusOnAvatar(TRUE, TRUE);
-		walkToClickedLocation();
-		LLFirstUse::notMoving(false);
-
-		return TRUE;
+        )
+	{
+        // We may be doing click to walk, but we don't want to use a target on
+        // a transparent object because the user thought they were clicking on
+        // whatever they were seeing through it, so recompute what was clicked on
+        // ignoring transparent objects
+        LLPickInfo savedPick = mPick;
+        mPick = gViewerWindow->pickImmediate(savedPick.mMousePt.mX, savedPick.mMousePt.mY,
+                                             FALSE /* ignore transparent */,
+                                             FALSE /* ignore particles */);
+
+        if (!mPick.mPosGlobal.isExactlyZero()			// valid coordinates for pick
+            && (mPick.mPickType == LLPickInfo::PICK_LAND	// we clicked on land
+                || mPick.mObjectID.notNull()))				// or on an object
+        {
+            // handle special cases of steering picks
+            LLViewerObject* avatar_object = mPick.getObject();
+
+            // get pointer to avatar
+            while (avatar_object && !avatar_object->isAvatar())
+            {
+                avatar_object = (LLViewerObject*)avatar_object->getParent();
+            }
+
+            if (avatar_object && ((LLVOAvatar*)avatar_object)->isSelf())
+            {
+                const F64 SELF_CLICK_WALK_DISTANCE = 3.0;
+                // pretend we picked some point a bit in front of avatar
+                mPick.mPosGlobal = gAgent.getPositionGlobal() + LLVector3d(LLViewerCamera::instance().getAtAxis()) * SELF_CLICK_WALK_DISTANCE;
+            }
+            gAgentCamera.setFocusOnAvatar(TRUE, TRUE);
+            walkToClickedLocation();
+            LLFirstUse::notMoving(false);
+
+            return TRUE;
+        }
+        else
+        {
+            LL_DEBUGS("maint5901") << "walk target was "
+                                   << (mPick.mPosGlobal.isExactlyZero() ? "zero" : "not zero")
+                                   << ", pick type was " << (mPick.mPickType == LLPickInfo::PICK_LAND ? "land" : "not land")
+                                   << ", pick object was " << mPick.mObjectID
+                                   << LL_ENDL;
+            // we didn't click to walk, so restore the original target
+            mPick = savedPick;
+        }
 	}
 	gViewerWindow->setCursor(UI_CURSOR_ARROW);
 	if (hasMouseCapture())
@@ -718,12 +740,26 @@ BOOL LLToolPie::handleDoubleClick(S32 x, S32 y, MASK mask)
 
 	if (gSavedSettings.getBOOL("DoubleClickAutoPilot"))
 	{
+        // We may be doing double click to walk, but we don't want to use a target on
+        // a transparent object because the user thought they were clicking on
+        // whatever they were seeing through it, so recompute what was clicked on
+        // ignoring transparent objects
+        LLPickInfo savedPick = mPick;
+        mPick = gViewerWindow->pickImmediate(savedPick.mMousePt.mX, savedPick.mMousePt.mY,
+                                             FALSE /* ignore transparent */,
+                                             FALSE /* ignore particles */);
+
 		if ((mPick.mPickType == LLPickInfo::PICK_LAND && !mPick.mPosGlobal.isExactlyZero()) ||
 			(mPick.mObjectID.notNull()  && !mPick.mPosGlobal.isExactlyZero()))
 		{
 			walkToClickedLocation();
 			return TRUE;
 		}
+        else
+        {
+            // restore the original pick for any other purpose
+            mPick = savedPick;
+        }
 	}
 	else if (gSavedSettings.getBOOL("DoubleClickTeleport"))
 	{
-- 
cgit v1.2.3


From c3877be95468b3c26157cc98e9d40e264645a883 Mon Sep 17 00:00:00 2001
From: callum_linden <none@none>
Date: Fri, 4 Dec 2015 11:21:32 -0800
Subject: MAINT-5941 [Valhalla] Default flash to on by default (reverts
 MAINT-5773)

---
 indra/newview/app_settings/settings.xml | 108 ++++++++++++++++----------------
 1 file changed, 54 insertions(+), 54 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index bedbed2dcc..1fdfdb51a8 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -734,7 +734,7 @@
       <string>F32</string>
       <key>Value</key>
       <integer>60</integer>
-    </map>  
+    </map>
     <key>AvatarRotateThresholdFast</key>
     <map>
       <key>Comment</key>
@@ -745,7 +745,7 @@
       <string>F32</string>
       <key>Value</key>
       <integer>2</integer>
-    </map>  
+    </map>
     <key>AvatarBakedTextureUploadTimeout</key>
     <map>
       <key>Comment</key>
@@ -1339,7 +1339,7 @@
       <string>String</string>
       <key>Value</key>
       <string />
-    </map>	
+    </map>
     <key>CacheNumberOfRegionsForObjects</key>
     <map>
       <key>Comment</key>
@@ -2005,7 +2005,7 @@
       <key>Type</key>
       <string>Boolean</string>
       <key>Value</key>
-      <integer>0</integer>
+      <integer>1</integer>
     </map>
     <key>ChatBarCustomWidth</key>
     <map>
@@ -3788,7 +3788,7 @@
       <string>Boolean</string>
       <key>Value</key>
       <integer>0</integer>
-    </map>	
+    </map>
 	<key>FirstSelectedEnabledPopups</key>
     <map>
       <key>Comment</key>
@@ -3799,7 +3799,7 @@
       <string>Boolean</string>
       <key>Value</key>
       <integer>0</integer>
-    </map>		
+    </map>
     <key>FixedWeather</key>
     <map>
       <key>Comment</key>
@@ -3921,7 +3921,7 @@
       <key>Value</key>
       <string>SW</string>
     </map>
-  
+
     <key>FloaterStatisticsRect</key>
     <map>
       <key>Comment</key>
@@ -4448,7 +4448,7 @@
       <string>String</string>
       <key>Value</key>
       <string>http://lecs-viewer-web-components.s3.amazonaws.com/v3.0/[GRID_LOWERCASE]/howto/index.html</string>
-    </map>    
+    </map>
     <key>HomeSidePanelURL</key>
     <map>
       <key>Comment</key>
@@ -4514,7 +4514,7 @@
       <string>Boolean</string>
       <key>Value</key>
       <integer>0</integer>
-    </map>	
+    </map>
     <key>HostID</key>
     <map>
       <key>Comment</key>
@@ -4602,7 +4602,7 @@
       <string>Boolean</string>
       <key>Value</key>
       <integer>0</integer>
-    </map>  
+    </map>
     <key>IgnorePixelDepth</key>
     <map>
       <key>Comment</key>
@@ -4657,7 +4657,7 @@
       <string>F32</string>
       <key>Value</key>
       <real>0.5</real>
-    </map> 
+    </map>
 	<key>InspectorShowTime</key>
     <map>
       <key>Comment</key>
@@ -4668,7 +4668,7 @@
       <string>F32</string>
       <key>Value</key>
       <real>3.0</real>
-    </map> 
+    </map>
     <key>InstallLanguage</key>
     <map>
       <key>Comment</key>
@@ -5230,7 +5230,7 @@
       <key>Value</key>
       <string>0.0.0</string>
     </map>
-  
+
     <key>LastSnapshotToProfileHeight</key>
     <map>
       <key>Comment</key>
@@ -6309,7 +6309,7 @@
       <string>Boolean</string>
       <key>Value</key>
       <integer>0</integer>
-    </map>  
+    </map>
     <key>MenuAccessKeyTime</key>
     <map>
       <key>Comment</key>
@@ -6474,7 +6474,7 @@
       <string>Boolean</string>
       <key>Value</key>
       <integer>0</integer>
-    </map> 
+    </map>
     <key>MouseSun</key>
     <map>
       <key>Comment</key>
@@ -6639,7 +6639,7 @@
       <string>String</string>
       <key>Value</key>
       <string />
-    </map>	
+    </map>
     <key>NextLoginLocation</key>
     <map>
       <key>Comment</key>
@@ -6763,7 +6763,7 @@
       <string>String</string>
       <key>Value</key>
       <string>toast</string>
-    </map>  
+    </map>
     <key>NotificationFriendIMOptions</key>
     <map>
       <key>Comment</key>
@@ -6819,7 +6819,7 @@
       <string>String</string>
       <key>Value</key>
       <string>toast</string>
-    </map>  
+    </map>
     <key>NotificationObjectIMOptions</key>
     <map>
       <key>Comment</key>
@@ -6833,7 +6833,7 @@
       <string>String</string>
       <key>Value</key>
       <string>toast</string>
-    </map>  
+    </map>
     <key>NotificationToastLifeTime</key>
     <map>
       <key>Comment</key>
@@ -7392,7 +7392,7 @@
       <string>Boolean</string>
       <key>Value</key>
       <integer>0</integer>
-    </map>  
+    </map>
     <key>PlaySoundFriendIM</key>
     <map>
       <key>Comment</key>
@@ -7503,7 +7503,7 @@
       <key>Value</key>
       <real>0.9</real>
     </map>
-    
+
    <key>PlainTextChatHistory</key>
     <map>
       <key>Comment</key>
@@ -7515,7 +7515,7 @@
       <key>Value</key>
       <integer>0</integer>
     </map>
-    
+
     <key>PluginInstancesLow</key>
     <map>
       <key>Comment</key>
@@ -7769,7 +7769,7 @@
       <real>0.4</real>
     </array>
   </map>
-  
+
   <key>PreviewDirection2</key>
   <map>
     <key>Comment</key>
@@ -8379,7 +8379,7 @@
   <key>RenderComplexityStaticMax</key>
     <map>
       <key>Comment</key>
-      <string>Sets a static max value for scaling of RenderComplexity 
+      <string>Sets a static max value for scaling of RenderComplexity
         display (-1 for dynamic scaling)</string>
       <key>Persist</key>
       <integer>1</integer>
@@ -8457,7 +8457,7 @@
       <key>Value</key>
       <integer>0</integer>
     </map>
-   
+
   <key>RenderLocalLights</key>
   <map>
     <key>Comment</key>
@@ -8684,7 +8684,7 @@
       <key>Persist</key>
       <integer>1</integer>
       <key>Type</key>
-      <string>Boolean</string> 
+      <string>Boolean</string>
       <key>Value</key>
       <integer>0</integer>
     </map>
@@ -8721,7 +8721,7 @@
     <key>Value</key>
     <integer>0</integer>
   </map>
- 
+
   <key>RenderAnimateRes</key>
   <map>
     <key>Comment</key>
@@ -8894,7 +8894,7 @@
     <key>Value</key>
     <integer>0</integer>
   </map>
-  
+
   <key>RenderDepthOfField</key>
   <map>
     <key>Comment</key>
@@ -9023,7 +9023,7 @@
     <key>Value</key>
     <real>0.1</real>
   </map>
-  
+
   <key>RenderHighlightBrightness</key>
   <map>
     <key>Comment</key>
@@ -9047,7 +9047,7 @@
     <key>Value</key>
     <real>0.6</real>
   </map>
-  
+
   <key>RenderHighlightColor</key>
   <map>
     <key>Comment</key>
@@ -9076,7 +9076,7 @@
     <key>Value</key>
     <integer>0</integer>
   </map>
-  
+
   <key>RenderSpecularResX</key>
   <map>
     <key>Comment</key>
@@ -9981,7 +9981,7 @@
       <key>Value</key>
       <integer>1</integer>
     </map>
-  
+
   <key>RenderAutoMuteByteLimit</key>
   <map>
     <key>Comment</key>
@@ -10036,7 +10036,7 @@
     <string>Boolean</string>
     <key>Value</key>
     <integer>0</integer>
-  </map>    
+  </map>
   <key>RenderAutoHideSurfaceAreaLimit</key>
   <map>
     <key>Comment</key>
@@ -10522,7 +10522,7 @@
       <string>Boolean</string>
       <key>Value</key>
       <integer>0</integer>
-    </map>	
+    </map>
     <key>SelectMovableOnly</key>
     <map>
       <key>Comment</key>
@@ -10764,7 +10764,7 @@
       <string>Boolean</string>
       <key>Value</key>
       <integer>1</integer>
-    </map>	
+    </map>
     <key>ShowCrosshairs</key>
     <map>
       <key>Comment</key>
@@ -10841,7 +10841,7 @@
       <string>Boolean</string>
       <key>Value</key>
       <integer>0</integer>
-    </map>    
+    </map>
     <key>ShowMiniMapButton</key>
     <map>
       <key>Comment</key>
@@ -10908,7 +10908,7 @@
       <key>Value</key>
       <integer>1</integer>
     </map>
-    <key>ShowObjectRenderingCost</key>                
+    <key>ShowObjectRenderingCost</key>
     <map>
       <key>Comment</key>
       <string>Show the object rendering cost  in  build tools</string>
@@ -10917,9 +10917,9 @@
       <key>Type</key>
       <string>Boolean</string>
       <key>Value</key>
-      <integer>1</integer>   
-    </map>        
-    <key>ShowNavbarFavoritesPanel</key>    
+      <integer>1</integer>
+    </map>
+    <key>ShowNavbarFavoritesPanel</key>
     <map>
       <key>Comment</key>
       <string>Show/hide navigation bar favorites panel</string>
@@ -10928,9 +10928,9 @@
       <key>Type</key>
       <string>Boolean</string>
       <key>Value</key>
-      <integer>1</integer>   
+      <integer>1</integer>
     </map>
-    <key>ShowNavbarNavigationPanel</key>        
+    <key>ShowNavbarNavigationPanel</key>
     <map>
       <key>Comment</key>
       <string>Show/hide navigation bar navigation panel</string>
@@ -10939,7 +10939,7 @@
       <key>Type</key>
       <string>Boolean</string>
       <key>Value</key>
-      <integer>1</integer>   
+      <integer>1</integer>
     </map>
     <key>ShowWorldMapButton</key>
     <map>
@@ -11095,7 +11095,7 @@
       <key>Value</key>
       <integer>1</integer>
     </map>
-    <key>ShowPGSearchAll</key>    
+    <key>ShowPGSearchAll</key>
     <map>
       <key>Comment</key>
       <string>Display results of search All that are flagged as general</string>
@@ -11611,7 +11611,7 @@
       <string>S32</string>
       <key>Value</key>
       <integer>0</integer>
-    </map>  
+    </map>
     <key>SnapshotQuality</key>
     <map>
       <key>Comment</key>
@@ -12480,7 +12480,7 @@
       <string>String</string>
       <key>Value</key>
       <string>B56AF90D-6684-48E4-B1E4-722D3DEB2CB6</string>
-    </map>  
+    </map>
     <key>NearByChatChannelUUID</key>
     <map>
       <key>Comment</key>
@@ -12491,7 +12491,7 @@
       <string>String</string>
       <key>Value</key>
       <string>E1158BD6-661C-4981-9DAD-4DCBFF062502</string>
-    </map>  
+    </map>
     <key>NotificationChannelUUID</key>
     <map>
       <key>Comment</key>
@@ -12502,7 +12502,7 @@
       <string>String</string>
       <key>Value</key>
       <string>AEED3193-8709-4693-8558-7452CCA97AE5</string>
-    </map>  
+    </map>
     <key>AlertChannelUUID</key>
     <map>
       <key>Comment</key>
@@ -12513,7 +12513,7 @@
       <string>String</string>
       <key>Value</key>
       <string>F3E07BC8-A973-476D-8C7F-F3B7293975D1</string>
-    </map>  
+    </map>
     <key>UIImgWhiteUUID</key>
     <map>
       <key>Comment</key>
@@ -12535,7 +12535,7 @@
       <string>S32</string>
       <key>Value</key>
       <integer>2</integer>
-    </map> 
+    </map>
     <key>UIMaxComboWidth</key>
     <map>
       <key>Comment</key>
@@ -13448,7 +13448,7 @@
       <string>String</string>
       <key>Value</key>
       <string>[i800,i600]</string>
-    </map>  
+    </map>
     <key>sourceid</key>
     <map>
       <key>Comment</key>
@@ -14669,7 +14669,7 @@
       <string>Boolean</string>
       <key>Value</key>
       <integer>1</integer>
-    </map>    
+    </map>
     <key>EnablePlaceProfile</key>
     <map>
       <key>Comment</key>
@@ -15491,7 +15491,7 @@
     <key>Value</key>
     <integer>0</integer>
   </map>
-  
+
   <key>PathfindingLineWidth</key>
   <map>
     <key>Comment</key>
@@ -15532,7 +15532,7 @@
         <real>1.0</real>
       </array>
     </map>
-    
+
     <key>HideUIControls</key>
     <map>
       <key>Comment</key>
-- 
cgit v1.2.3


From 9384eac91b974dfd918d0edf6022cc3e0b0c9daf Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Wed, 9 Dec 2015 07:36:06 -0500
Subject: MAINT-5862: Change the Linux wording in the ToS floater per Grumpity.

---
 indra/newview/skins/default/xui/en/floater_tos.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'indra/newview')

diff --git a/indra/newview/skins/default/xui/en/floater_tos.xml b/indra/newview/skins/default/xui/en/floater_tos.xml
index c5313391c6..590d9d1844 100755
--- a/indra/newview/skins/default/xui/en/floater_tos.xml
+++ b/indra/newview/skins/default/xui/en/floater_tos.xml
@@ -70,7 +70,7 @@
      top="32"
      word_wrap="true"
      width="552">
-       To continue logging in to [SECOND_LIFE], you must accept the [https://id.secondlife.com/openid/login?return_to=https%3A%2F%2Fmy.secondlife.com%2Fopenid Terms of Service and Privacy Policy].
+       You will need to go to my.secondlife.com and log in to accept the Terms of Service before you can proceed. Thank you!
      </text>
     <web_browser
       trusted_content="true" 
-- 
cgit v1.2.3


From 3e46058651570f8e3a8cd20b597544bb07fea0a9 Mon Sep 17 00:00:00 2001
From: Rider Linden <rider@lindenlab.com>
Date: Mon, 14 Dec 2015 14:14:29 -0800
Subject: MAINT-5962: Added routine for checking MoaP double click and
 forwarding those double click events into to the plugin.

---
 indra/newview/lltoolpie.cpp     | 141 ++++++++++++++++++++++++++++------------
 indra/newview/lltoolpie.h       |   3 +-
 indra/newview/llviewermedia.cpp |  11 ++++
 indra/newview/llviewermedia.h   |   3 +-
 4 files changed, 115 insertions(+), 43 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp
index 60a7d284ef..4d41c792ca 100755
--- a/indra/newview/lltoolpie.cpp
+++ b/indra/newview/lltoolpie.cpp
@@ -738,6 +738,11 @@ BOOL LLToolPie::handleDoubleClick(S32 x, S32 y, MASK mask)
 		LL_INFOS() << "LLToolPie handleDoubleClick (becoming mouseDown)" << LL_ENDL;
 	}
 
+    if (handleMediaDblClick(mPick))
+    {
+        return TRUE;
+    }
+
 	if (gSavedSettings.getBOOL("DoubleClickAutoPilot"))
 	{
         // We may be doing double click to walk, but we don't want to use a target on
@@ -1440,56 +1445,110 @@ static void handle_click_action_play()
 
 bool LLToolPie::handleMediaClick(const LLPickInfo& pick)
 {
-	//FIXME: how do we handle object in different parcel than us?
-	LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
-	LLPointer<LLViewerObject> objectp = pick.getObject();
+    //FIXME: how do we handle object in different parcel than us?
+    LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
+    LLPointer<LLViewerObject> objectp = pick.getObject();
 
 
-	if (!parcel ||
-		objectp.isNull() ||
-		pick.mObjectFace < 0 || 
-		pick.mObjectFace >= objectp->getNumTEs()) 
-	{
-		LLViewerMediaFocus::getInstance()->clearFocus();
+    if (!parcel ||
+        objectp.isNull() ||
+        pick.mObjectFace < 0 ||
+        pick.mObjectFace >= objectp->getNumTEs())
+    {
+        LLViewerMediaFocus::getInstance()->clearFocus();
 
-		return false;
-	}
+        return false;
+    }
 
-	// Does this face have media?
-	const LLTextureEntry* tep = objectp->getTE(pick.mObjectFace);
-	if(!tep)
-		return false;
+    // Does this face have media?
+    const LLTextureEntry* tep = objectp->getTE(pick.mObjectFace);
+    if (!tep)
+        return false;
 
-	LLMediaEntry* mep = (tep->hasMedia()) ? tep->getMediaData() : NULL;
-	if(!mep)
-		return false;
-	
-	viewer_media_t media_impl = LLViewerMedia::getMediaImplFromTextureID(mep->getMediaID());
+    LLMediaEntry* mep = (tep->hasMedia()) ? tep->getMediaData() : NULL;
+    if (!mep)
+        return false;
 
-	if (gSavedSettings.getBOOL("MediaOnAPrimUI"))
-	{
-		if (!LLViewerMediaFocus::getInstance()->isFocusedOnFace(pick.getObject(), pick.mObjectFace) || media_impl.isNull())
-		{
-			// It's okay to give this a null impl
-			LLViewerMediaFocus::getInstance()->setFocusFace(pick.getObject(), pick.mObjectFace, media_impl, pick.mNormal);
-		}
-		else
-		{
-			// Make sure keyboard focus is set to the media focus object.
-			gFocusMgr.setKeyboardFocus(LLViewerMediaFocus::getInstance());
-			LLEditMenuHandler::gEditMenuHandler = LLViewerMediaFocus::instance().getFocusedMediaImpl();
-			
-			media_impl->mouseDown(pick.mUVCoords, gKeyboard->currentMask(TRUE));
-			mMediaMouseCaptureID = mep->getMediaID();
-			setMouseCapture(TRUE);  // This object will send a mouse-up to the media when it loses capture.
-		}
+    viewer_media_t media_impl = LLViewerMedia::getMediaImplFromTextureID(mep->getMediaID());
 
-		return true;
-	}
+    if (gSavedSettings.getBOOL("MediaOnAPrimUI"))
+    {
+        if (!LLViewerMediaFocus::getInstance()->isFocusedOnFace(pick.getObject(), pick.mObjectFace) || media_impl.isNull())
+        {
+            // It's okay to give this a null impl
+            LLViewerMediaFocus::getInstance()->setFocusFace(pick.getObject(), pick.mObjectFace, media_impl, pick.mNormal);
+        }
+        else
+        {
+            // Make sure keyboard focus is set to the media focus object.
+            gFocusMgr.setKeyboardFocus(LLViewerMediaFocus::getInstance());
+            LLEditMenuHandler::gEditMenuHandler = LLViewerMediaFocus::instance().getFocusedMediaImpl();
 
-	LLViewerMediaFocus::getInstance()->clearFocus();
+            media_impl->mouseDown(pick.mUVCoords, gKeyboard->currentMask(TRUE));
+            mMediaMouseCaptureID = mep->getMediaID();
+            setMouseCapture(TRUE);  // This object will send a mouse-up to the media when it loses capture.
+        }
 
-	return false;
+        return true;
+    }
+
+    LLViewerMediaFocus::getInstance()->clearFocus();
+
+    return false;
+}
+
+bool LLToolPie::handleMediaDblClick(const LLPickInfo& pick)
+{
+    //FIXME: how do we handle object in different parcel than us?
+    LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
+    LLPointer<LLViewerObject> objectp = pick.getObject();
+
+
+    if (!parcel ||
+        objectp.isNull() ||
+        pick.mObjectFace < 0 ||
+        pick.mObjectFace >= objectp->getNumTEs())
+    {
+        LLViewerMediaFocus::getInstance()->clearFocus();
+
+        return false;
+    }
+
+    // Does this face have media?
+    const LLTextureEntry* tep = objectp->getTE(pick.mObjectFace);
+    if (!tep)
+        return false;
+
+    LLMediaEntry* mep = (tep->hasMedia()) ? tep->getMediaData() : NULL;
+    if (!mep)
+        return false;
+
+    viewer_media_t media_impl = LLViewerMedia::getMediaImplFromTextureID(mep->getMediaID());
+
+    if (gSavedSettings.getBOOL("MediaOnAPrimUI"))
+    {
+        if (!LLViewerMediaFocus::getInstance()->isFocusedOnFace(pick.getObject(), pick.mObjectFace) || media_impl.isNull())
+        {
+            // It's okay to give this a null impl
+            LLViewerMediaFocus::getInstance()->setFocusFace(pick.getObject(), pick.mObjectFace, media_impl, pick.mNormal);
+        }
+        else
+        {
+            // Make sure keyboard focus is set to the media focus object.
+            gFocusMgr.setKeyboardFocus(LLViewerMediaFocus::getInstance());
+            LLEditMenuHandler::gEditMenuHandler = LLViewerMediaFocus::instance().getFocusedMediaImpl();
+
+            media_impl->mouseDoubleClick(pick.mUVCoords, gKeyboard->currentMask(TRUE));
+            mMediaMouseCaptureID = mep->getMediaID();
+            setMouseCapture(TRUE);  // This object will send a mouse-up to the media when it loses capture.
+        }
+
+        return true;
+    }
+
+    LLViewerMediaFocus::getInstance()->clearFocus();
+
+    return false;
 }
 
 bool LLToolPie::handleMediaHover(const LLPickInfo& pick)
diff --git a/indra/newview/lltoolpie.h b/indra/newview/lltoolpie.h
index 68fe8bc4a5..c4a2f4a35b 100755
--- a/indra/newview/lltoolpie.h
+++ b/indra/newview/lltoolpie.h
@@ -88,7 +88,8 @@ private:
 	ECursorType cursorFromObject(LLViewerObject* object);
 
 	bool handleMediaClick(const LLPickInfo& info);
-	bool handleMediaHover(const LLPickInfo& info);
+    bool handleMediaDblClick(const LLPickInfo& info);
+    bool handleMediaHover(const LLPickInfo& info);
 	bool handleMediaMouseUp(); 
 	BOOL handleTooltipLand(std::string line, std::string tooltip_msg);
 	BOOL handleTooltipObject( LLViewerObject* hover_object, std::string line, std::string tooltip_msg);
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index cc56a9db8d..ab685205cf 100755
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -2426,6 +2426,17 @@ void LLViewerMediaImpl::mouseMove(const LLVector2& texture_coords, MASK mask)
 	}
 }
 
+void LLViewerMediaImpl::mouseDoubleClick(const LLVector2& texture_coords, MASK mask)
+{
+    if (mMediaSource)
+    {
+        S32 x, y;
+        scaleTextureCoords(texture_coords, &x, &y);
+
+        mouseDoubleClick(x, y, mask);
+    }
+}
+
 //////////////////////////////////////////////////////////////////////////////////////////
 void LLViewerMediaImpl::mouseDoubleClick(S32 x, S32 y, MASK mask, S32 button)
 {
diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h
index 01d4b0786f..ede408dd0c 100755
--- a/indra/newview/llviewermedia.h
+++ b/indra/newview/llviewermedia.h
@@ -226,7 +226,8 @@ public:
 	void mouseDown(const LLVector2& texture_coords, MASK mask, S32 button = 0);
 	void mouseUp(const LLVector2& texture_coords, MASK mask, S32 button = 0);
 	void mouseMove(const LLVector2& texture_coords, MASK mask);
-	void mouseDoubleClick(S32 x,S32 y, MASK mask, S32 button = 0);
+    void mouseDoubleClick(const LLVector2& texture_coords, MASK mask);
+    void mouseDoubleClick(S32 x, S32 y, MASK mask, S32 button = 0);
 	void scrollWheel(S32 x, S32 y, MASK mask);
 	void mouseCapture();
 	
-- 
cgit v1.2.3


From 3bf8929d932a6253177be55766cd2a80bb6e224d Mon Sep 17 00:00:00 2001
From: callum_linden <none@none>
Date: Tue, 15 Dec 2015 15:24:41 -0800
Subject: MAINT-5966 - file download failures need feedback

---
 indra/newview/llmediactrl.cpp                        |  8 ++++++++
 indra/newview/llviewermedia.cpp                      |  7 +++++++
 indra/newview/skins/default/xui/en/notifications.xml | 17 +++++++++++++++--
 3 files changed, 30 insertions(+), 2 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp
index 9b8e24a8e8..9cf3249983 100755
--- a/indra/newview/llmediactrl.cpp
+++ b/indra/newview/llmediactrl.cpp
@@ -57,6 +57,7 @@
 #include "llbutton.h"
 #include "llcheckboxctrl.h"
 #include "llnotifications.h"
+#include "llnotificationsutil.h"
 #include "lllineeditor.h"
 #include "llfloaterwebcontent.h"
 #include "llwindowshade.h"
@@ -1093,6 +1094,13 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event)
 		};
 		break;
 
+		case MEDIA_EVENT_FILE_DOWNLOAD:
+		{
+			//llinfos << "Media event - file download requested - filename is " << self->getFileDownloadFilename() << llendl;
+			//LLNotificationsUtil::add("MediaFileDownloadUnsupported");
+		};
+		break;
+
 		case MEDIA_EVENT_DEBUG_MESSAGE:
 		{
 			LL_INFOS("media") << self->getDebugMessageText() << LL_ENDL; 
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index ab685205cf..ffae3c0e1f 100755
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -3300,6 +3300,13 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla
 		}
 		break;
 
+		case LLViewerMediaObserver::MEDIA_EVENT_FILE_DOWNLOAD:
+		{
+			//llinfos << "Media event - file download requested - filename is " << self->getFileDownloadFilename() << llendl;
+			LLNotificationsUtil::add("MediaFileDownloadUnsupported");
+		}
+		break;
+
 		case LLViewerMediaObserver::MEDIA_EVENT_NAVIGATE_BEGIN:
 		{
 			LL_DEBUGS("Media") << "MEDIA_EVENT_NAVIGATE_BEGIN, uri is: " << plugin->getNavigateURI() << LL_ENDL;
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 70ba4d5077..b4c5cba1fd 100755
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -1592,10 +1592,23 @@ The object may be out of range or may have been deleted.
    icon="alertmodal.tga"
    name="CannotDownloadFile"
    type="alertmodal">
-Unable to download file
-  <tag>fail</tag>
+    Unable to download file
+    <tag>fail</tag>
   </notification>
 
+  <notification
+  name="MediaFileDownloadUnsupported"
+  label=""
+  type="alert">
+    <unique/>
+    <tag>confirm</tag>
+    You have requested a file download, which is not supported within [SECOND_LIFE].
+    <usetemplate
+     ignoretext="Warn about unsupported file downloads"
+     name="okignore"
+     yestext="OK"/>
+  </notification>
+  
   <notification
    icon="alertmodal.tga"
    name="CannotWriteFile"
-- 
cgit v1.2.3


From e07c2f8491bf439fe895da6812d68f1887341625 Mon Sep 17 00:00:00 2001
From: callum_linden <none@none>
Date: Tue, 15 Dec 2015 16:34:06 -0800
Subject: Fix for OS X and Linux - their compilers do not like missing entries
 in case statement

---
 indra/newview/llviewerparcelmedia.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp
index 37b249dddd..fc275eb2f0 100755
--- a/indra/newview/llviewerparcelmedia.cpp
+++ b/indra/newview/llviewerparcelmedia.cpp
@@ -590,7 +590,13 @@ void LLViewerParcelMedia::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent
 			LL_DEBUGS("Media") <<  "Media event:  MEDIA_EVENT_PICK_FILE_REQUEST" << LL_ENDL;
 		}
 		break;
-
+		
+		case MEDIA_EVENT_FILE_DOWNLOAD:
+		{
+			LL_DEBUGS("Media") <<  "Media event:  MEDIA_EVENT_FILE_DOWNLOAD" << LL_ENDL;
+		}
+		break;
+		
 		case MEDIA_EVENT_GEOMETRY_CHANGE:
 		{
 			LL_DEBUGS("Media") << "Media event:  MEDIA_EVENT_GEOMETRY_CHANGE, uuid is " << self->getClickUUID() << LL_ENDL;
-- 
cgit v1.2.3


From dd3b3a4fcae6b144d9ca38e10f01872d2cc3ed6f Mon Sep 17 00:00:00 2001
From: callum_linden <none@none>
Date: Wed, 16 Dec 2015 18:09:30 -0800
Subject: maint-5875 fix llceflib_host.exe' error about missing MSVCP120.dll

---
 indra/newview/viewer_manifest.py | 6 ++++++
 1 file changed, 6 insertions(+)

(limited to 'indra/newview')

diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index 9a65171d44..f7992dba90 100755
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -471,6 +471,12 @@ class Windows_i686_Manifest(ViewerManifest):
                 self.path("wow_helper.exe")
                 self.end_prefix()
 
+        # MSVC DLLs needed for CEF and have to be in same directory as plugin
+        if self.prefix(src=os.path.join(os.pardir, 'sharedlibs', 'Release'), dst="llplugin"):
+            self.path("msvcp120.dll")
+            self.path("msvcr120.dll")
+            self.end_prefix()
+
         # CEF files common to all configurations
         if self.prefix(src=os.path.join(os.pardir, 'packages', 'resources'), dst="llplugin"):
             self.path("cef.pak")
-- 
cgit v1.2.3


From 7b993d15b70d419dc0a7c8d92286d34a2635537d Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Fri, 18 Dec 2015 06:30:19 -0500
Subject: increment viewer version to 4.0.1

---
 indra/newview/VIEWER_VERSION.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'indra/newview')

diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt
index fcdb2e109f..1454f6ed4b 100644
--- a/indra/newview/VIEWER_VERSION.txt
+++ b/indra/newview/VIEWER_VERSION.txt
@@ -1 +1 @@
-4.0.0
+4.0.1
-- 
cgit v1.2.3