summaryrefslogtreecommitdiff
path: root/indra/newview/llpreviewscript.cpp
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2015-08-27 16:16:22 -0700
committerRider Linden <rider@lindenlab.com>2015-08-27 16:16:22 -0700
commitac3af19539e0f3a4d8557cc68f19781893de2fc3 (patch)
treeed10bf16494e59c7155f2ac0f485478267cb9a9b /indra/newview/llpreviewscript.cpp
parenta455759e643ef3b285f8fa38d2a7c9db74605c44 (diff)
Convert LSL script preview compilation exp request
Diffstat (limited to 'indra/newview/llpreviewscript.cpp')
-rwxr-xr-xindra/newview/llpreviewscript.cpp34
1 files changed, 13 insertions, 21 deletions
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index b6210bdc6b..a548d7b705 100755
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -118,26 +118,6 @@ static bool have_script_upload_cap(LLUUID& object_id)
return object && (! object->getRegion()->getCapability("UpdateScriptTask").empty());
}
-
-class ExperienceResponder : public LLHTTPClient::Responder
-{
-public:
- ExperienceResponder(const LLHandle<LLLiveLSLEditor>& parent):mParent(parent)
- {
- }
-
- LLHandle<LLLiveLSLEditor> mParent;
-
- /*virtual*/ void httpSuccess()
- {
- LLLiveLSLEditor* parent = mParent.get();
- if(!parent)
- return;
-
- parent->setExperienceIds(getContent()["experience_ids"]);
- }
-};
-
/// ---------------------------------------------------------------------------
/// LLLiveLSLFile
/// ---------------------------------------------------------------------------
@@ -1416,11 +1396,23 @@ void LLLiveLSLEditor::requestExperiences()
std::string lookup_url=region->getCapability("GetCreatorExperiences");
if(!lookup_url.empty())
{
- LLHTTPClient::get(lookup_url, new ExperienceResponder(getDerivedHandle<LLLiveLSLEditor>()));
+ LLCoreHttpUtil::HttpCoroutineAdapter::completionCallback_t success =
+ boost::bind(&LLLiveLSLEditor::receiveExperienceIds, _1, getDerivedHandle<LLLiveLSLEditor>());
+
+ LLCoreHttpUtil::HttpCoroutineAdapter::callbackHttpGet(lookup_url, success);
}
}
}
+/*static*/
+void LLLiveLSLEditor::receiveExperienceIds(LLSD result, LLHandle<LLLiveLSLEditor> hparent)
+{
+ LLLiveLSLEditor* parent = hparent.get();
+ if (!parent)
+ return;
+
+ parent->setExperienceIds(result["experience_ids"]);
+}
/// ---------------------------------------------------------------------------