diff --git a/indra/llmessage/llcoproceduremanager.cpp b/indra/llmessage/llcoproceduremanager.cpp index c9dfcae2932bc72b498f2c5ed198aad52b0f433d..68da248ee4e80790af36bc88d1c778c6c2f678d5 100644 --- a/indra/llmessage/llcoproceduremanager.cpp +++ b/indra/llmessage/llcoproceduremanager.cpp @@ -140,6 +140,8 @@ LLCoprocedureManager::poolPtr_t LLCoprocedureManager::initializePool(const std:: std::string keyName = "PoolSize" + poolName; int size = 0; + LL_ERRS_IF(poolName.empty(), "CoprocedureManager") << "Poolname must not be empty" << LL_ENDL; + if (mPropertyQueryFn && !mPropertyQueryFn.empty()) { size = mPropertyQueryFn(keyName); @@ -159,9 +161,10 @@ LLCoprocedureManager::poolPtr_t LLCoprocedureManager::initializePool(const std:: LL_WARNS() << "LLCoprocedureManager: No setting for \"" << keyName << "\" setting pool size to default of " << size << LL_ENDL; } - poolPtr_t pool = poolPtr_t(new LLCoprocedurePool(poolName, size)); + poolPtr_t pool(new LLCoprocedurePool(poolName, size)); mPoolMap.insert(poolMap_t::value_type(poolName, pool)); + LL_ERRS_IF(!pool, "CoprocedureManager") << "Unable to create pool named \"" << poolName << "\" FATAL!" << LL_ENDL; return pool; } @@ -182,12 +185,6 @@ LLUUID LLCoprocedureManager::enqueueCoprocedure(const std::string &pool, const s targetPool = (*it).second; } - if (!targetPool) - { - LL_WARNS() << "LLCoprocedureManager unable to create coprocedure pool named \"" << pool << "\"" << LL_ENDL; - return LLUUID::null; - } - return targetPool->enqueueCoprocedure(name, proc); } @@ -286,14 +283,12 @@ LLCoprocedurePool::LLCoprocedurePool(const std::string &poolName, size_t size): { for (size_t count = 0; count < mPoolSize; ++count) { - LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter = - LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t( - new LLCoreHttpUtil::HttpCoroutineAdapter( mPoolName + "Adapter", mHTTPPolicy)); + LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter( mPoolName + "Adapter", mHTTPPolicy)); - std::string uploadCoro = LLCoros::instance().launch("LLCoprocedurePool("+mPoolName+")::coprocedureInvokerCoro", + std::string pooledCoro = LLCoros::instance().launch("LLCoprocedurePool("+mPoolName+")::coprocedureInvokerCoro", boost::bind(&LLCoprocedurePool::coprocedureInvokerCoro, this, httpAdapter)); - mCoroMapping.insert(CoroAdapterMap_t::value_type(uploadCoro, httpAdapter)); + mCoroMapping.insert(CoroAdapterMap_t::value_type(pooledCoro, httpAdapter)); } LL_INFOS() << "Created coprocedure pool named \"" << mPoolName << "\" with " << size << " items." << LL_ENDL; @@ -313,12 +308,9 @@ void LLCoprocedurePool::shutdown(bool hardShutdown) for (it = mCoroMapping.begin(); it != mCoroMapping.end(); ++it) { - if (!(*it).first.empty()) + if (hardShutdown) { - if (hardShutdown) - { - LLCoros::instance().kill((*it).first); - } + LLCoros::instance().kill((*it).first); } if ((*it).second) { @@ -366,7 +358,7 @@ bool LLCoprocedurePool::cancelCoprocedure(const LLUUID &id) } } - LL_INFOS() << "Coprocedure with Id=" << id.asString() << " was not found." << " in pool \"" << mPoolName << "\"" << LL_ENDL; + LL_INFOS() << "Coprocedure with Id=" << id.asString() << " was not found in pool \"" << mPoolName << "\"" << LL_ENDL; return false; } @@ -385,7 +377,7 @@ void LLCoprocedurePool::coprocedureInvokerCoro(LLCoreHttpUtil::HttpCoroutineAdap { QueuedCoproc::ptr_t coproc = mPendingCoprocs.front(); mPendingCoprocs.pop_front(); - mActiveCoprocs.insert(ActiveCoproc_t::value_type(coproc->mId, httpAdapter)); + ActiveCoproc_t::iterator itActive = mActiveCoprocs.insert(ActiveCoproc_t::value_type(coproc->mId, httpAdapter)).first; LL_INFOS() << "Dequeued and invoking coprocedure(" << coproc->mName << ") with id=" << coproc->mId.asString() << " in pool \"" << mPoolName << "\"" << LL_ENDL; @@ -405,11 +397,7 @@ void LLCoprocedurePool::coprocedureInvokerCoro(LLCoreHttpUtil::HttpCoroutineAdap LL_INFOS() << "Finished coprocedure(" << coproc->mName << ")" << " in pool \"" << mPoolName << "\"" << LL_ENDL; - ActiveCoproc_t::iterator itActive = mActiveCoprocs.find(coproc->mId); - if (itActive != mActiveCoprocs.end()) - { - mActiveCoprocs.erase(itActive); - } + mActiveCoprocs.erase(itActive); } } } diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index e76f2a15505bb8f455606bf3b7ad0b132374737b..72ff89f33c95854923d99aeb583badee42e45dda 100755 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -1430,7 +1430,7 @@ std::string LLUrlEntryExperienceProfile::getLabel( const std::string &url, const return LLTrans::getString("ExperienceNameNull"); } - const LLSD& experience_details = LLExperienceCache::getInstance()->get(experience_id); + const LLSD& experience_details = LLExperienceCache::instance().get(experience_id); if(!experience_details.isUndefined()) { std::string experience_name_string = experience_details[LLExperienceCache::NAME].asString(); @@ -1438,7 +1438,7 @@ std::string LLUrlEntryExperienceProfile::getLabel( const std::string &url, const } addObserver(experience_id_string, url, cb); - LLExperienceCache::getInstance()->get(experience_id, boost::bind(&LLUrlEntryExperienceProfile::onExperienceDetails, this, _1)); + LLExperienceCache::instance().get(experience_id, boost::bind(&LLUrlEntryExperienceProfile::onExperienceDetails, this, _1)); return LLTrans::getString("LoadingData"); } diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp index b52ccffed9689995c40dae59b9557f6a10ba47ea..219bcf0eb03b0da021bcac4bb7c6329b034bf243 100755 --- a/indra/newview/llcompilequeue.cpp +++ b/indra/newview/llcompilequeue.cpp @@ -357,7 +357,7 @@ void LLFloaterCompileQueue::handleInventory(LLViewerObject *viewer_object, LLScriptQueueData* datap = new LLScriptQueueData(getKey().asUUID(), viewer_object->getID(), itemp); - LLExperienceCache::getInstance()->fetchAssociatedExperience(itemp->getParentUUID(), itemp->getUUID(), + LLExperienceCache::instance().fetchAssociatedExperience(itemp->getParentUUID(), itemp->getUUID(), boost::bind(&LLFloaterCompileQueue::requestAsset, datap, _1)); } } diff --git a/indra/newview/llfloaterexperienceprofile.cpp b/indra/newview/llfloaterexperienceprofile.cpp index 8a04f9e4cc59d4b04df2659ae52486d568499d99..e850be99ab9aa0c5284308dc4195e28ff0ca7ec1 100644 --- a/indra/newview/llfloaterexperienceprofile.cpp +++ b/indra/newview/llfloaterexperienceprofile.cpp @@ -99,7 +99,7 @@ class LLExperienceHandler : public LLCommandHandler if(params.size() != 2 || params[1].asString() != "profile") return false; - LLExperienceCache::getInstance()->get(params[0].asUUID(), boost::bind(&LLExperienceHandler::experienceCallback, this, _1)); + LLExperienceCache::instance().get(params[0].asUUID(), boost::bind(&LLExperienceHandler::experienceCallback, this, _1)); return true; } @@ -288,8 +288,8 @@ BOOL LLFloaterExperienceProfile::postBuild() if (mExperienceId.notNull()) { - LLExperienceCache::getInstance()->fetch(mExperienceId, true); - LLExperienceCache::getInstance()->get(mExperienceId, boost::bind(&LLFloaterExperienceProfile::experienceCallback, + LLExperienceCache::instance().fetch(mExperienceId, true); + LLExperienceCache::instance().get(mExperienceId, boost::bind(&LLFloaterExperienceProfile::experienceCallback, getDerivedHandle<LLFloaterExperienceProfile>(), _1)); LLViewerRegion* region = gAgent.getRegion(); @@ -799,8 +799,8 @@ void LLFloaterExperienceProfile::onSaveComplete( const LLSD& content ) } refreshExperience(*it); - LLExperienceCache::getInstance()->insert(*it); - LLExperienceCache::getInstance()->fetch(id, true); + LLExperienceCache::instance().insert(*it); + LLExperienceCache::instance().fetch(id, true); if(mSaveCompleteAction==VIEW) { diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index a166dda8ee68e2b5c8147b255eade90b3bbe1bbb..94f3a45d88dd1d6411758b6caacc59962eea144d 100755 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -3699,7 +3699,7 @@ bool LLPanelRegionExperiences::refreshFromRegion(LLViewerRegion* region) mTrusted->loading(); mTrusted->setReadonly(!allow_modify); - LLExperienceCache::getInstance()->getRegionExperiences(boost::bind(&LLPanelRegionExperiences::regionCapabilityQuery, region, _1), + LLExperienceCache::instance().getRegionExperiences(boost::bind(&LLPanelRegionExperiences::regionCapabilityQuery, region, _1), boost::bind(&LLPanelRegionExperiences::infoCallback, getDerivedHandle<LLPanelRegionExperiences>(), _1)); return LLPanelRegionInfo::refreshFromRegion(region); @@ -3727,7 +3727,7 @@ BOOL LLPanelRegionExperiences::sendUpdate() content["blocked"]=addIds(mBlocked); content["trusted"]=addIds(mTrusted); - LLExperienceCache::getInstance()->setRegionExperiences(boost::bind(&LLPanelRegionExperiences::regionCapabilityQuery, region, _1), + LLExperienceCache::instance().setRegionExperiences(boost::bind(&LLPanelRegionExperiences::regionCapabilityQuery, region, _1), content, boost::bind(&LLPanelRegionExperiences::infoCallback, getDerivedHandle<LLPanelRegionExperiences>(), _1)); return TRUE; diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index 714d8d0e8fbfca36c396dd5f8af5a29d36bda935..1c2340b0efcc5e639516d631d1288b103c5b1e7e 100755 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -268,7 +268,7 @@ void LLFloaterReporter::getExperienceInfo(const LLUUID& experience_id) if (LLUUID::null != mExperienceID) { - const LLSD& experience = LLExperienceCache::getInstance()->get(mExperienceID); + const LLSD& experience = LLExperienceCache::instance().get(mExperienceID); std::stringstream desc; if(experience.isDefined()) diff --git a/indra/newview/llpanelexperiencelisteditor.cpp b/indra/newview/llpanelexperiencelisteditor.cpp index 20fe0c52fa4c31e638d3a505212364916c28d0f1..9d52a1906bd3cc8e9896838a614f4f0947b61352 100644 --- a/indra/newview/llpanelexperiencelisteditor.cpp +++ b/indra/newview/llpanelexperiencelisteditor.cpp @@ -183,7 +183,7 @@ void LLPanelExperienceListEditor::onItems() columns[0]["value"] = getString("loading"); mItems->addElement(item); - LLExperienceCache::getInstance()->get(experience, boost::bind(&LLPanelExperienceListEditor::experienceDetailsCallback, + LLExperienceCache::instance().get(experience, boost::bind(&LLPanelExperienceListEditor::experienceDetailsCallback, getDerivedHandle<LLPanelExperienceListEditor>(), _1)); } diff --git a/indra/newview/llpanelexperiencelog.cpp b/indra/newview/llpanelexperiencelog.cpp index 9329d900b1e35439a8ab741599041cb2bb9e5ef4..d5979b6e96f75c93cea0e61b4bf88b92d2a8d5ac 100644 --- a/indra/newview/llpanelexperiencelog.cpp +++ b/indra/newview/llpanelexperiencelog.cpp @@ -140,7 +140,7 @@ void LLPanelExperienceLog::refresh() } const LLSD event = dayArray[i]; LLUUID id = event[LLExperienceCache::EXPERIENCE_ID].asUUID(); - const LLSD& experience = LLExperienceCache::getInstance()->get(id); + const LLSD& experience = LLExperienceCache::instance().get(id); if(experience.isUndefined()){ waiting = true; waiting_id = id; @@ -168,7 +168,7 @@ void LLPanelExperienceLog::refresh() { mEventList->deleteAllItems(); mEventList->setCommentText(getString("loading")); - LLExperienceCache::getInstance()->get(waiting_id, boost::bind(&LLPanelExperienceLog::refresh, this)); + LLExperienceCache::instance().get(waiting_id, boost::bind(&LLPanelExperienceLog::refresh, this)); } else { diff --git a/indra/newview/llpanelexperiencepicker.cpp b/indra/newview/llpanelexperiencepicker.cpp index db846ffad94e5b7a8bf564af9576fb4adb3e34aa..d71ced443b1f15debaaeac59403ff08d644d1890 100644 --- a/indra/newview/llpanelexperiencepicker.cpp +++ b/indra/newview/llpanelexperiencepicker.cpp @@ -130,7 +130,7 @@ void LLPanelExperiencePicker::find() std::string text = getChild<LLUICtrl>(TEXT_EDIT)->getValue().asString(); mQueryID.generate(); - LLExperienceCache::getInstance()->findExperienceByName(text, mCurrentPage, + LLExperienceCache::instance().findExperienceByName(text, mCurrentPage, boost::bind(&LLPanelExperiencePicker::findResults, getDerivedHandle<LLPanelExperiencePicker>(), mQueryID, _1)); getChild<LLScrollListCtrl>(LIST_RESULTS)->deleteAllItems(); diff --git a/indra/newview/llpanelgroupexperiences.cpp b/indra/newview/llpanelgroupexperiences.cpp index 067f9eb426f045d2d8266740c1e937f639d05b63..9b4c67a120d4cae80fec04bd29978cfdd1e23cde 100644 --- a/indra/newview/llpanelgroupexperiences.cpp +++ b/indra/newview/llpanelgroupexperiences.cpp @@ -73,7 +73,7 @@ void LLPanelGroupExperiences::activate() return; } - LLExperienceCache::getInstance()->getGroupExperiences(getGroupID(), + LLExperienceCache::instance().getGroupExperiences(getGroupID(), boost::bind(&LLPanelGroupExperiences::groupExperiencesResults, getDerivedHandle<LLPanelGroupExperiences>(), _1)); } diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 8a493b70842473810ddc8aa8dacb6ec794b24d9b..5f029ca6a22aa44dbb234c7b1d0d8cf6f5dfe010 100755 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -1325,7 +1325,7 @@ void LLLiveLSLEditor::buildExperienceList() position = ADD_TOP; } - const LLSD& experience = LLExperienceCache::getInstance()->get(id); + const LLSD& experience = LLExperienceCache::instance().get(id); if(experience.isUndefined()) { mExperiences->add(getString("loading"), id, position); @@ -1344,7 +1344,7 @@ void LLLiveLSLEditor::buildExperienceList() if(!foundAssociated ) { - const LLSD& experience = LLExperienceCache::getInstance()->get(associated); + const LLSD& experience = LLExperienceCache::instance().get(associated); if(experience.isDefined()) { std::string experience_name_string = experience[LLExperienceCache::NAME].asString(); @@ -1365,7 +1365,7 @@ void LLLiveLSLEditor::buildExperienceList() if(last.notNull()) { mExperiences->setEnabled(FALSE); - LLExperienceCache::getInstance()->get(last, boost::bind(&LLLiveLSLEditor::buildExperienceList, this)); + LLExperienceCache::instance().get(last, boost::bind(&LLLiveLSLEditor::buildExperienceList, this)); } else { @@ -2038,7 +2038,7 @@ void LLLiveLSLEditor::loadAsset() if(item) { - LLExperienceCache::getInstance()->fetchAssociatedExperience(item->getParentUUID(), item->getUUID(), + LLExperienceCache::instance().fetchAssociatedExperience(item->getParentUUID(), item->getUUID(), boost::bind(&LLLiveLSLEditor::setAssociatedExperience, getDerivedHandle<LLLiveLSLEditor>(), _1)); bool isGodlike = gAgent.isGodlike(); diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp index ca17fe77b1a026c2c3960a72981e49504ac817dc..12cbff888d39cb7c1c916059b07342ddf72dbea1 100755 --- a/indra/newview/llsidepaneliteminfo.cpp +++ b/indra/newview/llsidepaneliteminfo.cpp @@ -328,7 +328,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) tb->setText(getString("loading_experience")); tb->setVisible(TRUE); - LLExperienceCache::getInstance()->fetchAssociatedExperience(item->getParentUUID(), item->getUUID(), + LLExperienceCache::instance().fetchAssociatedExperience(item->getParentUUID(), item->getUUID(), boost::bind(&LLSidepanelItemInfo::setAssociatedExperience, getDerivedHandle<LLSidepanelItemInfo>(), _1)); } diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 361cc6c48b17ad38b97ca1492c87e8c42ae463f1..4246f722027e9723fcc8820eaa59d780930bb1be 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2822,7 +2822,7 @@ void LLStartUp::initNameCache() void LLStartUp::initExperiences() { // Should trigger loading the cache. - LLExperienceCache::getInstance()->setCapabilityQuery( + LLExperienceCache::instance().setCapabilityQuery( boost::bind(&LLAgent::getRegionCapability, &gAgent, _1)); LLExperienceLog::instance().initialize(); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 4e1a86bb71148d0dff2e2d4cc20d55325d3cb706..ea8fc07e8a05959c3bf0a66a9a56f9a9a81f0c8e 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -6653,7 +6653,7 @@ void process_script_question(LLMessageSystem *msg, void **user_data) else if(experienceid.notNull()) { payload["experience"]=experienceid; - LLExperienceCache::getInstance()->get(experienceid, boost::bind(process_script_experience_details, _1, args, payload)); + LLExperienceCache::instance().get(experienceid, boost::bind(process_script_experience_details, _1, args, payload)); return; }