Mostly cleanup. A chunk of comment code nobody needs. Dereference

Fri, 07 Jun 2013 20:14:52 -0400

author
Monty Brandenberg <monty@lindenlab.com>
date
Fri, 07 Jun 2013 20:14:52 -0400
changeset 40681
82ebc2e0184f
parent 40680
90e5504bc860
child 40682
a752aec20e0f

Mostly cleanup. A chunk of comment code nobody needs. Dereference
after delete, erase() on end() iterator, a few more like that.
Killed a dead variable.

indra/newview/llmeshrepository.cpp file | annotate | diff | revisions
indra/newview/llmeshrepository.h file | annotate | diff | revisions
     1.1 --- a/indra/newview/llmeshrepository.cpp	Mon Jun 03 13:59:11 2013 -0400
     1.2 +++ b/indra/newview/llmeshrepository.cpp	Fri Jun 07 20:14:52 2013 -0400
     1.3 @@ -97,7 +97,6 @@
     1.4  
     1.5  U32 LLMeshRepository::sCacheBytesRead = 0;
     1.6  U32 LLMeshRepository::sCacheBytesWritten = 0;
     1.7 -U32 LLMeshRepository::sPeakKbps = 0;
     1.8  LLDeadmanTimer LLMeshRepository::sQuiescentTimer(15.0, true);	// true -> gather cpu metrics
     1.9  
    1.10  	
    1.11 @@ -641,6 +640,7 @@
    1.12  					{
    1.13  						mMutex->lock();
    1.14  						mLODReqQ.push(req) ; 
    1.15 +						++LLMeshRepository::sLODProcessing;
    1.16  						mMutex->unlock();
    1.17  					}
    1.18  				}
    1.19 @@ -882,7 +882,7 @@
    1.20  				{
    1.21  					handler->mHttpHandle = handle;
    1.22  					mHttpRequestSet.insert(handler);
    1.23 -					LLMeshRepository::sHTTPRequestCount++;
    1.24 +					++LLMeshRepository::sHTTPRequestCount;
    1.25  				}
    1.26  			}
    1.27  		}
    1.28 @@ -978,7 +978,7 @@
    1.29  				{
    1.30  					handler->mHttpHandle = handle;
    1.31  					mHttpRequestSet.insert(handler);
    1.32 -					LLMeshRepository::sHTTPRequestCount++;
    1.33 +					++LLMeshRepository::sHTTPRequestCount;
    1.34  				}
    1.35  			}
    1.36  		}
    1.37 @@ -1073,7 +1073,7 @@
    1.38  				{
    1.39  					handler->mHttpHandle = handle;
    1.40  					mHttpRequestSet.insert(handler);
    1.41 -					LLMeshRepository::sHTTPRequestCount++;
    1.42 +					++LLMeshRepository::sHTTPRequestCount;
    1.43  				}
    1.44  			}
    1.45  		}
    1.46 @@ -1173,7 +1173,7 @@
    1.47  		{
    1.48  			handler->mHttpHandle = handle;
    1.49  			mHttpRequestSet.insert(handler);
    1.50 -			LLMeshRepository::sHTTPRequestCount++;
    1.51 +			++LLMeshRepository::sHTTPRequestCount;
    1.52  		}
    1.53  		count++;
    1.54  	}
    1.55 @@ -1260,7 +1260,7 @@
    1.56  				{
    1.57  					handler->mHttpHandle = handle;
    1.58  					mHttpRequestSet.insert(handler);
    1.59 -					LLMeshRepository::sHTTPRequestCount++;
    1.60 +					++LLMeshRepository::sHTTPRequestCount;
    1.61  				}
    1.62  				count++;
    1.63  			}
    1.64 @@ -2738,9 +2738,8 @@
    1.65  				vobj->notifyMeshLoaded();
    1.66  			}
    1.67  		}
    1.68 +		mLoadingSkins.erase(info.mMeshID);
    1.69  	}
    1.70 -
    1.71 -	mLoadingSkins.erase(info.mMeshID);
    1.72  }
    1.73  
    1.74  void LLMeshRepository::notifyDecompositionReceived(LLModel::Decomposition* decomp)
    1.75 @@ -2749,14 +2748,14 @@
    1.76  	if (iter == mDecompositionMap.end())
    1.77  	{ //just insert decomp into map
    1.78  		mDecompositionMap[decomp->mMeshID] = decomp;
    1.79 +		mLoadingDecompositions.erase(decomp->mMeshID);
    1.80  	}
    1.81  	else
    1.82  	{ //merge decomp with existing entry
    1.83  		iter->second->merge(decomp);
    1.84 +		mLoadingDecompositions.erase(decomp->mMeshID);
    1.85  		delete decomp;
    1.86  	}
    1.87 -
    1.88 -	mLoadingDecompositions.erase(decomp->mMeshID);
    1.89  }
    1.90  
    1.91  void LLMeshRepository::notifyMeshLoaded(const LLVolumeParams& mesh_params, LLVolume* volume)
    1.92 @@ -3881,147 +3880,3 @@
    1.93  			 status == inv_cont_range));		// Short data read disagrees with content-range
    1.94  }
    1.95  
    1.96 -
    1.97 -
    1.98 -
    1.99 -// ===========
   1.100 -//
   1.101 -// HTTP fragments I'll be needing
   1.102 -//
   1.103 -//
   1.104 -#if 0
   1.105 -
   1.106 -	if (! status)
   1.107 -	{
   1.108 -		success = false;
   1.109 -		std::string reason(status.toString());
   1.110 -		setGetStatus(status, reason);
   1.111 -		llwarns << "CURL GET FAILED, status: " << status.toHex()
   1.112 -				<< " reason: " << reason << llendl;
   1.113 -	}
   1.114 -	else
   1.115 -	{
   1.116 -		// A warning about partial (HTTP 206) data.  Some grid services
   1.117 -		// do *not* return a 'Content-Range' header in the response to
   1.118 -		// Range requests with a 206 status.  We're forced to assume
   1.119 -		// we get what we asked for in these cases until we can fix
   1.120 -		// the services.
   1.121 -		static const LLCore::HttpStatus par_status(HTTP_PARTIAL_CONTENT);
   1.122 -
   1.123 -		partial = (par_status == status);
   1.124 -	}
   1.125 -	
   1.126 -	S32 data_size = callbackHttpGet(response, partial, success);
   1.127 -			
   1.128 -
   1.129 -
   1.130 -
   1.131 -// Threads:  Ttf
   1.132 -// Locks:  Mw
   1.133 -S32 LLTextureFetchWorker::callbackHttpGet(LLCore::HttpResponse * response,
   1.134 -										  bool partial, bool success)
   1.135 -{
   1.136 -	S32 data_size = 0 ;
   1.137 -
   1.138 -	if (mState != WAIT_HTTP_REQ)
   1.139 -	{
   1.140 -		llwarns << "callbackHttpGet for unrequested fetch worker: " << mID
   1.141 -				<< " req=" << mSentRequest << " state= " << mState << llendl;
   1.142 -		return data_size;
   1.143 -	}
   1.144 -	if (mLoaded)
   1.145 -	{
   1.146 -		llwarns << "Duplicate callback for " << mID.asString() << llendl;
   1.147 -		return data_size ; // ignore duplicate callback
   1.148 -	}
   1.149 -	if (success)
   1.150 -	{
   1.151 -		// get length of stream:
   1.152 -		LLCore::BufferArray * body(response->getBody());
   1.153 -		data_size = body ? body->size() : 0;
   1.154 -
   1.155 -		LL_DEBUGS("Texture") << "HTTP RECEIVED: " << mID.asString() << " Bytes: " << data_size << LL_ENDL;
   1.156 -		if (data_size > 0)
   1.157 -		{
   1.158 -			LLViewerStatsRecorder::instance().textureFetch(data_size);
   1.159 -			// *TODO: set the formatted image data here directly to avoid the copy
   1.160 -
   1.161 -			// Hold on to body for later copy
   1.162 -			llassert_always(NULL == mHttpBufferArray);
   1.163 -			body->addRef();
   1.164 -			mHttpBufferArray = body;
   1.165 -
   1.166 -			if (partial)
   1.167 -			{
   1.168 -				unsigned int offset(0), length(0), full_length(0);
   1.169 -				response->getRange(&offset, &length, &full_length);
   1.170 -				if (! offset && ! length)
   1.171 -				{
   1.172 -					// This is the case where we receive a 206 status but
   1.173 -					// there wasn't a useful Content-Range header in the response.
   1.174 -					// This could be because it was badly formatted but is more
   1.175 -					// likely due to capabilities services which scrub headers
   1.176 -					// from responses.  Assume we got what we asked for...
   1.177 -					mHttpReplySize = data_size;
   1.178 -					mHttpReplyOffset = mRequestedOffset;
   1.179 -				}
   1.180 -				else
   1.181 -				{
   1.182 -					mHttpReplySize = length;
   1.183 -					mHttpReplyOffset = offset;
   1.184 -				}
   1.185 -			}
   1.186 -
   1.187 -			if (! partial)
   1.188 -			{
   1.189 -				// Response indicates this is the entire asset regardless
   1.190 -				// of our asking for a byte range.  Mark it so and drop
   1.191 -				// any partial data we might have so that the current
   1.192 -				// response body becomes the entire dataset.
   1.193 -				if (data_size <= mRequestedOffset)
   1.194 -				{
   1.195 -					LL_WARNS("Texture") << "Fetched entire texture " << mID
   1.196 -										<< " when it was expected to be marked complete.  mImageSize:  "
   1.197 -										<< mFileSize << " datasize:  " << mFormattedImage->getDataSize()
   1.198 -										<< LL_ENDL;
   1.199 -				}
   1.200 -				mHaveAllData = TRUE;
   1.201 -				llassert_always(mDecodeHandle == 0);
   1.202 -				mFormattedImage = NULL; // discard any previous data we had
   1.203 -			}
   1.204 -			else if (data_size < mRequestedSize)
   1.205 -			{
   1.206 -				mHaveAllData = TRUE;
   1.207 -			}
   1.208 -			else if (data_size > mRequestedSize)
   1.209 -			{
   1.210 -				// *TODO: This shouldn't be happening any more  (REALLY don't expect this anymore)
   1.211 -				llwarns << "data_size = " << data_size << " > requested: " << mRequestedSize << llendl;
   1.212 -				mHaveAllData = TRUE;
   1.213 -				llassert_always(mDecodeHandle == 0);
   1.214 -				mFormattedImage = NULL; // discard any previous data we had
   1.215 -			}
   1.216 -		}
   1.217 -		else
   1.218 -		{
   1.219 -			// We requested data but received none (and no error),
   1.220 -			// so presumably we have all of it
   1.221 -			mHaveAllData = TRUE;
   1.222 -		}
   1.223 -		mRequestedSize = data_size;
   1.224 -	}
   1.225 -	else
   1.226 -	{
   1.227 -		mRequestedSize = -1; // error
   1.228 -	}
   1.229 -	
   1.230 -	mLoaded = TRUE;
   1.231 -	setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority);
   1.232 -
   1.233 -	LLViewerStatsRecorder::instance().log(0.2f);
   1.234 -	return data_size ;
   1.235 -}
   1.236 -
   1.237 -#endif
   1.238 -// ============
   1.239 -
     2.1 --- a/indra/newview/llmeshrepository.h	Mon Jun 03 13:59:11 2013 -0400
     2.2 +++ b/indra/newview/llmeshrepository.h	Fri Jun 07 20:14:52 2013 -0400
     2.3 @@ -469,7 +469,6 @@
     2.4  	static U32 sLODProcessing;
     2.5  	static U32 sCacheBytesRead;
     2.6  	static U32 sCacheBytesWritten;
     2.7 -	static U32 sPeakKbps;
     2.8  	static LLDeadmanTimer sQuiescentTimer;  // time-to-complete-mesh-downloads after significant events
     2.9  
    2.10  	static F32 getStreamingCost(LLSD& header, F32 radius, S32* bytes = NULL, S32* visible_bytes = NULL, S32 detail = -1, F32 *unscaled_value = NULL);

mercurial