diff options
author | Rider Linden <rider@lindenlab.com> | 2015-06-23 14:43:12 -0700 |
---|---|---|
committer | Rider Linden <rider@lindenlab.com> | 2015-06-23 14:43:12 -0700 |
commit | ec1368becf02466cf6b44d50938c09d76b7ae712 (patch) | |
tree | 520183e5a55f420ed6fcc1f5a5d69c612b423549 /indra | |
parent | ed4099628c362cdc880962198a2a4984ab67dd8f (diff) |
Code review results with Nat
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llcoproceduremanager.cpp | 27 | ||||
-rw-r--r-- | indra/newview/llcoproceduremanager.h | 9 |
2 files changed, 18 insertions, 18 deletions
diff --git a/indra/newview/llcoproceduremanager.cpp b/indra/newview/llcoproceduremanager.cpp index 3f5fe7a582..3ecb323cab 100644 --- a/indra/newview/llcoproceduremanager.cpp +++ b/indra/newview/llcoproceduremanager.cpp @@ -1,5 +1,5 @@ /** -* @file llupdloadmanager.cpp +* @file llcoproceduremanager.cpp * @author Rider Linden * @brief Singleton class for managing asset uploads to the sim. * @@ -44,18 +44,6 @@ LLCoprocedureManager::LLCoprocedureManager(): mCoroMapping(), mHTTPPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID) { - initializeManager(); -} - -LLCoprocedureManager::~LLCoprocedureManager() -{ - shutdown(); -} - -//========================================================================= -void LLCoprocedureManager::initializeManager() -{ - mShutdown = false; // *TODO: Retrieve the actual number of concurrent coroutines fro gSavedSettings and // clamp to a "reasonable" number. @@ -74,6 +62,13 @@ void LLCoprocedureManager::initializeManager() mWakeupTrigger.post(LLSD()); } +LLCoprocedureManager::~LLCoprocedureManager() +{ + shutdown(); +} + +//========================================================================= + void LLCoprocedureManager::shutdown(bool hardShutdown) { CoroAdapterMap_t::iterator it; @@ -123,7 +118,7 @@ void LLCoprocedureManager::cancelCoprocedure(const LLUUID &id) return; } - for (AssetQueue_t::iterator it = mPendingCoprocs.begin(); it != mPendingCoprocs.end(); ++it) + for (CoprocQueue_t::iterator it = mPendingCoprocs.begin(); it != mPendingCoprocs.end(); ++it) { if ((*it)->mId == id) { @@ -164,6 +159,10 @@ void LLCoprocedureManager::coprocedureInvokerCoro(LLCoros::self& self, LLCoreHtt LL_WARNS() << "Coprocedure(" << coproc->mName << ") id=" << coproc->mId.asString() << " threw an exception! Message=\"" << e.what() << "\"" << LL_ENDL; } + catch (...) + { + LL_WARNS() << "A non std::exception was thrown from " << coproc->mName << " with id=" << coproc->mId << "." << LL_ENDL; + } LL_INFOS() << "Finished coprocedure(" << coproc->mName << ")" << LL_ENDL; diff --git a/indra/newview/llcoproceduremanager.h b/indra/newview/llcoproceduremanager.h index 8902b217c2..e84eba2db9 100644 --- a/indra/newview/llcoproceduremanager.h +++ b/indra/newview/llcoproceduremanager.h @@ -1,5 +1,5 @@ /** -* @file llupdloadmanager.h +* @file llcoproceduremanager.h * @author Rider Linden * @brief Singleton class for managing asset uploads to the sim. * @@ -97,10 +97,12 @@ private: CoProcedure_t mProc; }; - typedef std::deque<QueuedCoproc::ptr_t> AssetQueue_t; + // we use a deque here rather than std::queue since we want to be able to + // iterate through the queue and potentially erase an entry from the middle. + typedef std::deque<QueuedCoproc::ptr_t> CoprocQueue_t; typedef std::map<LLUUID, LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t> ActiveCoproc_t; - AssetQueue_t mPendingCoprocs; + CoprocQueue_t mPendingCoprocs; ActiveCoproc_t mActiveCoprocs; bool mShutdown; LLEventStream mWakeupTrigger; @@ -111,7 +113,6 @@ private: CoroAdapterMap_t mCoroMapping; - void initializeManager(); void coprocedureInvokerCoro(LLCoros::self& self, LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter); }; |