summaryrefslogtreecommitdiff
path: root/indra/llui/llnotificationslistener.cpp
AgeCommit message (Collapse)Author
2024-04-29#824 Process source files in bulk: replace tabs with spaces, convert CRLF to ↵Andrey Lihatskiy
LF, and trim trailing whitespaces as needed
2024-02-05Merge branch 'DRTVWR-599-maint-Z' into release/maint-yzAndrey Lihatskiy
# Conflicts: # indra/newview/llchiclet.h
2024-01-09Replace BOOST_FOREACH with standard C++ range-based for-loopsAnsariel
2023-11-24SL-17076 Thread safety of LLNotificationChannelBase's itemsAndrey Kleshchev
Due to odd crashes when cleaning mItems adding thread safety Viewer runs window in a separate thread, it is possible notification was added in a way that corrupted the list.
2020-03-25DRTVWR-494: Defend LLInstanceTracker against multi-thread usage.Nat Goodspeed
The previous implementation went to some effort to crash if anyone attempted to create or destroy an LLInstanceTracker subclass instance during traversal. That restriction is manageable within a single thread, but becomes unworkable if it's possible that a given subclass might be used on more than one thread. Remove LLInstanceTracker::instance_iter, beginInstances(), endInstances(), also key_iter, beginKeys() and endKeys(). Instead, introduce key_snapshot() and instance_snapshot(), the only means of iterating over LLInstanceTracker instances. (These are intended to resemble functions, but in fact the current implementation simply presents the classes.) Iterating over a captured snapshot defends against container modifications during traversal. The term 'snapshot' reminds the coder that a new instance created during traversal will not be considered. To defend against instance deletion during traversal, a snapshot stores std::weak_ptrs which it lazily dereferences, skipping on the fly any that have expired. Dereferencing instance_snapshot::iterator gets you a reference rather than a pointer. Because some use cases want to delete all existing instances, add an instance_snapshot::deleteAll() method that extracts the pointer. Those cases used to require explicitly copying instance pointers into a separate container; instance_snapshot() now takes care of that. It remains the caller's responsibility to ensure that all instances of that LLInstanceTracker subclass were allocated on the heap. Replace unkeyed static LLInstanceTracker::getInstance(T*) -- which returned nullptr if that instance had been destroyed -- with new getWeak() method returning std::weak_ptr<T>. Caller must detect expiration of that weak_ptr. Adjust tests accordingly. Use of std::weak_ptr to detect expired instances requires engaging std::shared_ptr in the constructor. We now store shared_ptrs in the static containers (std::map for keyed, std::set for unkeyed). Make LLInstanceTrackerBase a template parameterized on the type of the static data it manages. For that reason, hoist static data class declarations out of the class definitions to an LLInstanceTrackerStuff namespace. Remove the static atomic sIterationNestDepth and its methods incrementDepth(), decrementDepth() and getDepth(), since they were used only to forbid creation and destruction during traversal. Add a std::mutex to static data. Introduce an internal LockStatic class that locks the mutex while providing a pointer to static data, making that the only way to access the static data. The LLINSTANCETRACKER_DTOR_NOEXCEPT macro goes away because we no longer expect ~LLInstanceTracker() to throw an exception in test programs. That affects LLTrace::StatBase as well as LLInstanceTracker itself. Adapt consumers to the new LLInstanceTracker API.
2018-10-04DRTVWR-474: Make "LLNotifications" "requestAdd" propagate "reqid"Nat Goodspeed
from request to response to help with request/response matching protocol.
2014-03-28DRTVWR-363: Fix LLNotificationsListener::listChannels() channel walk.Nat Goodspeed
LLNotifications::ChannelMap went away when LLNotificationChannel became an LLInstanceTracker subclass. Iterate the universe of channels using LLNotificationChannel::beginInstances(), endInstances() instead. More troubling is that LLNotificationChannel::getParentChannelName() went away too. When LLNotificationChannel acquired a Params block and corresponding constructor, it acquired the ability to listen on multiple upstream sources. That meant that a single mParent string became inapplicable, and its access method was removed. (Curiously, mParent was not itself removed, but it was left unused.) Change mParent to mParents, a vector<string>, built by connectToChannel(). Introduce getParents(), an accessor returning an iterator_range over that vector. Change LLNotificationsListener::listChannels() to collect a "parents" key in the map returned for each channel, and -- for backwards compatibility -- capture the first entry in the "parents" array as "parent".
2014-03-27DRTVWR-363: re-enable commented-out LLNotificationsListener::listChannels()Nat Goodspeed
and its caller.
2013-07-25Restore VITA LLNotiication APIJeff (Gioffredo Linden)
2012-12-03Cleaning up some unreferenced member variables and related types from ↵William Todd Stinson
LLNotifications.
2012-03-29CHUI-51 WIP notifications routig code cleanupRichard Linden
phase 2, removal of extraneous signaling in favor of llnotificationchannels made notificationchannels work better with overrides and lifetime managed by creator
2010-09-16added ability to have notification ignore variable point to settings.xml ↵Richard Linden
variables
2010-08-13Change license from GPL to LGPL (version 2.1)Oz Linden
2009-12-22Intercept notifications as filter rather than as a peer listener.Nat Goodspeed
2009-12-19Add event API operations to query channels and notifications within channel;Nat Goodspeed
respond to or cancel an individual notification by UUID; or forward notifications through a specified LLEventPump.
2009-11-11Add LLEventAPI class, formalizing the mechanism by which we wrap a C++ APINat Goodspeed
with an event API. In addition to the LLEventPump name on which to listen, LLEventAPI accepts a documentation string for event API introspection. Give every LLEventDispatcher::add() overload a new documentation string parameter for event API introspection. Convert every existing event API to new conventions, introducing suitable documentation strings for the API and each of its operations.
2009-07-24Adding LLLoginInstance unit test.Mark Palange (Mani)
- Added LLNotificationsInterface class. - Removed LLLoginInstance use of LLNotifications EventAPI
2009-07-22Adding LLLoginInstance unit testMark Palange (Mani)
2009-07-09Line ending changes and Build Params changes from login-api-svn-1palmer@945battery-guestB-224.lindenlab.com
2009-07-08Added LLNotificationsListener to hook LLNotifications to the event system ↵brad kittenbrink
according to https://wiki.lindenlab.com/wiki/Incremental_Viewer_Automation/Event_API reviewed by palmer.