summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/viewer_components/updater/llupdaterservice.cpp24
-rw-r--r--indra/viewer_components/updater/llupdaterservice.h10
2 files changed, 33 insertions, 1 deletions
diff --git a/indra/viewer_components/updater/llupdaterservice.cpp b/indra/viewer_components/updater/llupdaterservice.cpp
index 976e639098..6a40246497 100644
--- a/indra/viewer_components/updater/llupdaterservice.cpp
+++ b/indra/viewer_components/updater/llupdaterservice.cpp
@@ -135,7 +135,7 @@ public:
void downloadComplete(LLSD const & data);
void downloadError(std::string const & message);
- bool onMainLoop(LLSD const & event);
+ bool onMainLoop(LLSD const & event);
private:
void restartTimer(unsigned int seconds);
@@ -349,6 +349,13 @@ void LLUpdaterServiceImpl::downloadComplete(LLSD const & data)
// marker file.
llofstream update_marker(update_marker_path());
LLSDSerialize::toPrettyXML(data, update_marker);
+
+ LLSD event;
+ event["pump"] = LLUpdaterService::pumpName();
+ LLSD payload;
+ payload["type"] = LLSD(LLUpdaterService::DOWNLOAD_COMPLETE);
+ event["payload"] = payload;
+ LLEventPumps::instance().obtain("mainlooprepeater").post(event);
}
void LLUpdaterServiceImpl::downloadError(std::string const & message)
@@ -362,6 +369,14 @@ void LLUpdaterServiceImpl::downloadError(std::string const & message)
{
restartTimer(mCheckPeriod);
}
+
+ LLSD event;
+ event["pump"] = LLUpdaterService::pumpName();
+ LLSD payload;
+ payload["type"] = LLSD(LLUpdaterService::DOWNLOAD_ERROR);
+ payload["message"] = message;
+ event["payload"] = payload;
+ LLEventPumps::instance().obtain("mainlooprepeater").post(event);
}
void LLUpdaterServiceImpl::restartTimer(unsigned int seconds)
@@ -405,6 +420,13 @@ bool LLUpdaterServiceImpl::onMainLoop(LLSD const & event)
//-----------------------------------------------------------------------
// Facade interface
+
+std::string const & LLUpdaterService::pumpName(void)
+{
+ static std::string name("updater_service");
+ return name;
+}
+
LLUpdaterService::LLUpdaterService()
{
if(gUpdater.expired())
diff --git a/indra/viewer_components/updater/llupdaterservice.h b/indra/viewer_components/updater/llupdaterservice.h
index ec20dc6e05..8d0b95be86 100644
--- a/indra/viewer_components/updater/llupdaterservice.h
+++ b/indra/viewer_components/updater/llupdaterservice.h
@@ -39,6 +39,16 @@ public:
public:
UsageError(const std::string& msg) : std::runtime_error(msg) {}
};
+
+ // Name of the event pump through which update events will be delivered.
+ static std::string const & pumpName(void);
+
+ // Type codes for events posted by this service. Stored the event's 'type' element.
+ enum UpdateEvent {
+ INVALID,
+ DOWNLOAD_COMPLETE,
+ DOWNLOAD_ERROR
+ };
LLUpdaterService();
~LLUpdaterService();