Skip to content
Snippets Groups Projects
Commit abf9ccb0 authored by Rider Linden's avatar Rider Linden
Browse files

MAINT-5791: Change the way the TOS dialog is retrieved after the site-alive...

MAINT-5791: Change the way the TOS dialog is retrieved after the site-alive test coro.  Use handles rather than findTypedInstance.
parent 1641bdd5
No related branches found
No related tags found
No related merge requests found
......@@ -196,8 +196,10 @@ void LLFloaterTOS::handleMediaEvent(LLPluginClassMedia* /*self*/, EMediaEvent ev
mLoadingScreenLoaded = true;
std::string url(getString("real_url"));
LLHandle<LLFloater> handle = getHandle();
LLCoros::instance().launch("LLFloaterTOS::testSiteIsAliveCoro",
boost::bind(&LLFloaterTOS::testSiteIsAliveCoro, url));
boost::bind(&LLFloaterTOS::testSiteIsAliveCoro, handle, url));
}
else if(mRealNavigateBegun)
{
......@@ -209,7 +211,7 @@ void LLFloaterTOS::handleMediaEvent(LLPluginClassMedia* /*self*/, EMediaEvent ev
}
}
void LLFloaterTOS::testSiteIsAliveCoro(std::string url)
void LLFloaterTOS::testSiteIsAliveCoro(LLHandle<LLFloater> handle, std::string url)
{
LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID);
LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t
......@@ -228,13 +230,19 @@ void LLFloaterTOS::testSiteIsAliveCoro(std::string url)
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
LLFloaterTOS *that = LLFloaterReg::findTypedInstance<LLFloaterTOS>("message_tos");
// double not.
if (handle.isDead())
{
LL_WARNS("testSiteIsAliveCoro") << "Dialog canceled before response." << LL_ENDL;
return;
}
LLFloaterTOS *that = dynamic_cast<LLFloaterTOS *>(handle.get());
if (that)
that->setSiteIsAlive(static_cast<bool>(status));
else
{
LL_WARNS("testSiteIsAliveCoro") << "Dialog canceled before response." << LL_ENDL;
LL_WARNS("testSiteIsAliveCoro") << "Handle was not a TOS floater." << LL_ENDL;
}
}
......
......@@ -62,7 +62,7 @@ class LLFloaterTOS :
/*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event);
private:
static void testSiteIsAliveCoro(std::string url);
static void testSiteIsAliveCoro(LLHandle<LLFloater> handle, std::string url);
std::string mMessage;
bool mLoadingScreenLoaded;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment