aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmedia
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llmedia')
-rw-r--r--linden/indra/llmedia/llmediaimplllmozlib.cpp12
-rw-r--r--linden/indra/llmedia/llmediaimplllmozlib.h6
-rw-r--r--linden/indra/llmedia/llmediamanager.cpp8
-rw-r--r--linden/indra/llmedia/llmediamanager.h14
4 files changed, 31 insertions, 9 deletions
diff --git a/linden/indra/llmedia/llmediaimplllmozlib.cpp b/linden/indra/llmedia/llmediaimplllmozlib.cpp
index 9e2564a..b0d3eb5 100644
--- a/linden/indra/llmedia/llmediaimplllmozlib.cpp
+++ b/linden/indra/llmedia/llmediaimplllmozlib.cpp
@@ -103,9 +103,6 @@ bool LLMediaImplLLMozLib::startup( LLMediaManagerData* init_data )
103 init_data->getBrowserProfileDir(), 103 init_data->getBrowserProfileDir(),
104 init_data->getBrowserParentWindow() ); 104 init_data->getBrowserParentWindow() );
105 105
106 // append special string to the embedded browser user agent string
107 LLMozLib::getInstance()->setBrowserAgentId( init_data->getBrowserUserAgentId() );
108
109#if LL_LINUX 106#if LL_LINUX
110 setlocale(LC_ALL, saved_locale.c_str() ); 107 setlocale(LC_ALL, saved_locale.c_str() );
111#endif // LL_LINUX 108#endif // LL_LINUX
@@ -124,6 +121,15 @@ bool LLMediaImplLLMozLib::closedown()
124} 121}
125 122
126//////////////////////////////////////////////////////////////////////////////// 123////////////////////////////////////////////////////////////////////////////////
124// (static)
125bool LLMediaImplLLMozLib::setBrowserUserAgent(std::string user_agent)
126{
127 // append special string to the embedded browser user agent string
128 LLMozLib::getInstance()->setBrowserAgentId(user_agent);
129 return true;
130}
131
132////////////////////////////////////////////////////////////////////////////////
127// virtual 133// virtual
128bool LLMediaImplLLMozLib::init() 134bool LLMediaImplLLMozLib::init()
129{ 135{
diff --git a/linden/indra/llmedia/llmediaimplllmozlib.h b/linden/indra/llmedia/llmediaimplllmozlib.h
index fc5d4e5..4f6b0b7 100644
--- a/linden/indra/llmedia/llmediaimplllmozlib.h
+++ b/linden/indra/llmedia/llmediaimplllmozlib.h
@@ -51,6 +51,12 @@ class LLMediaImplLLMozLib :
51 static bool startup( LLMediaManagerData* init_data ); 51 static bool startup( LLMediaManagerData* init_data );
52 static bool closedown(); 52 static bool closedown();
53 53
54 // Update the user-agent string reported when the browser requests
55 // web page, because we need to include the Second Life version
56 // and skin name (which can change without restarts).
57 // Must be called after startup().
58 static bool setBrowserUserAgent(std::string user_agent);
59
54 /* virtual */ bool init(); 60 /* virtual */ bool init();
55 /* virtual */ std::string getVersion(); 61 /* virtual */ std::string getVersion();
56 /* virtual */ bool set404RedirectUrl( std::string redirect_url ); 62 /* virtual */ bool set404RedirectUrl( std::string redirect_url );
diff --git a/linden/indra/llmedia/llmediamanager.cpp b/linden/indra/llmedia/llmediamanager.cpp
index c9b673d..8d637c0 100644
--- a/linden/indra/llmedia/llmediamanager.cpp
+++ b/linden/indra/llmedia/llmediamanager.cpp
@@ -134,6 +134,14 @@ LLMediaManager* LLMediaManager::getInstance()
134} 134}
135 135
136//////////////////////////////////////////////////////////////////////////////// 136////////////////////////////////////////////////////////////////////////////////
137// (static)
138void LLMediaManager::setBrowserUserAgent(std::string user_agent)
139{
140 // *HACK: Breaks encapsulation model, as initClass does above. JC
141 LLMediaImplLLMozLib::setBrowserUserAgent(user_agent);
142}
143
144////////////////////////////////////////////////////////////////////////////////
137// 145//
138LLMediaBase* LLMediaManager::createSourceFromMimeType( std::string scheme, std::string mime_type ) 146LLMediaBase* LLMediaManager::createSourceFromMimeType( std::string scheme, std::string mime_type )
139{ 147{
diff --git a/linden/indra/llmedia/llmediamanager.h b/linden/indra/llmedia/llmediamanager.h
index 7a2c868..0dbcc4a 100644
--- a/linden/indra/llmedia/llmediamanager.h
+++ b/linden/indra/llmedia/llmediamanager.h
@@ -45,8 +45,7 @@ class LLMediaManagerData
45 LLMediaManagerData() : 45 LLMediaManagerData() :
46 mBrowserParentWindow( 0 ), 46 mBrowserParentWindow( 0 ),
47 mBrowserProfileDir( "" ), 47 mBrowserProfileDir( "" ),
48 mBrowserProfileName ( "" ), 48 mBrowserProfileName ( "" )
49 mBrowserUserAgentId( "" )
50 { }; 49 { };
51 50
52 void setBrowserApplicationDir( const std::string& browser_application_dir ) { mBrowserApplicationDir = browser_application_dir; }; 51 void setBrowserApplicationDir( const std::string& browser_application_dir ) { mBrowserApplicationDir = browser_application_dir; };
@@ -64,16 +63,12 @@ class LLMediaManagerData
64 void setBrowserProfileName( const std::string& browser_profile_name ) { mBrowserProfileName = browser_profile_name; }; 63 void setBrowserProfileName( const std::string& browser_profile_name ) { mBrowserProfileName = browser_profile_name; };
65 std::string& getBrowserProfileName() { return mBrowserProfileName; }; 64 std::string& getBrowserProfileName() { return mBrowserProfileName; };
66 65
67 void setBrowserUserAgentId( const std::string& browser_user_agent_id ) { mBrowserUserAgentId = browser_user_agent_id; };
68 std::string& getBrowserUserAgentId() { return mBrowserUserAgentId; };
69
70 private: 66 private:
71 void* mBrowserParentWindow; 67 void* mBrowserParentWindow;
72 std::string mBrowserProfileDir; 68 std::string mBrowserProfileDir;
73 std::string mBrowserProfileName; 69 std::string mBrowserProfileName;
74 std::string mBrowserApplicationDir; 70 std::string mBrowserApplicationDir;
75 std::string mBrowserComponentDir; 71 std::string mBrowserComponentDir;
76 std::string mBrowserUserAgentId;
77}; 72};
78 73
79//////////////////////////////////////////////////////////////////////////////// 74////////////////////////////////////////////////////////////////////////////////
@@ -87,6 +82,13 @@ class LLMediaManager
87 static void cleanupClass(); 82 static void cleanupClass();
88 static LLMediaManager* getInstance(); 83 static LLMediaManager* getInstance();
89 84
85 // We append the skin name to the browser user agent string, so
86 // we need to change it while the app is running, not just at
87 // init time.
88 // Must be called after initClass() above.
89 // *HACK: Breaks encapsulation model. JC
90 static void setBrowserUserAgent(std::string user_agent);
91
90 // Calls update on all media sources 92 // Calls update on all media sources
91 static void updateClass(); 93 static void updateClass();
92 94