summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2015-10-16 11:40:48 -0700
committerRider Linden <rider@lindenlab.com>2015-10-16 11:40:48 -0700
commit8d334ca1bf51dc1a0020f53cdd7a3927bdb7740c (patch)
treeb5624a2a6f94c5e6e1c748fc1c4ae3e77ceda5d2 /indra/newview
parent302e5780694a6f271807d0804db0c6fc6923026f (diff)
MAINT-5271: Converted internal pointers to internal operation to managed shared pointers. Removed direct cast and dereference of handles.
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llmaterialmgr.cpp45
1 files changed, 4 insertions, 41 deletions
diff --git a/indra/newview/llmaterialmgr.cpp b/indra/newview/llmaterialmgr.cpp
index 6dc0525365..9ac560c217 100755
--- a/indra/newview/llmaterialmgr.cpp
+++ b/indra/newview/llmaterialmgr.cpp
@@ -594,6 +594,9 @@ void LLMaterialMgr::processGetQueue()
while (mGetQueue.end() != loopRegionQueue)
{
#if 1
+ //* $TODO: This block is screaming to be turned into a coroutine.
+ // see processGetQueueCoro() below.
+ //
get_queue_t::iterator itRegionQueue = loopRegionQueue++;
const LLUUID& region_id = itRegionQueue->first;
@@ -789,50 +792,10 @@ void LLMaterialMgr::processGetAllQueue()
getall_queue_t::iterator itRegion = loopRegion++;
const LLUUID& region_id = *itRegion;
-#if 1
+
LLCoros::instance().launch("LLMaterialMgr::processGetAllQueueCoro", boost::bind(&LLMaterialMgr::processGetAllQueueCoro,
this, region_id));
-#else
- LLViewerRegion* regionp = LLWorld::instance().getRegionFromID(region_id);
- if (regionp == NULL)
- {
- LL_WARNS("Materials") << "Unknown region with id " << region_id.asString() << LL_ENDL;
- clearGetQueues(region_id); // Invalidates region_id
- continue;
- }
- else if (!regionp->capabilitiesReceived() || regionp->materialsCapThrottled())
- {
- continue;
- }
- std::string capURL = regionp->getCapability(MATERIALS_CAPABILITY_NAME);
- if (capURL.empty())
- {
- LL_WARNS("Materials") << "Capability '" << MATERIALS_CAPABILITY_NAME
- << "' is not defined on the current region '" << regionp->getName() << "'" << LL_ENDL;
- clearGetQueues(region_id); // Invalidates region_id
- continue;
- }
-
- LL_DEBUGS("Materials") << "GET all for region " << region_id << "url " << capURL << LL_ENDL;
- LLMaterialHttpHandler *handler =
- new LLMaterialHttpHandler("GET",
- boost::bind(&LLMaterialMgr::onGetAllResponse, this, _1, _2, *itRegion)
- );
-
- LLCore::HttpHandle handle = mHttpRequest->requestGet(mHttpPolicy, mHttpPriority, capURL,
- mHttpOptions, mHttpHeaders, handler);
-
- if (handle == LLCORE_HTTP_HANDLE_INVALID)
- {
- delete handler;
- LLCore::HttpStatus status = mHttpRequest->getStatus();
- LL_ERRS("Meterials") << "Failed to execute material GET. Status = " <<
- status.toULong() << "\"" << status.toString() << "\"" << LL_ENDL;
- }
-
- regionp->resetMaterialsCapThrottle();
-#endif
mGetAllPending.insert(std::pair<LLUUID, F64>(region_id, LLFrameTimer::getTotalSeconds()));
mGetAllQueue.erase(itRegion); // Invalidates region_id
}