From 8d334ca1bf51dc1a0020f53cdd7a3927bdb7740c Mon Sep 17 00:00:00 2001
From: Rider Linden <rider@lindenlab.com>
Date: Fri, 16 Oct 2015 11:40:48 -0700
Subject: MAINT-5271: Converted internal pointers to internal operation to
 managed shared pointers. Removed direct cast and dereference of handles.

---
 indra/newview/llmaterialmgr.cpp | 45 ++++-------------------------------------
 1 file changed, 4 insertions(+), 41 deletions(-)

(limited to 'indra/newview')

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
 	}
-- 
cgit v1.2.3