summaryrefslogtreecommitdiff
path: root/indra/newview/lltexturefetch.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lltexturefetch.cpp')
-rwxr-xr-xindra/newview/lltexturefetch.cpp57
1 files changed, 38 insertions, 19 deletions
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp
index 30d90431ea..1f966dc76f 100755
--- a/indra/newview/lltexturefetch.cpp
+++ b/indra/newview/lltexturefetch.cpp
@@ -254,6 +254,20 @@ static const S32 HTTP_NONPIPE_REQUESTS_LOW_WATER = 20;
static const S32 HTTP_REQUESTS_RANGE_END_MAX = 20000000;
//////////////////////////////////////////////////////////////////////////////
+namespace
+{
+ // The NoOpDeletor is used when passing certain objects (the LLTextureFetchWorker and
+ // the LLTextureFetchDebugger) in a smart pointer below for passage into
+ // the LLCore::Http libararies. When the smart pointer is destroyed, no
+ // action will be taken since we do not in these cases want the object to
+ // be destroyed at the end of the call.
+ //
+ // *NOTE$: Yes! It is "Deletor"
+ // http://english.stackexchange.com/questions/4733/what-s-the-rule-for-adding-er-vs-or-when-nouning-a-verb
+ // "delete" derives from Latin "deletus"
+ void NoOpDeletor(LLCore::HttpHandler *)
+ { /*NoOp*/ }
+}
static const char* e_state_name[] =
{
@@ -806,16 +820,10 @@ public:
* ownership of the copy and disposes of it
* when done.
*/
- TFReqSendMetrics(const std::string & caps_url,
- const LLUUID & session_id,
- const LLUUID & agent_id,
- LLViewerAssetStats * main_stats)
- : LLTextureFetch::TFRequest(),
- mCapsURL(caps_url),
- mSessionID(session_id),
- mAgentID(agent_id),
- mMainStats(main_stats)
- {}
+ TFReqSendMetrics(const std::string & caps_url,
+ const LLUUID & session_id,
+ const LLUUID & agent_id,
+ LLViewerAssetStats * main_stats);
TFReqSendMetrics & operator=(const TFReqSendMetrics &); // Not defined
virtual ~TFReqSendMetrics();
@@ -827,6 +835,9 @@ public:
const LLUUID mSessionID;
const LLUUID mAgentID;
LLViewerAssetStats * mMainStats;
+
+private:
+ LLCore::HttpHandler::ptr_t mHandler;
};
/*
@@ -965,7 +976,7 @@ LLTextureFetchWorker::~LLTextureFetchWorker()
if (mHttpActive)
{
// Issue a cancel on a live request...
- mFetcher->getHttpRequest().requestCancel(mHttpHandle, NULL);
+ mFetcher->getHttpRequest().requestCancel(mHttpHandle, LLCore::HttpHandler::ptr_t());
}
if (mCacheReadHandle != LLTextureCache::nullHandle() && mFetcher->mTextureCache)
{
@@ -1569,7 +1580,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
mUrl,
options,
mFetcher->mHttpHeaders,
- this);
+ LLCore::HttpHandler::ptr_t(this, &NoOpDeletor));
}
else
{
@@ -1582,7 +1593,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
: mRequestedSize,
options,
mFetcher->mHttpHeaders,
- this);
+ LLCore::HttpHandler::ptr_t(this, &NoOpDeletor));
}
if (LLCORE_HTTP_HANDLE_INVALID == mHttpHandle)
{
@@ -3937,9 +3948,6 @@ public:
}
}; // end class AssetReportHandler
-AssetReportHandler stats_handler;
-
-
/**
* Implements the 'Set Region' command.
*
@@ -3953,6 +3961,18 @@ TFReqSetRegion::doWork(LLTextureFetch *)
return true;
}
+TFReqSendMetrics::TFReqSendMetrics(const std::string & caps_url,
+ const LLUUID & session_id,
+ const LLUUID & agent_id,
+ LLViewerAssetStats * main_stats):
+ LLTextureFetch::TFRequest(),
+ mCapsURL(caps_url),
+ mSessionID(session_id),
+ mAgentID(agent_id),
+ mMainStats(main_stats),
+ mHandler(new AssetReportHandler)
+{}
+
TFReqSendMetrics::~TFReqSendMetrics()
{
@@ -3971,7 +3991,6 @@ bool
TFReqSendMetrics::doWork(LLTextureFetch * fetcher)
{
static const U32 report_priority(1);
- static LLCore::HttpHandler * const handler(fetcher->isQAMode() || true ? &stats_handler : NULL);
//if (! gViewerAssetStatsThread1)
// return true;
@@ -4021,7 +4040,7 @@ TFReqSendMetrics::doWork(LLTextureFetch * fetcher)
sd,
LLCore::HttpOptions::ptr_t(),
fetcher->getMetricsHeaders(),
- handler);
+ mHandler);
LLTextureFetch::svMetricsDataBreak = false;
}
else
@@ -4598,7 +4617,7 @@ S32 LLTextureFetchDebugger::fillCurlQueue()
requestedSize,
LLCore::HttpOptions::ptr_t(),
mHttpHeaders,
- this);
+ LLCore::HttpHandler::ptr_t(this, &NoOpDeletor));
if (LLCORE_HTTP_HANDLE_INVALID != handle)
{
mHandleToFetchIndex[handle] = i;