Commit Graph

90 Commits (7a845ee23b9f49cc8818155697f6b86df133d721)

Author SHA1 Message Date
Ansariel 4c4dfb682a Merge branch 'master' of https://vcs.firestormviewer.org/phoenix-firestorm 2021-07-21 13:35:31 +02:00
Ansariel 567cb1eeff Merge branch 'DRTVWR-516-maint' of https://bitbucket.org/lindenlab/viewer 2021-02-03 18:12:13 +01:00
Ansariel 339c3c5df4 Merge branch 'DRTVWR-522-maint' of https://bitbucket.org/lindenlab/viewer 2021-01-18 18:55:37 +01:00
Mnikolenko Productengine 03921adb12 SL-2202 Add exception handling around boost::regex_match() calls in the viewer 2021-01-11 17:07:03 +02:00
Mnikolenko Productengine 071e0ff36b SL-14494 FIXED llRequestURL() generated URLs are no longer recognized by the viewer as Second Life hosted URLs 2021-01-04 17:29:50 +02:00
Nat Goodspeed 5a260e0cc3 SL-11216: Convert LLVersionInfo to an LLSingleton.
This changeset is meant to exemplify how to convert a "namespace" class whose
methods are static -- and whose data are module-static -- to an LLSingleton.
LLVersionInfo has no initClass() or cleanupClass() methods, but the general
idea is the same.

* Derive the class from LLSingleton<T>:
  class LLSomeSingleton: public LLSingleton<LLSomeSingleton> { ... };
* Add LLSINGLETON(LLSomeSingleton); in the private section of the class. This
  usage implies a separate LLSomeSingleton::LLSomeSingleton() definition, as
  described in indra/llcommon/llsingleton.h.
* Move module-scope data in the .cpp file to non-static class members. Change
  any sVariableName to mVariableName to avoid being outright misleading.
* Make static class methods non-static. Remove '//static' comments from method
  definitions as needed.
* For LLVersionInfo specifically, the 'const std::string&' return type was
  replaced with 'std::string'. Returning a reference to a static or a member,
  const or otherwise, is an anti-pattern: the interface constrains the
  implementation, prohibiting possibly later returning a temporary (an
  expression).
* For LLVersionInfo specifically, 'const S32' return type was replaced with
  simple 'S32'. 'const' is just noise in that usage.
* Simple member initialization (e.g. the original initializer expressions for
  static variables) can be done with member{ value } initializers (no examples
  here though).
* Delete initClass() method.
* LLSingleton's forté is of course lazy initialization. It might work to
  simply delete any calls to initClass(). But if there are side effects that
  must happen at that moment, replace LLSomeSingleton::initClass() with
  (void)LLSomeSingleton::instance();
* Most initClass() initialization can be done in the constructor, as would
  normally be the case.
* Initialization that might cause a circular LLSingleton reference should be
  moved to initSingleton(). Override 'void initSingleton();' should be private.
* For LLVersionInfo specifically, certain initialization that used to be
  lazily performed was made unconditional, due to its low cost.
* For LLVersionInfo specifically, certain initialization involved calling
  methods that have become non-static. This was moved to initSingleton()
  because, in a constructor body, 'this' does not yet point to the enclosing
  class.
* Delete cleanupClass() method.
* There is already a generic LLSingletonBase::deleteAll() call in
  LLAppViewer::cleanup(). It might work to let this new LLSingleton be cleaned
  up with all the rest. But if there are side effects that must happen at that
  moment, replace LLSomeSingleton::cleanupClass() with
  LLSomeSingleton::deleteSingleton(). That said, much of the benefit of
  converting to LLSingleton is deleteAll()'s guarantee that cross-LLSingleton
  dependencies will be properly honored: we're trying to migrate the code base
  away from the present fragile manual cleanup sequence.
* Most cleanupClass() cleanup can be done in the destructor, as would normally
  be the case.
* Cleanup that might throw an exception should be moved to cleanupSingleton().
  Override 'void cleanupSingleton();' should be private.
* Within LLSomeSingleton methods, remove any existing
  LLSomeSingleton::methodName() qualification: simple methodName() is better.
* In the rest of the code base, convert most LLSomeSingleton::methodName()
  references to LLSomeSingleton::instance().methodName(). (Prefer instance() to
  getInstance() because a reference does not admit the possibility of NULL.)
* Of course, LLSomeSingleton::ENUM_VALUE can remain unchanged.

In general, for many successive references to an LLSingleton instance, it
can be useful to capture the instance() as in:

auto& versionInfo{LLVersionInfo::instance()};
// ... versionInfo.getVersion() ...

We did not do that here only to simplify the code review.

The STRINGIZE(expression) macro encapsulates:
std::ostringstream out;
out << expression;
return out.str();
We used that in a couple places.

For LLVersionInfo specifically, lllogininstance_test.cpp used to dummy out a
couple specific static methods. It's harder to dummy out
LLSingleton::instance() references, so we add the real class to that test.
2020-03-25 16:01:31 -04:00
Nicky 9335eded97 Merge with viewer-vs2107 2019-12-08 17:18:43 +01:00
Nat Goodspeed f5b8019281 SL-11216: Merge up to current viewer-release 2019-11-21 16:52:10 -05:00
Ansariel d79b79fbe2 Merge viewer-ordered-shutdown 2019-10-19 03:16:10 +02:00
andreykproductengine 47cbcb61f8 DRTVWR-493 Cleaned up unneded inits. 2019-07-04 20:24:38 +03:00
andreykproductengine 8369276a49 DRTVWR-493 LLViewerMedia to singleton 2019-06-21 20:55:39 +03:00
Nat Goodspeed 0bb6f754a1 SL-11216: Convert LLVersionInfo to an LLSingleton.
This changeset is meant to exemplify how to convert a "namespace" class whose
methods are static -- and whose data are module-static -- to an LLSingleton.
LLVersionInfo has no initClass() or cleanupClass() methods, but the general
idea is the same.

* Derive the class from LLSingleton<T>:
  class LLSomeSingleton: public LLSingleton<LLSomeSingleton> { ... };
* Add LLSINGLETON(LLSomeSingleton); in the private section of the class. This
  usage implies a separate LLSomeSingleton::LLSomeSingleton() definition, as
  described in indra/llcommon/llsingleton.h.
* Move module-scope data in the .cpp file to non-static class members. Change
  any sVariableName to mVariableName to avoid being outright misleading.
* Make static class methods non-static. Remove '//static' comments from method
  definitions as needed.
* For LLVersionInfo specifically, the 'const std::string&' return type was
  replaced with 'std::string'. Returning a reference to a static or a member,
  const or otherwise, is an anti-pattern: the interface constrains the
  implementation, prohibiting possibly later returning a temporary (an
  expression).
* For LLVersionInfo specifically, 'const S32' return type was replaced with
  simple 'S32'. 'const' is just noise in that usage.
* Simple member initialization (e.g. the original initializer expressions for
  static variables) can be done with member{ value } initializers (no examples
  here though).
* Delete initClass() method.
* LLSingleton's forté is of course lazy initialization. It might work to
  simply delete any calls to initClass(). But if there are side effects that
  must happen at that moment, replace LLSomeSingleton::initClass() with
  (void)LLSomeSingleton::instance();
* Most initClass() initialization can be done in the constructor, as would
  normally be the case.
* Initialization that might cause a circular LLSingleton reference should be
  moved to initSingleton(). Override 'void initSingleton();' should be private.
* For LLVersionInfo specifically, certain initialization that used to be
  lazily performed was made unconditional, due to its low cost.
* For LLVersionInfo specifically, certain initialization involved calling
  methods that have become non-static. This was moved to initSingleton()
  because, in a constructor body, 'this' does not yet point to the enclosing
  class.
* Delete cleanupClass() method.
* There is already a generic LLSingletonBase::deleteAll() call in
  LLAppViewer::cleanup(). It might work to let this new LLSingleton be cleaned
  up with all the rest. But if there are side effects that must happen at that
  moment, replace LLSomeSingleton::cleanupClass() with
  LLSomeSingleton::deleteSingleton(). That said, much of the benefit of
  converting to LLSingleton is deleteAll()'s guarantee that cross-LLSingleton
  dependencies will be properly honored: we're trying to migrate the code base
  away from the present fragile manual cleanup sequence.
* Most cleanupClass() cleanup can be done in the destructor, as would normally
  be the case.
* Cleanup that might throw an exception should be moved to cleanupSingleton().
  Override 'void cleanupSingleton();' should be private.
* Within LLSomeSingleton methods, remove any existing
  LLSomeSingleton::methodName() qualification: simple methodName() is better.
* In the rest of the code base, convert most LLSomeSingleton::methodName()
  references to LLSomeSingleton::instance().methodName(). (Prefer instance() to
  getInstance() because a reference does not admit the possibility of NULL.)
* Of course, LLSomeSingleton::ENUM_VALUE can remain unchanged.

In general, for many successive references to an LLSingleton instance, it
can be useful to capture the instance() as in:

auto& versionInfo{LLVersionInfo::instance()};
// ... versionInfo.getVersion() ...

We did not do that here only to simplify the code review.

The STRINGIZE(expression) macro encapsulates:
std::ostringstream out;
out << expression;
return out.str();
We used that in a couple places.

For LLVersionInfo specifically, lllogininstance_test.cpp used to dummy out a
couple specific static methods. It's harder to dummy out
LLSingleton::instance() references, so we add the real class to that test.
2019-05-30 10:39:37 -04:00
Ansariel fcb454cbd7 Merge viewer-cougar 2018-11-14 19:44:40 +01:00
ruslantproductengine 2823b0639e SL-2642 - Better error logging for missing binormals
+ remove unreachable code
2018-09-27 17:35:12 +03:00
Liny c7c6906aef Fix unreachable code causing RelWithDebInfo to fail to build 2018-09-17 03:21:29 -07:00
Ansariel fa7b0bb78e Merge viewer-neko 2018-07-15 14:58:49 +02:00
maxim_productengine 14c65a2c9e MAINT-8862 mailto URIs should be loaded in the external browser 2018-07-12 17:57:40 +03:00
Ansariel 7c97b96d5d Merge viewer-neko 2017-08-30 20:00:53 +02:00
andreykproductengine c21b3bbacc MAINT-7739 Make LLOSInfo a Singleton 2017-08-25 20:26:25 +03:00
Ansariel e07d6bc4f1 Merge viewer-neko 2017-07-18 21:37:09 +02:00
daianakproductengine 1144fdc044 MAINT-6976 Fixed incorrect search line for open grid's in Search floater 2017-07-10 20:15:04 +03:00
Ansariel 4be1f25185 Add secondlife-status.statuspage.io to the list of LL internal links so we can use the official URL in the grid status floater 2017-06-15 16:09:13 +02:00
Ansariel 275935b14c FIRE-20796: Grid check status page ignores opening SL links in internal browser setting 2017-01-28 13:47:35 +01:00
Nicky d7a0835432 Merge. 2016-09-26 21:12:34 +02:00
AndreyL ProductEngine 3d9c39c77c MAINT-6663 [Win LibVLC] test video buttons still appearing in search 2016-08-20 12:53:03 +03:00
Ansariel 3192fe832f Merge viewer-quickgraphics 2016-03-08 01:41:31 +01:00
Oz Linden bc22e58743 merge changes for 4.0.1-release 2016-01-15 16:55:04 -05:00
Nicky 3f1a78cee9 Merge with CEF tip. 2015-11-24 15:28:05 +01:00
callum_linden ec55f2cd10 MAINT-5862 Fix Provide a way for new Linux users to accept ToS 2015-11-13 16:19:16 -08:00
Oz Linden c8726aba30 remove execute permission from many files that should not have it 2015-11-10 09:48:56 -05:00
Cinder 5a282abe18 STORM-2113 - uri parsing cleanup and fixes 2015-04-11 15:23:06 -06:00
Nicky 006190f2a1 Merge with tools update. 2015-05-05 13:09:27 +02:00
Tank_Master 22386b18b4 Merge LL 2.7.25 2015-02-24 21:22:32 -08:00
Ansariel 48fc17d6e1 Merge LL V3.7.16 2015-01-14 17:36:30 +01:00
Mnikolenko ProductEngine 238eadde6d MAINT-4497 FIXED Use uriparser to find actual domain name. 2014-10-02 12:20:53 +03:00
AndreyL ProductEngine a23ec5ffa8 MAINT-4127: New default mode when clicking links: Linden links open in viewer, third-party links open in user's browser 2014-06-23 23:16:36 +03:00
Tank_Master 6babf8abd2 Merge LL 3.7.7 2014-06-09 11:29:57 -07:00
Richard Linden e340009fc5 second phase summer cleaning
replace llinfos, lldebugs, etc with new LL_INFOS(), LL_DEBUGS(), etc.
2013-08-09 17:11:19 -07:00
Graham Madarasz bf6182daa8 Update Mac and Windows breakpad builds to latest 2013-03-29 07:50:08 -07:00
Tank_Master d4640277d0 Merge LL 3.5.3 release. 2013-07-09 16:24:58 -07:00
Cinders 2c9e821188 Rename HAS_OPENSIM_SUPPORT switch to OPENSIM 2013-02-18 21:24:20 -07:00
Oz Linden d500379cea PATH-735: Limit and clean up grid selection 2012-06-12 21:58:52 -04:00
Tank@test_master.ftrdhcpuser.net 01c7d1eafb Merge LL pathfinding
with help from Armin and NickyD
2012-08-06 18:14:39 -07:00
Armin Weatherwax 88de43718a provide SLURL_TYPE url substitution 2012-06-17 15:55:37 +02:00
Ansariel fa8e37b946 Fixed grid nick URL substitutions; Fixes avatar picker et.al. 2012-01-24 15:58:33 +01:00
Richard Linden a507fc259b finished removing remnants of media browser 2011-11-07 15:04:53 -08:00
Leslie Linden 7bc1eaf22f EXP-1342 FIX -- Update avatar picker and destination guide urls
* URL's are in place with the [GRID_LOWERCASE] used in the link to go to the
  proper page based on the grid.
* Added "GRID_LOWERCASE" substitution for URL's since it is case sensitive
2011-10-14 15:22:53 -07:00
Richard Nelson ec23ec68ea EXP-1310 FIX Profile button should open Web Profile floater
removed unused LLWeb functions for opening non-web media
moved logic inside floaters and away from auxiliary functions
2011-10-10 19:17:38 -07:00
Richard Linden feddda6740 EXP-1056 FIX Web popup issues with Web Content Browser
changed browser id back to a string so it accepts malformed uuid strings
coming from webkit - "{uuid}" instead of "uuid"
2011-07-29 16:38:07 -07:00
Richard Linden fa3f4d1166 EXP-880 FIX Enable navigation chrome for Search floater
search floater derives from floater_web_content
all web content now uses floater_web_content instead of media_browser
2011-07-12 20:58:30 -07:00