From 34dcaaaacd7865e3a652159b4fb1d58dfa0cb91b Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Thu, 23 Oct 2025 19:10:12 +0300 Subject: #4887 Fix access violation in LLInventoryModelBackgroundFetch::bulkFetchViaAis --- indra/newview/llinventorymodelbackgroundfetch.cpp | 71 +++++++++++++---------- 1 file changed, 40 insertions(+), 31 deletions(-) (limited to 'indra/newview/llinventorymodelbackgroundfetch.cpp') diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp index 2cf1554957..d538d42972 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.cpp +++ b/indra/newview/llinventorymodelbackgroundfetch.cpp @@ -886,31 +886,34 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis(const FetchQueueInfo& fetc static LLCachedControl ais_batch(gSavedSettings, "BatchSizeAIS3", 20); S32 batch_limit = llclamp(ais_batch(), 1, 40); - for (LLInventoryModel::cat_array_t::iterator it = categories->begin(); - it != categories->end(); - ++it) + if (categories) { - LLViewerInventoryCategory* child_cat = (*it); - if (LLViewerInventoryCategory::VERSION_UNKNOWN != child_cat->getVersion() - || child_cat->getFetching() >= target_state) + for (LLInventoryModel::cat_array_t::iterator it = categories->begin(); + it != categories->end(); + ++it) { - continue; - } + LLViewerInventoryCategory* child_cat = (*it); + if (LLViewerInventoryCategory::VERSION_UNKNOWN != child_cat->getVersion() + || child_cat->getFetching() >= target_state) + { + continue; + } - if (child_cat->getPreferredType() == LLFolderType::FT_MARKETPLACE_LISTINGS) - { - // special case, marketplace will fetch that as needed - continue; - } + if (child_cat->getPreferredType() == LLFolderType::FT_MARKETPLACE_LISTINGS) + { + // special case, marketplace will fetch that as needed + continue; + } - children.emplace_back(child_cat->getUUID()); - mExpectedFolderIds.emplace_back(child_cat->getUUID()); - child_cat->setFetching(target_state); + children.emplace_back(child_cat->getUUID()); + mExpectedFolderIds.emplace_back(child_cat->getUUID()); + child_cat->setFetching(target_state); - if (children.size() >= batch_limit) - { - content_done = false; - break; + if (children.size() >= batch_limit) + { + content_done = false; + break; + } } } @@ -940,14 +943,17 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis(const FetchQueueInfo& fetc // This will have a bit of overlap with onAISContentCalback, // but something else might have downloaded folders, so verify // every child that is complete has it's children done as well - for (LLInventoryModel::cat_array_t::iterator it = categories->begin(); - it != categories->end(); - ++it) + if (categories) { - LLViewerInventoryCategory* child_cat = (*it); - if (LLViewerInventoryCategory::VERSION_UNKNOWN != child_cat->getVersion()) + for (LLInventoryModel::cat_array_t::iterator it = categories->begin(); + it != categories->end(); + ++it) { - mFetchFolderQueue.emplace_back(child_cat->getUUID(), FT_RECURSIVE); + LLViewerInventoryCategory* child_cat = (*it); + if (LLViewerInventoryCategory::VERSION_UNKNOWN != child_cat->getVersion()) + { + mFetchFolderQueue.emplace_back(child_cat->getUUID(), FT_RECURSIVE); + } } } } @@ -998,12 +1004,15 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis(const FetchQueueInfo& fetc LLInventoryModel::cat_array_t* categories(NULL); LLInventoryModel::item_array_t* items(NULL); gInventory.getDirectDescendentsOf(cat_id, categories, items); - for (LLInventoryModel::cat_array_t::const_iterator it = categories->begin(); - it != categories->end(); - ++it) + if (categories) { - // not emplace_front to not cause an infinite loop - mFetchFolderQueue.emplace_back((*it)->getUUID(), FT_RECURSIVE); + for (LLInventoryModel::cat_array_t::const_iterator it = categories->begin(); + it != categories->end(); + ++it) + { + // not emplace_front to not cause an infinite loop + mFetchFolderQueue.emplace_back((*it)->getUUID(), FT_RECURSIVE); + } } } } -- cgit v1.3 From 54b3f3de64f3749022d95063c7439bfed316645f Mon Sep 17 00:00:00 2001 From: Rye Date: Fri, 28 Nov 2025 11:03:31 -0500 Subject: #5072 Use make_shared for more efficient ref counting and allocation --- indra/llcharacter/llkeyframemotion.cpp | 4 +- indra/llcommon/llapr.cpp | 2 +- indra/llcommon/llleap.cpp | 2 +- indra/llcommon/llstring.h | 4 +- indra/llcorehttp/_httpoprequest.cpp | 4 +- indra/llcorehttp/httpcommon.h | 14 ++-- indra/llcorehttp/httprequest.cpp | 30 +++---- indra/llcorehttp/httprequest.h | 6 +- indra/llimage/llimageworker.cpp | 2 +- indra/llmessage/llavatarnamecache.cpp | 6 +- indra/llmessage/llcoproceduremanager.cpp | 4 +- indra/llmessage/llcorehttputil.cpp | 56 ++++++------- indra/llmessage/llcorehttputil.h | 98 +++++++++++----------- indra/llmessage/llexperiencecache.cpp | 18 ++-- indra/llmessage/message.cpp | 10 +-- .../llmessage/tests/llcoproceduremanager_test.cpp | 2 +- indra/llui/llfolderviewmodel.h | 4 +- indra/llui/llnotifications.cpp | 16 ++-- indra/llui/llnotificationslistener.cpp | 2 +- indra/newview/llaccountingcostmanager.cpp | 4 +- indra/newview/llagent.cpp | 14 ++-- indra/newview/llaisapi.cpp | 4 +- indra/newview/llappearancemgr.cpp | 6 +- indra/newview/llavatarpropertiesprocessor.cpp | 6 +- indra/newview/llavatarrenderinfoaccountant.cpp | 12 +-- indra/newview/llcompilequeue.cpp | 4 +- indra/newview/llenvironment.cpp | 16 ++-- indra/newview/llestateinfomodel.cpp | 4 +- indra/newview/lleventpoll.cpp | 6 +- indra/newview/llfloaterabout.cpp | 10 +-- indra/newview/llfloateravatarpicker.cpp | 12 +-- indra/newview/llfloaterbvhpreview.cpp | 4 +- indra/newview/llfloaterexperiences.cpp | 8 +- indra/newview/llfloatergridstatus.cpp | 8 +- indra/newview/llfloaterimagepreview.cpp | 4 +- indra/newview/llfloatermodeluploadbase.cpp | 4 +- indra/newview/llfloatermyscripts.cpp | 4 +- indra/newview/llfloaterpay.cpp | 8 +- indra/newview/llfloaterperms.cpp | 4 +- indra/newview/llfloaterpreference.cpp | 8 +- indra/newview/llfloaterregioninfo.cpp | 4 +- indra/newview/llfloaterregionrestartschedule.cpp | 12 +-- indra/newview/llfloaterreporter.cpp | 6 +- indra/newview/llfloaterscriptlimits.cpp | 12 +-- indra/newview/llfloatersimplesnapshot.cpp | 12 +-- indra/newview/llfloatertos.cpp | 6 +- indra/newview/llfloaterurlentry.cpp | 8 +- indra/newview/llgesturemgr.cpp | 2 +- indra/newview/llgltfmateriallist.cpp | 6 +- indra/newview/llgroupmgr.cpp | 18 ++-- indra/newview/llimprocessing.cpp | 4 +- indra/newview/llimview.cpp | 16 ++-- indra/newview/llinventorybridge.cpp | 4 +- indra/newview/llinventorygallery.cpp | 2 +- indra/newview/llinventorymodel.cpp | 10 +-- indra/newview/llinventorymodelbackgroundfetch.cpp | 12 +-- indra/newview/llinventoryobserver.cpp | 2 +- indra/newview/lllogininstance.cpp | 2 +- indra/newview/llmarketplacefunctions.cpp | 58 ++++++------- indra/newview/llmaterialmgr.cpp | 20 ++--- indra/newview/llmediadataclient.cpp | 18 ++-- indra/newview/llmeshrepository.cpp | 26 +++--- indra/newview/llnotificationmanager.cpp | 2 +- indra/newview/llpanelavatar.cpp | 6 +- indra/newview/llpanellogin.cpp | 2 +- indra/newview/llpanelprofile.cpp | 12 +-- indra/newview/llpanelwearing.cpp | 4 +- indra/newview/llpathfindingcharacterlist.cpp | 2 +- indra/newview/llpathfindinglinksetlist.cpp | 2 +- indra/newview/llpathfindingmanager.cpp | 24 +++--- indra/newview/llpbrterrainfeatures.cpp | 12 +-- indra/newview/llpersistentnotificationstorage.cpp | 2 +- indra/newview/llproductinforequest.cpp | 4 +- indra/newview/llremoteparcelrequest.cpp | 4 +- indra/newview/llsnapshotlivepreview.cpp | 4 +- indra/newview/llspeakers.cpp | 6 +- indra/newview/llstartup.cpp | 6 +- indra/newview/llstatusbar.cpp | 6 +- indra/newview/llsyntaxid.cpp | 4 +- indra/newview/lltexturefetch.cpp | 10 +-- indra/newview/lltoast.cpp | 2 +- indra/newview/lltranslate.cpp | 16 ++-- indra/newview/llviewerassetstorage.cpp | 6 +- indra/newview/llviewerassetupload.cpp | 4 +- indra/newview/llviewerdisplayname.cpp | 6 +- indra/newview/llviewerinventory.cpp | 2 +- indra/newview/llviewermedia.cpp | 26 +++--- indra/newview/llviewermenufile.cpp | 7 +- indra/newview/llviewermessage.cpp | 14 ++-- indra/newview/llviewerobject.cpp | 4 +- indra/newview/llviewerobjectlist.cpp | 8 +- indra/newview/llviewerregion.cpp | 12 +-- indra/newview/llviewerwindow.cpp | 4 +- indra/newview/llvoavatarself.cpp | 6 +- indra/newview/llvoicechannel.cpp | 4 +- indra/newview/llvoicevivox.cpp | 12 +-- indra/newview/llvoicewebrtc.cpp | 44 +++++----- indra/newview/llwebprofile.cpp | 8 +- indra/newview/llwindowlistener.cpp | 2 +- indra/newview/llwlhandlers.cpp | 8 +- indra/newview/llxmlrpclistener.cpp | 2 +- indra/newview/llxmlrpctransaction.cpp | 15 +--- indra/viewer_components/login/lllogin.cpp | 2 +- 103 files changed, 506 insertions(+), 514 deletions(-) (limited to 'indra/newview/llinventorymodelbackgroundfetch.cpp') diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp index b82734615f..be1c74a908 100644 --- a/indra/llcharacter/llkeyframemotion.cpp +++ b/indra/llcharacter/llkeyframemotion.cpp @@ -1229,7 +1229,7 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8 bool LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, bool allow_invalid_joints) { bool old_version = false; - std::unique_ptr joint_motion_list(new LLKeyframeMotion::JointMotionList); + std::unique_ptr joint_motion_list = std::make_unique(); //------------------------------------------------------------------------- // get base priority @@ -1826,7 +1826,7 @@ bool LLKeyframeMotion::deserialize(LLDataPacker& dp, const LLUUID& asset_id, boo for(S32 i = 0; i < num_constraints; ++i) { // read in constraint data - std::unique_ptr constraintp(new JointConstraintSharedData); + std::unique_ptr constraintp = std::make_unique(); U8 byte = 0; if (!dp.unpackU8(byte, "chain_length")) diff --git a/indra/llcommon/llapr.cpp b/indra/llcommon/llapr.cpp index 01763c49aa..eeff2694a7 100644 --- a/indra/llcommon/llapr.cpp +++ b/indra/llcommon/llapr.cpp @@ -154,7 +154,7 @@ LLVolatileAPRPool::LLVolatileAPRPool(bool is_local, apr_pool_t *parent, apr_size //create mutex if(!is_local) //not a local apr_pool, that is: shared by multiple threads. { - mMutexp.reset(new std::mutex()); + mMutexp = std::make_unique(); } } diff --git a/indra/llcommon/llleap.cpp b/indra/llcommon/llleap.cpp index ada6b9519e..1614cc6e57 100644 --- a/indra/llcommon/llleap.cpp +++ b/indra/llcommon/llleap.cpp @@ -61,7 +61,7 @@ public: // Pass it a callback to our connect() method, so it can send events // from a particular LLEventPump to the plugin without having to know // this class or method name. - mListener(new LLLeapListener( + mListener(std::make_unique( [this](LLEventPump& pump, const std::string& listener) { return connect(pump, listener); })) { diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h index db716b1431..7dd8256e72 100644 --- a/indra/llcommon/llstring.h +++ b/indra/llcommon/llstring.h @@ -1234,9 +1234,9 @@ void LLStringUtilBase::getTokens(const string_type& string, std::vector > instrp; if (escapes.empty()) - instrp.reset(new LLStringUtilBaseImpl::InString(string.begin(), string.end())); + instrp = std::make_unique>(string.begin(), string.end()); else - instrp.reset(new LLStringUtilBaseImpl::InEscString(string.begin(), string.end(), escapes)); + instrp = std::make_unique>(string.begin(), string.end(), escapes); LLStringUtilBaseImpl::getTokens(*instrp, tokens, drop_delims, keep_delims, quotes); } diff --git a/indra/llcorehttp/_httpoprequest.cpp b/indra/llcorehttp/_httpoprequest.cpp index 081a4d9bac..1edc6f52ee 100644 --- a/indra/llcorehttp/_httpoprequest.cpp +++ b/indra/llcorehttp/_httpoprequest.cpp @@ -272,7 +272,7 @@ void HttpOpRequest::visitNotifier(HttpRequest * request) response->setContentType(mReplyConType); response->setRetries(mPolicyRetries, mPolicy503Retries); - HttpResponse::TransferStats::ptr_t stats = HttpResponse::TransferStats::ptr_t(new HttpResponse::TransferStats); + HttpResponse::TransferStats::ptr_t stats = std::make_shared(); curl_easy_getinfo(mCurlHandle, CURLINFO_SIZE_DOWNLOAD, &stats->mSizeDownload); curl_easy_getinfo(mCurlHandle, CURLINFO_TOTAL_TIME, &stats->mTotalTime); @@ -964,7 +964,7 @@ size_t HttpOpRequest::headerCallback(void * data, size_t size, size_t nmemb, voi // Save headers in response if (! op->mReplyHeaders) { - op->mReplyHeaders = HttpHeaders::ptr_t(new HttpHeaders); + op->mReplyHeaders = std::make_shared(); } op->mReplyHeaders->append(name, value ? value : ""); } diff --git a/indra/llcorehttp/httpcommon.h b/indra/llcorehttp/httpcommon.h index 511a17e000..ec0e538cf7 100644 --- a/indra/llcorehttp/httpcommon.h +++ b/indra/llcorehttp/httpcommon.h @@ -297,25 +297,25 @@ struct HttpStatus HttpStatus() { - mDetails = std::shared_ptr
(new Details(LLCORE, HE_SUCCESS)); + mDetails = std::make_shared
(LLCORE, HE_SUCCESS); } HttpStatus(type_enum_t type, short status) { - mDetails = std::shared_ptr
(new Details(type, status)); + mDetails = std::make_shared
(type, status); } HttpStatus(int http_status) { - mDetails = std::shared_ptr
(new Details(http_status, - (http_status >= 200 && http_status <= 299) ? HE_SUCCESS : HE_REPLY_ERROR)); + mDetails = std::make_shared
(http_status, + (http_status >= 200 && http_status <= 299) ? HE_SUCCESS : HE_REPLY_ERROR); llassert(http_status >= 100 && http_status <= 999); } HttpStatus(int http_status, const std::string &message) { - mDetails = std::shared_ptr
(new Details(http_status, - (http_status >= 200 && http_status <= 299) ? HE_SUCCESS : HE_REPLY_ERROR)); + mDetails = std::make_shared
(http_status, + (http_status >= 200 && http_status <= 299) ? HE_SUCCESS : HE_REPLY_ERROR); llassert(http_status >= 100 && http_status <= 999); mDetails->mMessage = message; } @@ -337,7 +337,7 @@ struct HttpStatus HttpStatus & clone(const HttpStatus &rhs) { - mDetails = std::shared_ptr
(new Details(*rhs.mDetails)); + mDetails = std::make_shared
(*rhs.mDetails); return *this; } diff --git a/indra/llcorehttp/httprequest.cpp b/indra/llcorehttp/httprequest.cpp index 2aaf71f8a4..d8fcd6a03f 100644 --- a/indra/llcorehttp/httprequest.cpp +++ b/indra/llcorehttp/httprequest.cpp @@ -60,7 +60,7 @@ HttpRequest::HttpRequest() mRequestQueue = HttpRequestQueue::instanceOf(); mRequestQueue->addRef(); - mReplyQueue.reset( new HttpReplyQueue() ); + mReplyQueue = std::make_shared(); HTTPStats::instance().recordHTTPRequest(); } @@ -129,7 +129,7 @@ HttpHandle HttpRequest::setPolicyOption(EPolicyOption opt, policy_t pclass, { HttpStatus status; - HttpOpSetGet::ptr_t op(new HttpOpSetGet()); + HttpOpSetGet::ptr_t op = std::make_shared(); if (! (status = op->setupSet(opt, pclass, value))) { mLastReqStatus = status; @@ -152,7 +152,7 @@ HttpHandle HttpRequest::setPolicyOption(EPolicyOption opt, policy_t pclass, { HttpStatus status; - HttpOpSetGet::ptr_t op (new HttpOpSetGet()); + HttpOpSetGet::ptr_t op = std::make_shared(); if (! (status = op->setupSet(opt, pclass, value))) { mLastReqStatus = status; @@ -190,7 +190,7 @@ HttpHandle HttpRequest::requestGet(policy_t policy_id, LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK; HttpStatus status; - HttpOpRequest::ptr_t op(new HttpOpRequest()); + HttpOpRequest::ptr_t op = std::make_shared(); if (! (status = op->setupGet(policy_id, url, options, headers))) { mLastReqStatus = status; @@ -219,7 +219,7 @@ HttpHandle HttpRequest::requestGetByteRange(policy_t policy_id, LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK; HttpStatus status; - HttpOpRequest::ptr_t op(new HttpOpRequest()); + HttpOpRequest::ptr_t op = std::make_shared(); if (! (status = op->setupGetByteRange(policy_id, url, offset, len, options, headers))) { mLastReqStatus = status; @@ -246,7 +246,7 @@ HttpHandle HttpRequest::requestPost(policy_t policy_id, { HttpStatus status; - HttpOpRequest::ptr_t op(new HttpOpRequest()); + HttpOpRequest::ptr_t op = std::make_shared(); if (! (status = op->setupPost(policy_id, url, body, options, headers))) { mLastReqStatus = status; @@ -273,7 +273,7 @@ HttpHandle HttpRequest::requestPut(policy_t policy_id, { HttpStatus status; - HttpOpRequest::ptr_t op (new HttpOpRequest()); + HttpOpRequest::ptr_t op = std::make_shared(); if (! (status = op->setupPut(policy_id, url, body, options, headers))) { mLastReqStatus = status; @@ -298,7 +298,7 @@ HttpHandle HttpRequest::requestDelete(policy_t policy_id, { HttpStatus status; - HttpOpRequest::ptr_t op(new HttpOpRequest()); + HttpOpRequest::ptr_t op = std::make_shared(); if (!(status = op->setupDelete(policy_id, url, options, headers))) { mLastReqStatus = status; @@ -324,7 +324,7 @@ HttpHandle HttpRequest::requestPatch(policy_t policy_id, { HttpStatus status; - HttpOpRequest::ptr_t op (new HttpOpRequest()); + HttpOpRequest::ptr_t op = std::make_shared(); if (!(status = op->setupPatch(policy_id, url, body, options, headers))) { mLastReqStatus = status; @@ -349,7 +349,7 @@ HttpHandle HttpRequest::requestCopy(policy_t policy_id, { HttpStatus status; - HttpOpRequest::ptr_t op(new HttpOpRequest()); + HttpOpRequest::ptr_t op = std::make_shared(); if (!(status = op->setupCopy(policy_id, url, options, headers))) { mLastReqStatus = status; @@ -375,7 +375,7 @@ HttpHandle HttpRequest::requestMove(policy_t policy_id, { HttpStatus status; - HttpOpRequest::ptr_t op (new HttpOpRequest()); + HttpOpRequest::ptr_t op = std::make_shared(); if (!(status = op->setupMove(policy_id, url, options, headers))) { mLastReqStatus = status; @@ -397,7 +397,7 @@ HttpHandle HttpRequest::requestNoOp(HttpHandler::ptr_t user_handler) { HttpStatus status; - HttpOperation::ptr_t op (new HttpOpNull()); + HttpOperation::ptr_t op = std::make_shared(); op->setReplyPath(mReplyQueue, user_handler); if (! (status = mRequestQueue->addOp(op))) // transfers refcount { @@ -463,7 +463,7 @@ HttpHandle HttpRequest::requestCancel(HttpHandle request, HttpHandler::ptr_t use { HttpStatus status; - HttpOperation::ptr_t op(new HttpOpCancel(request)); + HttpOperation::ptr_t op = std::make_shared(request); op->setReplyPath(mReplyQueue, user_handler); if (! (status = mRequestQueue->addOp(op))) // transfers refcount { @@ -528,7 +528,7 @@ HttpHandle HttpRequest::requestStopThread(HttpHandler::ptr_t user_handler) HttpStatus status; HttpHandle handle(LLCORE_HTTP_HANDLE_INVALID); - HttpOperation::ptr_t op(new HttpOpStop()); + HttpOperation::ptr_t op = std::make_shared(); op->setReplyPath(mReplyQueue, user_handler); if (! (status = mRequestQueue->addOp(op))) // transfers refcount { @@ -548,7 +548,7 @@ HttpHandle HttpRequest::requestSpin(int mode) HttpStatus status; HttpHandle handle(LLCORE_HTTP_HANDLE_INVALID); - HttpOperation::ptr_t op(new HttpOpSpin(mode)); + HttpOperation::ptr_t op = std::make_shared(mode); op->setReplyPath(mReplyQueue, HttpHandler::ptr_t()); if (! (status = mRequestQueue->addOp(op))) // transfers refcount { diff --git a/indra/llcorehttp/httprequest.h b/indra/llcorehttp/httprequest.h index e6e051410e..db5d5fa096 100644 --- a/indra/llcorehttp/httprequest.h +++ b/indra/llcorehttp/httprequest.h @@ -104,9 +104,9 @@ public: /// Represents a default, catch-all policy class that guarantees /// eventual service for any HTTP request. - static const policy_t DEFAULT_POLICY_ID = 0; - static const policy_t INVALID_POLICY_ID = 0xFFFFFFFFU; - static const policy_t GLOBAL_POLICY_ID = 0xFFFFFFFEU; + static constexpr policy_t DEFAULT_POLICY_ID = 0; + static constexpr policy_t INVALID_POLICY_ID = 0xFFFFFFFFU; + static constexpr policy_t GLOBAL_POLICY_ID = 0xFFFFFFFEU; /// Create a new policy class into which requests can be made. /// diff --git a/indra/llimage/llimageworker.cpp b/indra/llimage/llimageworker.cpp index bdaef0c653..46ab6a441e 100644 --- a/indra/llimage/llimageworker.cpp +++ b/indra/llimage/llimageworker.cpp @@ -67,7 +67,7 @@ private: LLImageDecodeThread::LLImageDecodeThread(bool /*threaded*/) : mDecodeCount(0) { - mThreadPool.reset(new LL::ThreadPool("ImageDecode", 8)); + mThreadPool = std::make_unique("ImageDecode", 8); mThreadPool->start(); } diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp index 9b4454a847..ebafc53a4d 100644 --- a/indra/llmessage/llavatarnamecache.cpp +++ b/indra/llmessage/llavatarnamecache.cpp @@ -117,9 +117,9 @@ LLAvatarNameCache::LLAvatarNameCache() mUsePeopleAPI = true; - sHttpRequest = LLCore::HttpRequest::ptr_t(new LLCore::HttpRequest()); - sHttpHeaders = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()); - sHttpOptions = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()); + sHttpRequest = std::make_shared(); + sHttpHeaders = std::make_shared(); + sHttpOptions = std::make_shared(); sHttpPolicy = LLCore::HttpRequest::DEFAULT_POLICY_ID; } diff --git a/indra/llmessage/llcoproceduremanager.cpp b/indra/llmessage/llcoproceduremanager.cpp index 5c7b1c4235..cd04d6f160 100644 --- a/indra/llmessage/llcoproceduremanager.cpp +++ b/indra/llmessage/llcoproceduremanager.cpp @@ -195,7 +195,7 @@ void LLCoprocedureManager::initializePool(const std::string &poolName, size_t qu LL_WARNS("CoProcMgr") << "LLCoprocedureManager: No setting for \"" << keyName << "\" setting pool size to default of " << size << LL_ENDL; } - poolPtr_t pool(new LLCoprocedurePool(poolName, size, queue_size)); + poolPtr_t pool = std::make_shared(poolName, size, queue_size); LL_ERRS_IF(!pool, "CoprocedureManager") << "Unable to create pool named \"" << poolName << "\" FATAL!" << LL_ENDL; bool inserted = mPoolMap.emplace(poolName, pool).second; @@ -365,7 +365,7 @@ LLCoprocedurePool::LLCoprocedurePool(const std::string &poolName, size_t size, s for (size_t count = 0; count < mPoolSize; ++count) { - LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter( mPoolName + "Adapter", mHTTPPolicy)); + LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter = std::make_shared(mPoolName + "Adapter", mHTTPPolicy); std::string pooledCoro = LLCoros::instance().launch( "LLCoprocedurePool("+mPoolName+")::coprocedureInvokerCoro", diff --git a/indra/llmessage/llcorehttputil.cpp b/indra/llmessage/llcorehttputil.cpp index 992e145758..28d9339bcf 100644 --- a/indra/llmessage/llcorehttputil.cpp +++ b/indra/llmessage/llcorehttputil.cpp @@ -666,9 +666,9 @@ const std::string HttpCoroutineAdapter::HTTP_RESULTS_HEADERS("headers"); const std::string HttpCoroutineAdapter::HTTP_RESULTS_CONTENT("content"); const std::string HttpCoroutineAdapter::HTTP_RESULTS_RAW("raw"); -HttpCoroutineAdapter::HttpCoroutineAdapter(const std::string &name, +HttpCoroutineAdapter::HttpCoroutineAdapter(std::string name, LLCore::HttpRequest::policy_t policyId) : - mAdapterName(name), + mAdapterName(std::move(name)), mPolicyId(policyId), mYieldingHandle(LLCORE_HTTP_HANDLE_INVALID), mWeakRequest(), @@ -686,7 +686,7 @@ LLSD HttpCoroutineAdapter::postAndSuspend(LLCore::HttpRequest::ptr_t request, LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers) { LLEventStream replyPump(mAdapterName, true); - HttpCoroHandler::ptr_t httpHandler(new HttpCoroLLSDHandler(replyPump)); + HttpCoroHandler::ptr_t httpHandler = std::make_shared(replyPump); return postAndSuspend_(request, url, body, options, headers, httpHandler); } @@ -723,7 +723,7 @@ LLSD HttpCoroutineAdapter::postAndSuspend(LLCore::HttpRequest::ptr_t request, LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers) { LLEventStream replyPump(mAdapterName, true); - HttpCoroHandler::ptr_t httpHandler(new HttpCoroLLSDHandler(replyPump)); + HttpCoroHandler::ptr_t httpHandler = std::make_shared(replyPump); return postAndSuspend_(request, url, rawbody, options, headers, httpHandler); } @@ -733,7 +733,7 @@ LLSD HttpCoroutineAdapter::postRawAndSuspend(LLCore::HttpRequest::ptr_t request, LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers) { LLEventStream replyPump(mAdapterName, true); - HttpCoroHandler::ptr_t httpHandler(new HttpCoroRawHandler(replyPump)); + HttpCoroHandler::ptr_t httpHandler = std::make_shared(replyPump); return postAndSuspend_(request, url, rawbody, options, headers, httpHandler); } @@ -797,7 +797,7 @@ LLSD HttpCoroutineAdapter::postJsonAndSuspend(LLCore::HttpRequest::ptr_t request LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers) { LLEventStream replyPump(mAdapterName, true); - HttpCoroHandler::ptr_t httpHandler(new HttpCoroJSONHandler(replyPump)); + HttpCoroHandler::ptr_t httpHandler = std::make_shared(replyPump); LLCore::BufferArray::ptr_t rawbody(new LLCore::BufferArray); @@ -846,7 +846,7 @@ LLSD HttpCoroutineAdapter::putAndSuspend(LLCore::HttpRequest::ptr_t request, LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers) { LLEventStream replyPump(mAdapterName + "Reply", true); - HttpCoroHandler::ptr_t httpHandler(new HttpCoroLLSDHandler(replyPump)); + HttpCoroHandler::ptr_t httpHandler = std::make_shared(replyPump); return putAndSuspend_(request, url, body, options, headers, httpHandler); } @@ -856,7 +856,7 @@ LLSD HttpCoroutineAdapter::putJsonAndSuspend(LLCore::HttpRequest::ptr_t request, LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers) { LLEventStream replyPump(mAdapterName, true); - HttpCoroHandler::ptr_t httpHandler(new HttpCoroJSONHandler(replyPump)); + HttpCoroHandler::ptr_t httpHandler = std::make_shared(replyPump); LLCore::BufferArray::ptr_t rawbody(new LLCore::BufferArray); @@ -931,7 +931,7 @@ LLSD HttpCoroutineAdapter::getAndSuspend(LLCore::HttpRequest::ptr_t request, LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers) { LLEventStream replyPump(mAdapterName + "Reply", true); - HttpCoroHandler::ptr_t httpHandler(new HttpCoroLLSDHandler(replyPump)); + HttpCoroHandler::ptr_t httpHandler = std::make_shared(replyPump); return getAndSuspend_(request, url, options, headers, httpHandler); } @@ -941,7 +941,7 @@ LLSD HttpCoroutineAdapter::getRawAndSuspend(LLCore::HttpRequest::ptr_t request, LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers) { LLEventStream replyPump(mAdapterName + "Reply", true); - HttpCoroHandler::ptr_t httpHandler(new HttpCoroRawHandler(replyPump)); + HttpCoroHandler::ptr_t httpHandler = std::make_shared(replyPump); return getAndSuspend_(request, url, options, headers, httpHandler); } @@ -950,7 +950,7 @@ LLSD HttpCoroutineAdapter::getJsonAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers) { LLEventStream replyPump(mAdapterName + "Reply", true); - HttpCoroHandler::ptr_t httpHandler(new HttpCoroJSONHandler(replyPump)); + HttpCoroHandler::ptr_t httpHandler = std::make_shared(replyPump); return getAndSuspend_(request, url, options, headers, httpHandler); } @@ -987,7 +987,7 @@ LLSD HttpCoroutineAdapter::deleteAndSuspend(LLCore::HttpRequest::ptr_t request, LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers) { LLEventStream replyPump(mAdapterName + "Reply", true); - HttpCoroHandler::ptr_t httpHandler(new HttpCoroLLSDHandler(replyPump)); + HttpCoroHandler::ptr_t httpHandler = std::make_shared(replyPump); return deleteAndSuspend_(request, url, options, headers, httpHandler); } @@ -997,7 +997,7 @@ LLSD HttpCoroutineAdapter::deleteJsonAndSuspend(LLCore::HttpRequest::ptr_t reque LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers) { LLEventStream replyPump(mAdapterName + "Reply", true); - HttpCoroHandler::ptr_t httpHandler(new HttpCoroJSONHandler(replyPump)); + HttpCoroHandler::ptr_t httpHandler = std::make_shared(replyPump); return deleteAndSuspend_(request, url, options, headers, httpHandler); } @@ -1032,7 +1032,7 @@ LLSD HttpCoroutineAdapter::patchAndSuspend(LLCore::HttpRequest::ptr_t request, LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers) { LLEventStream replyPump(mAdapterName + "Reply", true); - HttpCoroHandler::ptr_t httpHandler(new HttpCoroLLSDHandler(replyPump)); + HttpCoroHandler::ptr_t httpHandler = std::make_shared(replyPump); return patchAndSuspend_(request, url, body, options, headers, httpHandler); } @@ -1070,10 +1070,10 @@ LLSD HttpCoroutineAdapter::copyAndSuspend(LLCore::HttpRequest::ptr_t request, LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers) { LLEventStream replyPump(mAdapterName + "Reply", true); - HttpCoroHandler::ptr_t httpHandler(new HttpCoroLLSDHandler(replyPump)); + HttpCoroHandler::ptr_t httpHandler = std::make_shared(replyPump); if (!headers) - headers.reset(new LLCore::HttpHeaders); + headers = std::make_shared(); headers->append(HTTP_OUT_HEADER_DESTINATION, dest); return copyAndSuspend_(request, url, options, headers, httpHandler); @@ -1112,10 +1112,10 @@ LLSD HttpCoroutineAdapter::moveAndSuspend(LLCore::HttpRequest::ptr_t request, LLCore::HttpOptions::ptr_t options, LLCore::HttpHeaders::ptr_t headers) { LLEventStream replyPump(mAdapterName + "Reply", true); - HttpCoroHandler::ptr_t httpHandler(new HttpCoroLLSDHandler(replyPump)); + HttpCoroHandler::ptr_t httpHandler = std::make_shared(replyPump); if (!headers) - headers.reset(new LLCore::HttpHeaders); + headers = std::make_shared(); headers->append(HTTP_OUT_HEADER_DESTINATION, dest); return moveAndSuspend_(request, url, options, headers, httpHandler); @@ -1153,7 +1153,7 @@ LLSD HttpCoroutineAdapter::moveAndSuspend_(LLCore::HttpRequest::ptr_t &request, void HttpCoroutineAdapter::checkDefaultHeaders(LLCore::HttpHeaders::ptr_t &headers) { if (!headers) - headers.reset(new LLCore::HttpHeaders); + headers = std::make_shared(); if (!headers->find(HTTP_OUT_HEADER_ACCEPT)) { headers->append(HTTP_OUT_HEADER_ACCEPT, HTTP_CONTENT_LLSD_XML); @@ -1247,9 +1247,9 @@ void HttpCoroutineAdapter::messageHttpGet(const std::string &url, const std::str void HttpCoroutineAdapter::trivialGetCoro(std::string url, LLCore::HttpRequest::policy_t policyId, completionCallback_t success, completionCallback_t failure) { LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("genericGetCoro", policyId)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpAdapter = std::make_shared("genericGetCoro", policyId); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setWantHeaders(true); @@ -1298,9 +1298,9 @@ void HttpCoroutineAdapter::messageHttpPost(const std::string &url, const LLSD &p void HttpCoroutineAdapter::trivialPostCoro(std::string url, LLCore::HttpRequest::policy_t policyId, LLSD postData, completionCallback_t success, completionCallback_t failure) { LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("genericPostCoro", policyId)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpAdapter = std::make_shared("genericPostCoro", policyId); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setWantHeaders(true); @@ -1342,9 +1342,9 @@ void HttpCoroutineAdapter::callbackHttpDel(const std::string &url, LLCore::HttpR void HttpCoroutineAdapter::trivialDelCoro(std::string url, LLCore::HttpRequest::policy_t policyId, completionCallback_t success, completionCallback_t failure) { - LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("genericDelCoro", policyId)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter = std::make_shared("genericDelCoro", policyId); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setWantHeaders(true); diff --git a/indra/llmessage/llcorehttputil.h b/indra/llmessage/llcorehttputil.h index 45b673b9d5..111fa6a1a0 100644 --- a/indra/llmessage/llcorehttputil.h +++ b/indra/llmessage/llcorehttputil.h @@ -320,7 +320,7 @@ public: typedef std::shared_ptr ptr_t; typedef std::weak_ptr wptr_t; - HttpCoroutineAdapter(const std::string &name, LLCore::HttpRequest::policy_t policyId); + HttpCoroutineAdapter(std::string name, LLCore::HttpRequest::policy_t policyId); ~HttpCoroutineAdapter(); /// Execute a Post transaction on the supplied URL and yield execution of @@ -330,19 +330,19 @@ public: /// not be deallocated during the yield. LLSD postAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, const LLSD & body, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = std::make_shared(), + LLCore::HttpHeaders::ptr_t headers = std::make_shared()); LLSD postAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, LLCore::BufferArray::ptr_t rawbody, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = std::make_shared(), + LLCore::HttpHeaders::ptr_t headers = std::make_shared()); LLSD postAndSuspend(LLCore::HttpRequest::ptr_t &request, const std::string & url, const LLSD & body, LLCore::HttpHeaders::ptr_t &headers) { return postAndSuspend(request, url, body, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers); + std::make_shared(), headers); } LLSD postAndSuspend(LLCore::HttpRequest::ptr_t &request, @@ -350,59 +350,59 @@ public: LLCore::HttpHeaders::ptr_t &headers) { return postAndSuspend(request, url, rawbody, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers); + std::make_shared(), headers); } LLSD postRawAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, LLCore::BufferArray::ptr_t rawbody, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = std::make_shared(), + LLCore::HttpHeaders::ptr_t headers = std::make_shared()); LLSD postRawAndSuspend(LLCore::HttpRequest::ptr_t &request, const std::string & url, LLCore::BufferArray::ptr_t &rawbody, LLCore::HttpHeaders::ptr_t &headers) { return postRawAndSuspend(request, url, rawbody, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers); + std::make_shared(), headers); } LLSD postFileAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, std::string fileName, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = std::make_shared(), + LLCore::HttpHeaders::ptr_t headers = std::make_shared()); LLSD postFileAndSuspend(LLCore::HttpRequest::ptr_t &request, const std::string & url, std::string fileName, LLCore::HttpHeaders::ptr_t &headers) { return postFileAndSuspend(request, url, fileName, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers); + std::make_shared(), headers); } LLSD postFileAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, LLUUID assetId, LLAssetType::EType assetType, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = std::make_shared(), + LLCore::HttpHeaders::ptr_t headers = std::make_shared()); LLSD postFileAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, LLUUID assetId, LLAssetType::EType assetType, LLCore::HttpHeaders::ptr_t &headers) { return postFileAndSuspend(request, url, assetId, assetType, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers); + std::make_shared(), headers); } LLSD postJsonAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, const LLSD & body, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = std::make_shared(), + LLCore::HttpHeaders::ptr_t headers = std::make_shared()); LLSD postJsonAndSuspend(LLCore::HttpRequest::ptr_t &request, const std::string & url, const LLSD & body, LLCore::HttpHeaders::ptr_t &headers) { return postJsonAndSuspend(request, url, body, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers); + std::make_shared(), headers); } @@ -414,27 +414,27 @@ public: /// not be deallocated during the yield. LLSD putAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, const LLSD & body, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = std::make_shared(), + LLCore::HttpHeaders::ptr_t headers = std::make_shared()); LLSD putAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, const LLSD & body, LLCore::HttpHeaders::ptr_t headers) { return putAndSuspend(request, url, body, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers); + std::make_shared(), headers); } LLSD putJsonAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, const LLSD & body, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = std::make_shared(), + LLCore::HttpHeaders::ptr_t headers = std::make_shared()); LLSD putJsonAndSuspend(LLCore::HttpRequest::ptr_t &request, const std::string & url, const LLSD & body, LLCore::HttpHeaders::ptr_t &headers) { return putJsonAndSuspend(request, url, body, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers); + std::make_shared(), headers); } /// Execute a Get transaction on the supplied URL and yield execution of @@ -445,25 +445,25 @@ public: /// LLSD getAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = std::make_shared(), + LLCore::HttpHeaders::ptr_t headers = std::make_shared()); LLSD getAndSuspend(LLCore::HttpRequest::ptr_t &request, const std::string & url, LLCore::HttpHeaders::ptr_t &headers) { return getAndSuspend(request, url, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), + std::make_shared(), headers); } LLSD getRawAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = std::make_shared(), + LLCore::HttpHeaders::ptr_t headers = std::make_shared()); LLSD getRawAndSuspend(LLCore::HttpRequest::ptr_t &request, const std::string & url, LLCore::HttpHeaders::ptr_t &headers) { return getRawAndSuspend(request, url, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), + std::make_shared(), headers); } @@ -473,13 +473,13 @@ public: /// before being returned to the caller. LLSD getJsonAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = std::make_shared(), + LLCore::HttpHeaders::ptr_t headers = std::make_shared()); LLSD getJsonAndSuspend(LLCore::HttpRequest::ptr_t &request, const std::string & url, LLCore::HttpHeaders::ptr_t &headers) { return getJsonAndSuspend(request, url, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), + std::make_shared(), headers); } @@ -491,13 +491,13 @@ public: /// not be deallocated during the yield. LLSD deleteAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = std::make_shared(), + LLCore::HttpHeaders::ptr_t headers = std::make_shared()); LLSD deleteAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, LLCore::HttpHeaders::ptr_t headers) { return deleteAndSuspend(request, url, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), + std::make_shared(), headers); } @@ -507,13 +507,13 @@ public: /// before being returned to the caller. LLSD deleteJsonAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = std::make_shared(), + LLCore::HttpHeaders::ptr_t headers = std::make_shared()); LLSD deleteJsonAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, LLCore::HttpHeaders::ptr_t headers) { return deleteJsonAndSuspend(request, url, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), + std::make_shared(), headers); } @@ -525,14 +525,14 @@ public: /// not be deallocated during the yield. LLSD patchAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, const LLSD & body, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = std::make_shared(), + LLCore::HttpHeaders::ptr_t headers = std::make_shared()); LLSD patchAndSuspend(LLCore::HttpRequest::ptr_t &request, const std::string & url, const LLSD & body, LLCore::HttpHeaders::ptr_t &headers) { return patchAndSuspend(request, url, body, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers); + std::make_shared(), headers); } /// Execute a COPY transaction on the supplied URL and yield execution of @@ -545,14 +545,14 @@ public: /// not be deallocated during the yield. LLSD copyAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, const std::string dest, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = std::make_shared(), + LLCore::HttpHeaders::ptr_t headers = std::make_shared()); LLSD copyAndSuspend(LLCore::HttpRequest::ptr_t &request, const std::string & url, const std::string & dest, LLCore::HttpHeaders::ptr_t &headers) { return copyAndSuspend(request, url, dest, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers); + std::make_shared(), headers); } /// Execute a MOVE transaction on the supplied URL and yield execution of @@ -565,14 +565,14 @@ public: /// not be deallocated during the yield. LLSD moveAndSuspend(LLCore::HttpRequest::ptr_t request, const std::string & url, const std::string dest, - LLCore::HttpOptions::ptr_t options = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), - LLCore::HttpHeaders::ptr_t headers = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders())); + LLCore::HttpOptions::ptr_t options = std::make_shared(), + LLCore::HttpHeaders::ptr_t headers = std::make_shared()); LLSD moveAndSuspend(LLCore::HttpRequest::ptr_t &request, const std::string & url, const std::string & dest, LLCore::HttpHeaders::ptr_t &headers) { return moveAndSuspend(request, url, dest, - LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()), headers); + std::make_shared(), headers); } /// diff --git a/indra/llmessage/llexperiencecache.cpp b/indra/llmessage/llexperiencecache.cpp index 78cca47456..c8e0d8a671 100644 --- a/indra/llmessage/llexperiencecache.cpp +++ b/indra/llmessage/llexperiencecache.cpp @@ -249,7 +249,7 @@ const LLExperienceCache::cache_t& LLExperienceCache::getCached() void LLExperienceCache::requestExperiencesCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &httpAdapter, std::string url, RequestQueue_t requests) { - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest()); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); //LL_INFOS("requestExperiencesCoro") << "url: " << url << LL_ENDL; @@ -527,7 +527,7 @@ void LLExperienceCache::get(const LLUUID& key, LLExperienceCache::ExperienceGetF fetch(key); - signal_ptr signal = signal_ptr(new callback_signal_t()); + signal_ptr signal = std::make_shared(); std::pair result = mSignalMap.insert(signal_map_t::value_type(key, signal)); if (!result.second) @@ -562,7 +562,7 @@ void LLExperienceCache::fetchAssociatedExperience(const LLUUID& objectId, const void LLExperienceCache::fetchAssociatedExperienceCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &httpAdapter, LLUUID objectId, LLUUID itemId, std::string url, ExperienceGetFn_t fn) { - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest()); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); if (url.empty()) { @@ -624,7 +624,7 @@ void LLExperienceCache::findExperienceByName(const std::string text, int page, E void LLExperienceCache::findExperienceByNameCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &httpAdapter, std::string text, int page, ExperienceGetFn_t fn) { - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest()); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); std::ostringstream url; @@ -667,7 +667,7 @@ void LLExperienceCache::getGroupExperiences(const LLUUID &groupId, ExperienceGet void LLExperienceCache::getGroupExperiencesCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &httpAdapter, LLUUID groupId, ExperienceGetFn_t fn) { - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest()); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); // search for experiences owned by the current group std::string url = mCapability("GroupExperiences"); @@ -710,7 +710,7 @@ void LLExperienceCache::setRegionExperiences(CapabilityQuery_t regioncaps, const void LLExperienceCache::regionExperiencesCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &httpAdapter, CapabilityQuery_t regioncaps, bool update, LLSD experiences, ExperienceGetFn_t fn) { - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest()); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); // search for experiences owned by the current group std::string url = regioncaps("RegionExperiences"); @@ -822,7 +822,7 @@ void LLExperienceCache::forgetExperiencePermission(const LLUUID &experienceId, E void LLExperienceCache::experiencePermissionCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &httpAdapter, permissionInvoker_fn invokerfn, std::string url, ExperienceGetFn_t fn) { - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest()); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); // search for experiences owned by the current group @@ -853,7 +853,7 @@ void LLExperienceCache::getExperienceAdmin(const LLUUID &experienceId, Experienc void LLExperienceCache::getExperienceAdminCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &httpAdapter, LLUUID experienceId, ExperienceGetFn_t fn) { - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest()); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); std::string url = mCapability("IsExperienceAdmin"); if (url.empty()) @@ -885,7 +885,7 @@ void LLExperienceCache::updateExperience(LLSD updateData, ExperienceGetFn_t fn) void LLExperienceCache::updateExperienceCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &httpAdapter, LLSD updateData, ExperienceGetFn_t fn) { - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest()); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); std::string url = mCapability("UpdateExperience"); if (url.empty()) diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp index ad1ff86807..2a619dab98 100644 --- a/indra/llmessage/message.cpp +++ b/indra/llmessage/message.cpp @@ -913,7 +913,7 @@ LLStoredMessagePtr LLMessageSystem::getReceivedMessage() const const std::string& name = mMessageReader->getMessageName(); LLSD message = wrapReceivedTemplateData(); - return LLStoredMessagePtr(new LLStoredMessage(name, message)); + return std::make_shared(name, message); } LLStoredMessagePtr LLMessageSystem::getBuiltMessage() const @@ -921,7 +921,7 @@ LLStoredMessagePtr LLMessageSystem::getBuiltMessage() const const std::string& name = mMessageBuilder->getMessageName(); LLSD message = wrapBuiltTemplateData(); - return LLStoredMessagePtr(new LLStoredMessage(name, message)); + return std::make_shared(name, message); } S32 LLMessageSystem::sendMessage(const LLHost &host, LLStoredMessagePtr message) @@ -4028,9 +4028,9 @@ void LLMessageSystem::sendUntrustedSimulatorMessageCoro(std::string url, std::st { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("untrustedSimulatorMessage", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions); + httpAdapter = std::make_shared("untrustedSimulatorMessage", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); if (url.empty()) diff --git a/indra/llmessage/tests/llcoproceduremanager_test.cpp b/indra/llmessage/tests/llcoproceduremanager_test.cpp index 4caae5f082..0a77fd218b 100644 --- a/indra/llmessage/tests/llcoproceduremanager_test.cpp +++ b/indra/llmessage/tests/llcoproceduremanager_test.cpp @@ -48,7 +48,7 @@ #pragma warning(disable: 4702) #endif -LLCoreHttpUtil::HttpCoroutineAdapter::HttpCoroutineAdapter(std::string const&, unsigned int) +LLCoreHttpUtil::HttpCoroutineAdapter::HttpCoroutineAdapter(std::string name, LLCore::HttpRequest::policy_t policyId) { } diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h index 2865b789b9..07e8b890b8 100644 --- a/indra/llui/llfolderviewmodel.h +++ b/indra/llui/llfolderviewmodel.h @@ -432,11 +432,11 @@ public: virtual SortType& getSorter() { return *mSorter; } virtual const SortType& getSorter() const { return *mSorter; } - virtual void setSorter(const SortType& sorter) { mSorter.reset(new SortType(sorter)); requestSortAll(); } + virtual void setSorter(const SortType& sorter) { mSorter = std::make_unique(sorter); requestSortAll(); } virtual FilterType& getFilter() override { return *mFilter; } virtual const FilterType& getFilter() const override { return *mFilter; } - virtual void setFilter(const FilterType& filter) { mFilter.reset(new FilterType(filter)); } + virtual void setFilter(const FilterType& filter) { mFilter = std::make_unique(filter); } // By default, we assume the content is available. If a network fetch mechanism is implemented for the model, // this method needs to be overloaded and return the relevant fetch status. diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index a05feab1d9..0ffe6cff5e 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -457,7 +457,7 @@ LLNotificationTemplate::LLNotificationTemplate(const LLNotificationTemplate::Par mTags.push_back(tag.value); } - mForm = LLNotificationFormPtr(new LLNotificationForm(p.name, p.form_ref.form)); + mForm = std::make_shared(p.name, p.form_ref.form); } LLNotificationVisibilityRule::LLNotificationVisibilityRule(const LLNotificationVisibilityRule::Rule &p) @@ -875,7 +875,7 @@ void LLNotification::init(const std::string& template_name, const LLSD& form_ele // TODO: something like this so that a missing alert is sensible: //mSubstitutions["_ARGS"] = get_all_arguments_as_text(mSubstitutions); - mForm = LLNotificationFormPtr(new LLNotificationForm(*mTemplatep->mForm)); + mForm = std::make_shared(*mTemplatep->mForm); mForm->append(form_elements); // apply substitution to form labels @@ -1249,7 +1249,7 @@ LLNotifications::LLNotifications() : LLNotificationChannelBase(LLNotificationFilters::includeEverything), mIgnoreAllNotifications(false) { - mListener.reset(new LLNotificationsListener(*this)); + mListener = std::make_unique(*this); LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Notification.Show", boost::bind(&LLNotifications::addFromCallback, this, _2)); // touch the instance tracker for notification channels, so that it will still be around in our destructor @@ -1487,7 +1487,7 @@ bool LLNotifications::templateExists(std::string_view name) void LLNotifications::forceResponse(const LLNotification::Params& params, S32 option) { - LLNotificationPtr temp_notify(new LLNotification(params)); + LLNotificationPtr temp_notify = std::make_shared(params); if (!temp_notify->getForm()) { @@ -1653,7 +1653,7 @@ bool LLNotifications::loadTemplates() replaceFormText(notification.form_ref.form, "$ignoretext", notification.form_ref.form_template.ignore_text); } } - mTemplates[notification.name] = LLNotificationTemplatePtr(new LLNotificationTemplate(notification)); + mTemplates[notification.name] = std::make_shared(notification); } LL_INFOS("Notifications") << "...done" << LL_ENDL; @@ -1683,7 +1683,7 @@ bool LLNotifications::loadVisibilityRules() for (const LLNotificationVisibilityRule::Rule& rule : params.rules) { - mVisibilityRules.push_back(LLNotificationVisibilityRulePtr(new LLNotificationVisibilityRule(rule))); + mVisibilityRules.push_back(std::make_shared(rule)); } return true; @@ -1726,7 +1726,7 @@ LLNotificationPtr LLNotifications::add(const std::string& name, const LLSD& subs // generalized add function that takes a parameter block object for more complex instantiations LLNotificationPtr LLNotifications::add(const LLNotification::Params& p) { - LLNotificationPtr pNotif(new LLNotification(p)); + LLNotificationPtr pNotif = std::make_shared(p); add(pNotif); return pNotif; } @@ -1834,7 +1834,7 @@ void LLNotifications::update(const LLNotificationPtr pNotif) LLNotificationPtr LLNotifications::find(LLUUID uuid) { - LLNotificationPtr target = LLNotificationPtr(new LLNotification(LLNotification::Params().id(uuid))); + LLNotificationPtr target = std::make_shared(LLNotification::Params().id(uuid)); LLNotificationSet::iterator it=mItems.find(target); if (it == mItems.end()) { diff --git a/indra/llui/llnotificationslistener.cpp b/indra/llui/llnotificationslistener.cpp index 9c1fc27c51..d07d42bdba 100644 --- a/indra/llui/llnotificationslistener.cpp +++ b/indra/llui/llnotificationslistener.cpp @@ -266,7 +266,7 @@ void LLNotificationsListener::forward(const LLSD& params) entry(mForwarders.insert(ForwarderMap::value_type(channel, ForwarderMap::mapped_type())).first); if (! entry->second) { - entry->second.reset(new Forwarder(mNotifications, channel)); + entry->second = std::make_shared(mNotifications, channel); } // Now, whether this Forwarder is brand-new or not, update it with the new // request info. diff --git a/indra/newview/llaccountingcostmanager.cpp b/indra/newview/llaccountingcostmanager.cpp index 54d8ceb85a..b30fe16c58 100644 --- a/indra/newview/llaccountingcostmanager.cpp +++ b/indra/newview/llaccountingcostmanager.cpp @@ -53,8 +53,8 @@ void LLAccountingCostManager::accountingCostCoro(std::string url, LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("AccountingCost", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("accountingCostCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); try { diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index e95d192f72..a05261e430 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -464,7 +464,7 @@ LLAgent::LLAgent() : mControlsTakenPassedOnCount[i] = 0; } - mListener.reset(new LLAgentListener(*this)); + mListener = std::make_shared(*this); addParcelChangedCallback(&setCanEditParcel); @@ -4700,9 +4700,9 @@ void LLAgent::requestAgentUserInfoCoro(std::string capurl) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("requestAgentUserInfoCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpAdapter = std::make_shared("requestAgentUserInfoCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); LLCore::HttpHeaders::ptr_t httpHeaders; httpOpts->setFollowRedirects(true); @@ -4760,9 +4760,9 @@ void LLAgent::updateAgentUserInfoCoro(std::string capurl, std::string directory_ { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("requestAgentUserInfoCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpAdapter = std::make_shared("requestAgentUserInfoCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); LLCore::HttpHeaders::ptr_t httpHeaders; httpOpts->setFollowRedirects(true); diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index 5114ac8a08..eecd42d427 100644 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -861,8 +861,8 @@ void AISAPI::InvokeAISCommandCoro(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t ht return; } - LLCore::HttpOptions::ptr_t httpOptions(new LLCore::HttpOptions); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest()); + LLCore::HttpOptions::ptr_t httpOptions = std::make_shared(); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLCore::HttpHeaders::ptr_t httpHeaders; httpOptions->setTimeout(HTTP_TIMEOUT); diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 0d57b33a51..f65aaccddc 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -3908,7 +3908,7 @@ void LLAppearanceMgr::serverAppearanceUpdateCoro(LLCoreHttpUtil::HttpCoroutineAd LL_DEBUGS("Avatar") << "Will send request for cof_version " << cofVersion << LL_ENDL; bRetry = false; - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest()); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); if (gSavedSettings.getBOOL("DebugForceAppearanceRequestFailure")) { @@ -4379,8 +4379,8 @@ LLAppearanceMgr::LLAppearanceMgr(): outfit_observer.addCOFSavedCallback(boost::bind( &LLAppearanceMgr::setOutfitLocked, this, false)); - mUnlockOutfitTimer.reset(new LLOutfitUnLockTimer((F32)gSavedSettings.getS32( - "OutfitOperationsTimeout"))); + mUnlockOutfitTimer = std::make_unique((F32)gSavedSettings.getS32( + "OutfitOperationsTimeout")); gIdleCallbacks.addFunction(&LLAttachmentsMgr::onIdle, NULL); gIdleCallbacks.addFunction(&LLAppearanceMgr::onIdle, NULL); //sheduling appearance update requests diff --git a/indra/newview/llavatarpropertiesprocessor.cpp b/indra/newview/llavatarpropertiesprocessor.cpp index 7dce627044..9d9948731f 100644 --- a/indra/newview/llavatarpropertiesprocessor.cpp +++ b/indra/newview/llavatarpropertiesprocessor.cpp @@ -269,11 +269,11 @@ void LLAvatarPropertiesProcessor::requestAvatarPropertiesCoro(std::string cap_ur LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("requestAvatarPropertiesCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("requestAvatarPropertiesCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLCore::HttpHeaders::ptr_t httpHeaders; - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setFollowRedirects(true); std::string finalUrl = cap_url + "/" + avatar_id.asString(); diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index 44f35981b0..309bed6f8b 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -77,9 +77,9 @@ void LLAvatarRenderInfoAccountant::avatarRenderInfoGetCoro(std::string url, U64 { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("AvatarRenderInfoAccountant", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpAdapter = std::make_shared("AvatarRenderInfoAccountant", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); // Going to request each 15 seconds either way, so don't wait // too long and don't repeat @@ -194,9 +194,9 @@ void LLAvatarRenderInfoAccountant::avatarRenderInfoReportCoro(std::string url, U { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("AvatarRenderInfoAccountant", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpAdapter = std::make_shared("AvatarRenderInfoAccountant", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); // Going to request each 60+ seconds, timeout is 30s. // Don't repeat too often, will be sending newer data soon diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp index 552ea75559..e0236ca618 100644 --- a/indra/newview/llcompilequeue.cpp +++ b/indra/newview/llcompilequeue.cpp @@ -467,7 +467,7 @@ bool LLFloaterCompileQueue::processScript(LLHandle hfloat std::string url = object->getRegion()->getCapability("UpdateScriptTask"); { - LLResourceUploadInfo::ptr_t uploadInfo(new LLQueuedScriptAssetUpload(object->getID(), + LLResourceUploadInfo::ptr_t uploadInfo = std::make_shared(object->getID(), inventory->getUUID(), assetId, monocompile ? LLScriptAssetUpload::MONO : LLScriptAssetUpload::LSL2, @@ -475,7 +475,7 @@ bool LLFloaterCompileQueue::processScript(LLHandle hfloat inventory->getName(), LLUUID(), experienceId, - boost::bind(&LLFloaterCompileQueue::handleHTTPResponse, pump.getName(), _4))); + boost::bind(&LLFloaterCompileQueue::handleHTTPResponse, pump.getName(), _4)); LLViewerAssetUpload::EnqueueInventoryUpload(url, uploadInfo); } diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index 875dac103c..938791d6d7 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -2022,8 +2022,8 @@ void LLEnvironment::coroRequestEnvironment(S32 parcel_id, LLEnvironment::environ { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("ResetEnvironment", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("ResetEnvironment", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); std::string url = gAgent.getRegionCapability("ExtEnvironment"); if (url.empty()) @@ -2070,8 +2070,8 @@ void LLEnvironment::coroUpdateEnvironment(S32 parcel_id, S32 track_no, UpdateInf { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("ResetEnvironment", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("ResetEnvironment", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); std::string url = gAgent.getRegionCapability("ExtEnvironment"); if (url.empty()) @@ -2186,8 +2186,8 @@ void LLEnvironment::coroResetEnvironment(S32 parcel_id, S32 track_no, environmen { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("ResetEnvironment", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("ResetEnvironment", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); std::string url = gAgent.getRegionCapability("ExtEnvironment"); if (url.empty()) @@ -3418,8 +3418,8 @@ namespace { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("testExperiencesOnParcelCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("testExperiencesOnParcelCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); std::string url = gAgent.getRegionCapability("ExperienceQuery"); if (url.empty()) diff --git a/indra/newview/llestateinfomodel.cpp b/indra/newview/llestateinfomodel.cpp index a7d18d85ce..54be045c3d 100644 --- a/indra/newview/llestateinfomodel.cpp +++ b/indra/newview/llestateinfomodel.cpp @@ -138,8 +138,8 @@ void LLEstateInfoModel::commitEstateInfoCapsCoro(std::string url) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("EstateChangeInfo", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("EstateChangeInfo", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD body; body["estate_name"] = getName(); diff --git a/indra/newview/lleventpoll.cpp b/indra/newview/lleventpoll.cpp index 86c58a3497..de3752d879 100644 --- a/indra/newview/lleventpoll.cpp +++ b/indra/newview/lleventpoll.cpp @@ -90,7 +90,7 @@ namespace Details { LLAppCoreHttp & app_core_http(LLAppViewer::instance()->getAppCoreHttp()); - mHttpRequest = LLCore::HttpRequest::ptr_t(new LLCore::HttpRequest); + mHttpRequest = std::make_shared(); mHttpPolicy = app_core_http.getPolicy(LLAppCoreHttp::AP_LONG_POLL); mSenderIp = sender.getIPandPort(); } @@ -144,7 +144,7 @@ namespace Details void LLEventPollImpl::eventPollCoro(std::string url) { - LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("EventPoller", mHttpPolicy)); + LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter = std::make_shared("EventPoller", mHttpPolicy); LLSD acknowledge; int errorCount = 0; int counter = mCounter; // saved on the stack for logging. @@ -156,7 +156,7 @@ namespace Details // This is a loop with its own waitToRetry implementation, // so disable retries. - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setRetries(0); LL::WorkQueue::ptr_t main_queue = nullptr; diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index a6419f5ad4..05f6c4a867 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -105,7 +105,7 @@ private: static const std::string sCheckUpdateListenerName; static void startFetchServerReleaseNotes(); - static void fetchServerReleaseNotesCoro(const std::string& cap_url); + static void fetchServerReleaseNotesCoro(const std::string cap_url); static void handleServerReleaseNotes(LLSD results); }; @@ -227,12 +227,12 @@ void LLFloaterAbout::startFetchServerReleaseNotes() } /*static*/ -void LLFloaterAbout::fetchServerReleaseNotesCoro(const std::string& cap_url) +void LLFloaterAbout::fetchServerReleaseNotesCoro(const std::string cap_url) { LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("fetchServerReleaseNotesCoro", LLCore::HttpRequest::DEFAULT_POLICY_ID)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpAdapter = std::make_shared("fetchServerReleaseNotesCoro", LLCore::HttpRequest::DEFAULT_POLICY_ID); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setWantHeaders(true); httpOpts->setFollowRedirects(false); diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index fd9bbf00ae..c7851013c7 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -410,9 +410,9 @@ void LLFloaterAvatarPicker::findByIdCoro(std::string url, LLUUID query_id, LLUUI { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("findByIdCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpAdapter = std::make_shared("findByIdCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setTimeout(AVATAR_PICKER_SEARCH_TIMEOUT); @@ -445,9 +445,9 @@ void LLFloaterAvatarPicker::findByNameCoro(std::string url, LLUUID queryID, std: { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("findByNameCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpAdapter = std::make_shared("findByNameCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); LL_INFOS("HttpCoroutineAdapter", "genericPostCoro", "Agent") << "Generic POST for " << url << LL_ENDL; diff --git a/indra/newview/llfloaterbvhpreview.cpp b/indra/newview/llfloaterbvhpreview.cpp index 392079efe4..3acf28044c 100644 --- a/indra/newview/llfloaterbvhpreview.cpp +++ b/indra/newview/llfloaterbvhpreview.cpp @@ -1021,7 +1021,7 @@ void LLFloaterBvhPreview::onBtnOK(void* userdata) std::string desc = floaterp->getChild("description_form")->getValue().asString(); S32 expected_upload_cost = LLAgentBenefitsMgr::current().getAnimationUploadCost(); - LLResourceUploadInfo::ptr_t assetUploadInfo(new LLResourceUploadInfo( + LLResourceUploadInfo::ptr_t assetUploadInfo = std::make_shared( floaterp->mTransactionID, LLAssetType::AT_ANIMATION, name, desc, 0, LLFolderType::FT_NONE, LLInventoryType::IT_ANIMATION, @@ -1029,7 +1029,7 @@ void LLFloaterBvhPreview::onBtnOK(void* userdata) LLFloaterPerms::getGroupPerms("Uploads"), LLFloaterPerms::getEveryonePerms("Uploads"), expected_upload_cost, - floaterp->mDestinationFolderId)); + floaterp->mDestinationFolderId); upload_new_resource(assetUploadInfo); } diff --git a/indra/newview/llfloaterexperiences.cpp b/indra/newview/llfloaterexperiences.cpp index 9e00fb0fbb..f4cb3a04f5 100644 --- a/indra/newview/llfloaterexperiences.cpp +++ b/indra/newview/llfloaterexperiences.cpp @@ -366,10 +366,10 @@ void LLFloaterExperiences::retrieveExperienceListCoro(std::string url, { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("retrieveExperienceListCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOptions(new LLCore::HttpOptions); - LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); + httpAdapter = std::make_shared("retrieveExperienceListCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOptions = std::make_shared(); + LLCore::HttpHeaders::ptr_t httpHeaders = std::make_shared(); if (url.empty()) diff --git a/indra/newview/llfloatergridstatus.cpp b/indra/newview/llfloatergridstatus.cpp index b6b844b307..e8e36b5c93 100644 --- a/indra/newview/llfloatergridstatus.cpp +++ b/indra/newview/llfloatergridstatus.cpp @@ -90,10 +90,10 @@ void LLFloaterGridStatus::getGridStatusRSSCoro() LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getGridStatusRSSCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); - LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); + httpAdapter = std::make_shared("getGridStatusRSSCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); + LLCore::HttpHeaders::ptr_t httpHeaders = std::make_shared(); httpOpts->setSSLVerifyPeer(false); // We want this data even if SSL fails httpHeaders->append(HTTP_OUT_HEADER_CONTENT_TYPE, HTTP_CONTENT_TEXT_XML); diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index 82b5fd23fc..bbff3e4c86 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -280,7 +280,7 @@ void LLFloaterImagePreview::onBtnOK() LLFileSystem fmt_file(new_asset_id, LLAssetType::AT_TEXTURE, LLFileSystem::WRITE); fmt_file.write(formatted->getData(), formatted->getDataSize()); - LLResourceUploadInfo::ptr_t assetUploadInfo(new LLResourceUploadInfo( + LLResourceUploadInfo::ptr_t assetUploadInfo = std::make_shared( tid, LLAssetType::AT_TEXTURE, getChild("name_form")->getValue().asString(), getChild("description_form")->getValue().asString(), @@ -291,7 +291,7 @@ void LLFloaterImagePreview::onBtnOK() LLFloaterPerms::getEveryonePerms("Uploads"), expected_upload_cost, mDestinationFolderId - )); + ); upload_new_resource(assetUploadInfo); } diff --git a/indra/newview/llfloatermodeluploadbase.cpp b/indra/newview/llfloatermodeluploadbase.cpp index ec4f7593ca..dd53d0ffcf 100644 --- a/indra/newview/llfloatermodeluploadbase.cpp +++ b/indra/newview/llfloatermodeluploadbase.cpp @@ -66,8 +66,8 @@ void LLFloaterModelUploadBase::requestAgentUploadPermissionsCoro(std::string url { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("MeshUploadFlag", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("MeshUploadFlag", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD result = httpAdapter->getAndSuspend(httpRequest, url); diff --git a/indra/newview/llfloatermyscripts.cpp b/indra/newview/llfloatermyscripts.cpp index 0283855f15..8685243867 100644 --- a/indra/newview/llfloatermyscripts.cpp +++ b/indra/newview/llfloatermyscripts.cpp @@ -93,8 +93,8 @@ void LLFloaterMyScripts::getAttachmentLimitsCoro(std::string url) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getAttachmentLimitsCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("getAttachmentLimitsCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD result = httpAdapter->getAndSuspend(httpRequest, url); diff --git a/indra/newview/llfloaterpay.cpp b/indra/newview/llfloaterpay.cpp index e4e7c4ee39..c557c25d65 100644 --- a/indra/newview/llfloaterpay.cpp +++ b/indra/newview/llfloaterpay.cpp @@ -154,7 +154,7 @@ bool LLFloaterPay::postBuild() { S32 i = 0; - give_money_ptr info = give_money_ptr(new LLGiveMoneyInfo(this, PAY_BUTTON_DEFAULT_0)); + give_money_ptr info = std::make_shared(this, PAY_BUTTON_DEFAULT_0); mCallbackData.push_back(info); childSetAction("fastpay 1", boost::bind(LLFloaterPay::onGive, info)); @@ -164,7 +164,7 @@ bool LLFloaterPay::postBuild() mQuickPayInfo[i] = info; ++i; - info = give_money_ptr(new LLGiveMoneyInfo(this, PAY_BUTTON_DEFAULT_1)); + info = std::make_shared(this, PAY_BUTTON_DEFAULT_1); mCallbackData.push_back(info); childSetAction("fastpay 5", boost::bind(LLFloaterPay::onGive, info)); @@ -174,7 +174,7 @@ bool LLFloaterPay::postBuild() mQuickPayInfo[i] = info; ++i; - info = give_money_ptr(new LLGiveMoneyInfo(this, PAY_BUTTON_DEFAULT_2)); + info = std::make_shared(this, PAY_BUTTON_DEFAULT_2); mCallbackData.push_back(info); childSetAction("fastpay 10", boost::bind(LLFloaterPay::onGive, info)); @@ -184,7 +184,7 @@ bool LLFloaterPay::postBuild() mQuickPayInfo[i] = info; ++i; - info = give_money_ptr(new LLGiveMoneyInfo(this, PAY_BUTTON_DEFAULT_3)); + info = std::make_shared(this, PAY_BUTTON_DEFAULT_3); mCallbackData.push_back(info); childSetAction("fastpay 20", boost::bind(LLFloaterPay::onGive, info)); diff --git a/indra/newview/llfloaterperms.cpp b/indra/newview/llfloaterperms.cpp index 7311f0deb6..4c3578119e 100644 --- a/indra/newview/llfloaterperms.cpp +++ b/indra/newview/llfloaterperms.cpp @@ -209,8 +209,8 @@ void LLFloaterPermsDefault::updateCapCoro(std::string url) std::string previousReason; LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("genericPostCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("updateCapCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD postData = LLSD::emptyMap(); postData["default_object_perm_masks"]["Group"] = diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 99161d8d93..43731dd766 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -410,11 +410,11 @@ void LLFloaterPreference::saveAvatarPropertiesCoro(const std::string cap_url, bo { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("put_avatar_properties_coro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("put_avatar_properties_coro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLCore::HttpHeaders::ptr_t httpHeaders; - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setFollowRedirects(true); std::string finalUrl = cap_url + "/" + gAgentID.asString(); @@ -3511,7 +3511,7 @@ void LLFloaterPreference::collectSearchableItems() LLTabContainer *pRoot = getChild< LLTabContainer >( "pref core" ); if( mFilterEdit && pRoot ) { - mSearchData.reset(new ll::prefs::SearchData() ); + mSearchData = std::make_unique(); ll::prefs::TabContainerDataPtr pRootTabcontainer = ll::prefs::TabContainerDataPtr( new ll::prefs::TabContainerData ); pRootTabcontainer->mTabContainer = pRoot; diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 334f32d051..5a9b529a0c 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -4033,8 +4033,8 @@ void LLPanelEstateAccess::updateLists() void LLPanelEstateAccess::requestEstateGetAccessCoro(std::string url) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); - LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("requestEstateGetAccessoCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter = std::make_shared("requestEstateGetAccessoCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD result = httpAdapter->getAndSuspend(httpRequest, url); diff --git a/indra/newview/llfloaterregionrestartschedule.cpp b/indra/newview/llfloaterregionrestartschedule.cpp index 59bcb22dce..cd699efd5b 100644 --- a/indra/newview/llfloaterregionrestartschedule.cpp +++ b/indra/newview/llfloaterregionrestartschedule.cpp @@ -272,9 +272,9 @@ void LLFloaterRegionRestartSchedule::requestRegionShcheduleCoro(std::string url, { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("RegionShcheduleRequest", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpAdapter = std::make_shared("RegionShcheduleRequest", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setWantHeaders(true); @@ -367,9 +367,9 @@ void LLFloaterRegionRestartSchedule::setRegionShcheduleCoro(std::string url, LLS { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("RegionShcheduleSetter", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpAdapter = std::make_shared("RegionShcheduleSetter", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setWantHeaders(true); diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index e2c6305f4f..7e7eb91636 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -417,8 +417,8 @@ void LLFloaterReporter::requestAbuseCategoriesCoro(std::string url, LLHandle("requestAbuseCategoriesCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD result = httpAdapter->getAndSuspend(httpRequest, url); @@ -860,7 +860,7 @@ void LLFloaterReporter::sendReportViaCaps(std::string url, std::string sshot_url if(!sshot_url.empty()) { // try to upload screenshot - LLResourceUploadInfo::ptr_t uploadInfo(new LLARScreenShotUploader(report, mResourceDatap->mAssetInfo.mUuid, mResourceDatap->mAssetInfo.mType)); + LLResourceUploadInfo::ptr_t uploadInfo = std::make_shared(report, mResourceDatap->mAssetInfo.mUuid, mResourceDatap->mAssetInfo.mType); LLViewerAssetUpload::EnqueueInventoryUpload(sshot_url, uploadInfo); } else diff --git a/indra/newview/llfloaterscriptlimits.cpp b/indra/newview/llfloaterscriptlimits.cpp index f789036e5e..58d624a7d0 100644 --- a/indra/newview/llfloaterscriptlimits.cpp +++ b/indra/newview/llfloaterscriptlimits.cpp @@ -178,8 +178,8 @@ void LLPanelScriptLimitsRegionMemory::getLandScriptResourcesCoro(std::string url { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getLandScriptResourcesCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("getLandScriptResourcesCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD postData; @@ -222,8 +222,8 @@ void LLPanelScriptLimitsRegionMemory::getLandScriptSummaryCoro(std::string url) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getLandScriptSummaryCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("getLandScriptSummaryCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD result = httpAdapter->getAndSuspend(httpRequest, url); @@ -274,8 +274,8 @@ void LLPanelScriptLimitsRegionMemory::getLandScriptDetailsCoro(std::string url) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getLandScriptDetailsCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("getLandScriptDetailsCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD result = httpAdapter->getAndSuspend(httpRequest, url); diff --git a/indra/newview/llfloatersimplesnapshot.cpp b/indra/newview/llfloatersimplesnapshot.cpp index c0de8ab811..55b39d9193 100644 --- a/indra/newview/llfloatersimplesnapshot.cpp +++ b/indra/newview/llfloatersimplesnapshot.cpp @@ -54,11 +54,11 @@ void post_thumbnail_image_coro(std::string cap_url, std::string path_to_image, L { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("post_profile_image_coro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("post_profile_image_coro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLCore::HttpHeaders::ptr_t httpHeaders; - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setFollowRedirects(true); LLSD result = httpAdapter->postAndSuspend(httpRequest, cap_url, first_data, httpOpts, httpHeaders); @@ -87,9 +87,9 @@ void post_thumbnail_image_coro(std::string cap_url, std::string path_to_image, L // Upload the image - LLCore::HttpRequest::ptr_t uploaderhttpRequest(new LLCore::HttpRequest); - LLCore::HttpHeaders::ptr_t uploaderhttpHeaders(new LLCore::HttpHeaders); - LLCore::HttpOptions::ptr_t uploaderhttpOpts(new LLCore::HttpOptions); + LLCore::HttpRequest::ptr_t uploaderhttpRequest = std::make_shared(); + LLCore::HttpHeaders::ptr_t uploaderhttpHeaders = std::make_shared(); + LLCore::HttpOptions::ptr_t uploaderhttpOpts = std::make_shared(); S64 length; { diff --git a/indra/newview/llfloatertos.cpp b/indra/newview/llfloatertos.cpp index 8eec5b753a..da4b509738 100644 --- a/indra/newview/llfloatertos.cpp +++ b/indra/newview/llfloatertos.cpp @@ -248,9 +248,9 @@ void LLFloaterTOS::testSiteIsAliveCoro(LLHandle handle, std::string u { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("genericPostCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions); + httpAdapter = std::make_shared("testSiteIsAliveCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setWantHeaders(true); httpOpts->setHeadersOnly(true); diff --git a/indra/newview/llfloaterurlentry.cpp b/indra/newview/llfloaterurlentry.cpp index 2f1857ec61..9696c3d3f8 100644 --- a/indra/newview/llfloaterurlentry.cpp +++ b/indra/newview/llfloaterurlentry.cpp @@ -201,10 +201,10 @@ void LLFloaterURLEntry::getMediaTypeCoro(std::string url, LLHandle pa { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getMediaTypeCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); - LLCore::HttpOptions::ptr_t httpOpts = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions); + httpAdapter = std::make_shared("getMediaTypeCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpHeaders::ptr_t httpHeaders = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setFollowRedirects(true); httpOpts->setHeadersOnly(true); diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp index 1bbeba43ec..550af7af53 100644 --- a/indra/newview/llgesturemgr.cpp +++ b/indra/newview/llgesturemgr.cpp @@ -71,7 +71,7 @@ LLGestureMgr::LLGestureMgr() mLoadingCount(0) { gInventory.addObserver(this); - mListener.reset(new LLGestureListener()); + mListener = std::make_shared(); } diff --git a/indra/newview/llgltfmateriallist.cpp b/indra/newview/llgltfmateriallist.cpp index 3e4aadc381..ac8477a615 100644 --- a/indra/newview/llgltfmateriallist.cpp +++ b/indra/newview/llgltfmateriallist.cpp @@ -723,9 +723,9 @@ void LLGLTFMaterialList::modifyMaterialCoro(std::string cap_url, LLSD overrides, { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("modifyMaterialCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpAdapter = std::make_shared("modifyMaterialCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); LLCore::HttpHeaders::ptr_t httpHeaders; httpOpts->setFollowRedirects(true); diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index d53b36e59f..e0da762279 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -1975,8 +1975,8 @@ void LLGroupMgr::getGroupBanRequestCoro(std::string url, LLUUID group_id) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("groupMembersRequest", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("groupMembersRequest", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); std::string finalUrl = url + "?group_id=" + group_id.asString(); @@ -2004,10 +2004,10 @@ void LLGroupMgr::postGroupBanRequestCoro(std::string url, LLUUID group_id, { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("groupMembersRequest", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); - LLCore::HttpOptions::ptr_t httpOptions(new LLCore::HttpOptions); + httpAdapter = std::make_shared("groupMembersRequest", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpHeaders::ptr_t httpHeaders = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOptions = std::make_shared(); httpOptions->setFollowRedirects(false); @@ -2141,9 +2141,9 @@ void LLGroupMgr::groupMembersRequestCoro(std::string url, LLUUID group_id, U32 p << ", sort_column: " << sort_column << ", sort_descending: " << sort_descending << LL_ENDL; LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("groupMembersRequest", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpAdapter = std::make_shared("groupMembersRequest", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); LLSD postData = LLSD::emptyMap(); postData["group_id"] = group_id; diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp index 7cd0171a37..fe567ac7ec 100644 --- a/indra/newview/llimprocessing.cpp +++ b/indra/newview/llimprocessing.cpp @@ -1551,8 +1551,8 @@ void LLIMProcessing::requestOfflineMessagesCoro(std::string url) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("requestOfflineMessagesCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("requestOfflineMessagesCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD result = httpAdapter->getAndSuspend(httpRequest, url); diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index bda4afcc04..ad01e11d48 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -429,8 +429,8 @@ void startConferenceCoro(std::string url, { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("ConferenceChatStart", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("ConferenceChatStart", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD postData; postData["method"] = "start conference"; @@ -478,8 +478,8 @@ void startConferenceCoro(std::string url, void startP2PVoiceCoro(std::string url, LLUUID sessionID, LLUUID creatorId, LLUUID otherParticipantId) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); - LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("StartP2PVoiceCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter = std::make_shared("StartP2PVoiceCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD postData; postData["method"] = "start p2p voice"; @@ -518,8 +518,8 @@ void chatterBoxInvitationCoro(std::string url, LLUUID sessionId, LLIMMgr::EInvit { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("ConferenceInviteStart", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("ConferenceInviteStart", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD postData; postData["method"] = "accept invitation"; @@ -636,8 +636,8 @@ void chatterBoxHistoryCoro(std::string url, LLUUID sessionId, std::string from, { // if parameters from, message and timestamp have values, they are a message that opened chat LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("ChatHistory", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("ChatHistory", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD postData; postData["method"] = "fetch history"; diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index e322d3ae28..848f28f933 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3316,7 +3316,7 @@ bool move_inv_category_world_to_agent(const LLUUID& object_id, if (drop && accept) { - std::shared_ptr move_inv(new LLMoveInv); + std::shared_ptr move_inv = std::make_shared(); move_inv->mObjectID = object_id; move_inv->mCategoryID = category_id; move_inv->mCallback = callback; @@ -5989,7 +5989,7 @@ bool LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, if (accept && drop) { LLUUID item_id = inv_item->getUUID(); - std::shared_ptr move_inv (new LLMoveInv()); + std::shared_ptr move_inv = std::make_shared(); move_inv->mObjectID = inv_item->getParentUUID(); two_uuids_t item_pair(mUUID, item_id); move_inv->mMoveList.push_back(item_pair); diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp index c54af7d9f1..97c80cc01d 100644 --- a/indra/newview/llinventorygallery.cpp +++ b/indra/newview/llinventorygallery.cpp @@ -3582,7 +3582,7 @@ bool dragItemIntoFolder(LLUUID folder_id, LLInventoryItem* inv_item, bool drop, if (accept && drop) { - std::shared_ptr move_inv (new LLMoveInv()); + std::shared_ptr move_inv = std::make_shared(); move_inv->mObjectID = inv_item->getParentUUID(); std::pair item_pair(folder_id, inv_item->getUUID()); move_inv->mMoveList.push_back(item_pair); diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 2dfc3b014f..8de0a3c648 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1107,9 +1107,9 @@ void LLInventoryModel::createNewCategoryCoro(std::string url, LLSD postData, inv { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("createNewCategoryCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpAdapter = std::make_shared("createNewCategoryCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setWantHeaders(true); @@ -3257,11 +3257,11 @@ void LLInventoryModel::initHttpRequest() mHttpRequestFG = new LLCore::HttpRequest; mHttpRequestBG = new LLCore::HttpRequest; - mHttpOptions = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions); + mHttpOptions = std::make_shared(); mHttpOptions->setTransferTimeout(300); mHttpOptions->setUseRetryAfter(true); // mHttpOptions->setTrace(2); // Do tracing of requests - mHttpHeaders = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders); + mHttpHeaders = std::make_shared(); mHttpHeaders->append(HTTP_OUT_HEADER_CONTENT_TYPE, HTTP_CONTENT_LLSD_XML); mHttpHeaders->append(HTTP_OUT_HEADER_ACCEPT, HTTP_CONTENT_LLSD_XML); mHttpPolicyClass = app_core_http.getPolicy(LLAppCoreHttp::AP_INVENTORY); diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp index d538d42972..fa02b0f5ab 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.cpp +++ b/indra/newview/llinventorymodelbackgroundfetch.cpp @@ -1217,7 +1217,7 @@ void LLInventoryModelBackgroundFetch::bulkFetch() if (! url.empty()) { - LLCore::HttpHandler::ptr_t handler(new BGFolderHttpHandler(folder_request_body, recursive_cats)); + LLCore::HttpHandler::ptr_t handler = std::make_shared(folder_request_body, recursive_cats); gInventory.requestPost(false, url, folder_request_body, handler, "Inventory Folder"); } } @@ -1228,7 +1228,7 @@ void LLInventoryModelBackgroundFetch::bulkFetch() if (! url.empty()) { - LLCore::HttpHandler::ptr_t handler(new BGFolderHttpHandler(folder_request_body_lib, recursive_cats)); + LLCore::HttpHandler::ptr_t handler = std::make_shared(folder_request_body_lib, recursive_cats); gInventory.requestPost(false, url, folder_request_body_lib, handler, "Library Folder"); } } @@ -1244,7 +1244,7 @@ void LLInventoryModelBackgroundFetch::bulkFetch() { LLSD body; body["items"] = item_request_body; - LLCore::HttpHandler::ptr_t handler(new BGItemHttpHandler(body)); + LLCore::HttpHandler::ptr_t handler = std::make_shared(body); gInventory.requestPost(false, url, body, handler, "Inventory Item"); } } @@ -1257,7 +1257,7 @@ void LLInventoryModelBackgroundFetch::bulkFetch() { LLSD body; body["items"] = item_request_body_lib; - LLCore::HttpHandler::ptr_t handler(new BGItemHttpHandler(body)); + LLCore::HttpHandler::ptr_t handler = std::make_shared(body); gInventory.requestPost(false, url, body, handler, "Library Item"); } } @@ -1543,7 +1543,7 @@ void BGFolderHttpHandler::processFailure(LLCore::HttpStatus status, LLCore::Http { LLSD request_body; request_body["folders"] = folders; - LLCore::HttpHandler::ptr_t handler(new BGFolderHttpHandler(request_body, recursive_cats)); + LLCore::HttpHandler::ptr_t handler = std::make_shared(request_body, recursive_cats); gInventory.requestPost(false, url, request_body, handler, "Inventory Folder"); recursive_cats.clear(); folders.clear(); @@ -1553,7 +1553,7 @@ void BGFolderHttpHandler::processFailure(LLCore::HttpStatus status, LLCore::Http LLSD request_body; request_body["folders"] = folders; - LLCore::HttpHandler::ptr_t handler(new BGFolderHttpHandler(request_body, recursive_cats)); + LLCore::HttpHandler::ptr_t handler = std::make_shared(request_body, recursive_cats); gInventory.requestPost(false, url, request_body, handler, "Inventory Folder"); return; } diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index ac22be9d5a..a50d6b579e 100644 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -249,7 +249,7 @@ void fetch_items_from_llsd(const LLSD& items_llsd) if (!url.empty()) { body[i]["agent_id"] = gAgent.getID(); - LLCore::HttpHandler::ptr_t handler(new LLInventoryModel::FetchItemHttpHandler(body[i])); + LLCore::HttpHandler::ptr_t handler = std::make_shared(body[i]); gInventory.requestPost(true, url, body[i], handler, (i ? "Library Item" : "Inventory Item")); continue; } diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index 41cec4f074..e9d68723d3 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -80,7 +80,7 @@ std::string construct_start_string(); LLLoginInstance::LLLoginInstance() : - mLoginModule(new LLLogin()), + mLoginModule(std::make_unique()), mNotifications(NULL), mLoginState("offline"), mSaveMFA(true), diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp index 7b8211ded8..ac2f52a262 100644 --- a/indra/newview/llmarketplacefunctions.cpp +++ b/indra/newview/llmarketplacefunctions.cpp @@ -206,10 +206,10 @@ namespace LLMarketplaceImport { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("marketplacePostCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpAdapter = std::make_shared("marketplacePostCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpHeaders::ptr_t httpHeaders = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setWantHeaders(true); httpOpts->setFollowRedirects(true); @@ -267,17 +267,17 @@ namespace LLMarketplaceImport { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("marketplaceGetCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("marketplaceGetCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLCore::HttpHeaders::ptr_t httpHeaders; - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setWantHeaders(true); httpOpts->setFollowRedirects(!sMarketplaceCookie.empty()); if (buildHeaders) { - httpHeaders = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders); + httpHeaders = std::make_shared(); httpHeaders->append(HTTP_OUT_HEADER_ACCEPT, "*/*"); httpHeaders->append(HTTP_OUT_HEADER_COOKIE, sMarketplaceCookie); @@ -783,9 +783,9 @@ void LLMarketplaceData::getMerchantStatusCoro() { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getMerchantStatusCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpAdapter = std::make_shared("getMerchantStatusCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setFollowRedirects(true); @@ -861,9 +861,9 @@ void LLMarketplaceData::getSLMListingsCoro(LLUUID folderId) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getMerchantStatusCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); + httpAdapter = std::make_shared("getSLMListingsCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpHeaders::ptr_t httpHeaders = std::make_shared(); httpHeaders->append("Accept", "application/json"); httpHeaders->append("Content-Type", "application/json"); @@ -926,9 +926,9 @@ void LLMarketplaceData::getSingleListingCoro(S32 listingId, LLUUID folderId) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getMerchantStatusCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); + httpAdapter = std::make_shared("getSingleListingCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpHeaders::ptr_t httpHeaders = std::make_shared(); httpHeaders->append("Accept", "application/json"); httpHeaders->append("Content-Type", "application/json"); @@ -997,9 +997,9 @@ void LLMarketplaceData::createSLMListingCoro(LLUUID folderId, LLUUID versionId, { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getMerchantStatusCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); + httpAdapter = std::make_shared("createSLMListingCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpHeaders::ptr_t httpHeaders = std::make_shared(); httpHeaders->append("Accept", "application/json"); httpHeaders->append("Content-Type", "application/json"); @@ -1071,9 +1071,9 @@ void LLMarketplaceData::updateSLMListingCoro(LLUUID folderId, S32 listingId, LLU { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getMerchantStatusCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); + httpAdapter = std::make_shared("updateSLMListingCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpHeaders::ptr_t httpHeaders = std::make_shared(); httpHeaders->append("Accept", "application/json"); httpHeaders->append("Content-Type", "application/json"); @@ -1166,9 +1166,9 @@ void LLMarketplaceData::associateSLMListingCoro(LLUUID folderId, S32 listingId, { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getMerchantStatusCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); + httpAdapter = std::make_shared("associateSLMListingCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpHeaders::ptr_t httpHeaders = std::make_shared(); httpHeaders->append("Accept", "application/json"); httpHeaders->append("Content-Type", "application/json"); @@ -1247,9 +1247,9 @@ void LLMarketplaceData::deleteSLMListingCoro(S32 listingId) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getMerchantStatusCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); + httpAdapter = std::make_shared("deleteSLMListingCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpHeaders::ptr_t httpHeaders = std::make_shared(); httpHeaders->append("Accept", "application/json"); httpHeaders->append("Content-Type", "application/json"); diff --git a/indra/newview/llmaterialmgr.cpp b/indra/newview/llmaterialmgr.cpp index ee5e5b438e..c80d2a55ab 100644 --- a/indra/newview/llmaterialmgr.cpp +++ b/indra/newview/llmaterialmgr.cpp @@ -137,9 +137,9 @@ LLMaterialMgr::LLMaterialMgr(): { LLAppCoreHttp & app_core_http(LLAppViewer::instance()->getAppCoreHttp()); - mHttpRequest = LLCore::HttpRequest::ptr_t(new LLCore::HttpRequest()); - mHttpHeaders = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()); - mHttpOptions = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()); + mHttpRequest = std::make_shared(); + mHttpHeaders = std::make_shared(); + mHttpOptions = std::make_shared(); mHttpPolicy = app_core_http.getPolicy(LLAppCoreHttp::AP_MATERIALS); mMaterials.insert(std::pair(LLMaterialID::null, LLMaterialPtr(NULL))); @@ -684,9 +684,9 @@ void LLMaterialMgr::processGetQueue() LLSD postData = LLSD::emptyMap(); postData[MATERIALS_CAP_ZIP_FIELD] = materialBinary; - LLCore::HttpHandler::ptr_t handler(new LLMaterialHttpHandler("POST", + LLCore::HttpHandler::ptr_t handler = std::make_shared("POST", boost::bind(&LLMaterialMgr::onGetResponse, this, _1, _2, region_id) - )); + ); LL_DEBUGS("Materials") << "POSTing to region '" << regionp->getName() << "' at '" << capURL << " for " << materialsData.size() << " materials." << "\ndata: " << ll_pretty_print_sd(materialsData) << LL_ENDL; @@ -864,9 +864,9 @@ void LLMaterialMgr::processGetAllQueueCoro(LLUUID regionId) LL_DEBUGS("Materials") << "GET all for region " << regionId << "url " << capURL << LL_ENDL; - LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter( - new LLCoreHttpUtil::HttpCoroutineAdapter("processGetAllQueue", LLCore::HttpRequest::DEFAULT_POLICY_ID)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest()); + LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t + httpAdapter = std::make_shared("processGetAllQueue", LLCore::HttpRequest::DEFAULT_POLICY_ID); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD result = httpAdapter->getAndSuspend(httpRequest, capURL); @@ -973,9 +973,9 @@ void LLMaterialMgr::processPutQueue() LL_DEBUGS("Materials") << "put for " << itRequest->second.size() << " faces to region " << itRequest->first->getName() << LL_ENDL; - LLCore::HttpHandler::ptr_t handler (new LLMaterialHttpHandler("PUT", + LLCore::HttpHandler::ptr_t handler = std::make_shared("PUT", boost::bind(&LLMaterialMgr::onPutResponse, this, _1, _2) - )); + ); LLCore::HttpHandle handle = LLCoreHttpUtil::requestPutWithLLSD( mHttpRequest, mHttpPolicy, capURL, diff --git a/indra/newview/llmediadataclient.cpp b/indra/newview/llmediadataclient.cpp index 83a6e66019..50236587ac 100644 --- a/indra/newview/llmediadataclient.cpp +++ b/indra/newview/llmediadataclient.cpp @@ -172,9 +172,9 @@ LLMediaDataClient::LLMediaDataClient(F32 queue_timer_delay, F32 retry_timer_dela mMaxSortedQueueSize(max_sorted_queue_size), mMaxRoundRobinQueueSize(max_round_robin_queue_size), mQueueTimerIsRunning(false), - mHttpRequest(new LLCore::HttpRequest()), - mHttpHeaders(new LLCore::HttpHeaders()), - mHttpOpts(new LLCore::HttpOptions()), + mHttpRequest(std::make_shared()), + mHttpHeaders(std::make_shared()), + mHttpOpts(std::make_shared()), mHttpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID) { // *TODO: Look up real Policy ID @@ -660,7 +660,7 @@ void LLMediaDataClient::Handler::onFailure(LLCore::HttpResponse * response, LLCo void LLObjectMediaDataClient::fetchMedia(LLMediaDataClientObject *object) { // Create a get request and put it in the queue. - enqueue(Request::ptr_t(new RequestGet(object, this))); + enqueue(std::make_shared(object, this)); } const char *LLObjectMediaDataClient::getCapabilityName() const @@ -880,14 +880,14 @@ LLSD LLObjectMediaDataClient::RequestGet::getPayload() const LLCore::HttpHandler::ptr_t LLObjectMediaDataClient::RequestGet::createHandler() { - return LLCore::HttpHandler::ptr_t(new LLObjectMediaDataClient::Handler(shared_from_this())); + return std::make_shared(shared_from_this()); } void LLObjectMediaDataClient::updateMedia(LLMediaDataClientObject *object) { // Create an update request and put it in the queue. - enqueue(Request::ptr_t(new RequestUpdate(object, this))); + enqueue(std::make_shared(object, this)); } LLObjectMediaDataClient::RequestUpdate::RequestUpdate(LLMediaDataClientObject *obj, LLMediaDataClient *mdc): @@ -917,7 +917,7 @@ LLSD LLObjectMediaDataClient::RequestUpdate::getPayload() const LLCore::HttpHandler::ptr_t LLObjectMediaDataClient::RequestUpdate::createHandler() { // This just uses the base class's responder. - return LLCore::HttpHandler::ptr_t(new LLMediaDataClient::Handler(shared_from_this())); + return std::make_shared(shared_from_this()); } void LLObjectMediaDataClient::Handler::onSuccess(LLCore::HttpResponse * response, const LLSD &content) @@ -1037,7 +1037,7 @@ void LLObjectMediaNavigateClient::navigate(LLMediaDataClientObject *object, U8 t // LL_INFOS("LLMediaDataClient") << "navigate() initiated: " << ll_print_sd(sd_payload) << LL_ENDL; // Create a get request and put it in the queue. - enqueue(Request::ptr_t(new RequestNavigate(object, this, texture_index, url))); + enqueue(std::make_shared(object, this, texture_index, url)); } LLObjectMediaNavigateClient::RequestNavigate::RequestNavigate(LLMediaDataClientObject *obj, LLMediaDataClient *mdc, U8 texture_index, const std::string &url): @@ -1058,7 +1058,7 @@ LLSD LLObjectMediaNavigateClient::RequestNavigate::getPayload() const LLCore::HttpHandler::ptr_t LLObjectMediaNavigateClient::RequestNavigate::createHandler() { - return LLCore::HttpHandler::ptr_t(new LLObjectMediaNavigateClient::Handler(shared_from_this())); + return std::make_shared(shared_from_this()); } void LLObjectMediaNavigateClient::Handler::onSuccess(LLCore::HttpResponse * response, const LLSD &content) diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 413f02b723..c2ef8e5abc 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -943,20 +943,20 @@ LLMeshRepoThread::LLMeshRepoThread() mSkinMapMutex = new LLMutex(); mSignal = new LLCondition(); mHttpRequest = new LLCore::HttpRequest; - mHttpOptions = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions); + mHttpOptions = std::make_shared(); mHttpOptions->setTransferTimeout(SMALL_MESH_XFER_TIMEOUT); mHttpOptions->setUseRetryAfter(gSavedSettings.getBOOL("MeshUseHttpRetryAfter")); - mHttpLargeOptions = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions); + mHttpLargeOptions = std::make_shared(); mHttpLargeOptions->setTransferTimeout(LARGE_MESH_XFER_TIMEOUT); mHttpLargeOptions->setUseRetryAfter(gSavedSettings.getBOOL("MeshUseHttpRetryAfter")); - mHttpHeaders = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders); + mHttpHeaders = std::make_shared(); mHttpHeaders->append(HTTP_OUT_HEADER_ACCEPT, HTTP_CONTENT_VND_LL_MESH); mHttpPolicyClass = app_core_http.getPolicy(LLAppCoreHttp::AP_MESH2); mHttpLargePolicyClass = app_core_http.getPolicy(LLAppCoreHttp::AP_LARGE_MESH); // Lod processing is expensive due to the number of requests // and a need to do expensive cacheOptimize(). - mMeshThreadPool.reset(new LL::ThreadPool("MeshLodProcessing", 2)); + mMeshThreadPool = std::make_unique("MeshLodProcessing", 2); mMeshThreadPool->start(); } @@ -1653,7 +1653,7 @@ bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id) if (!http_url.empty()) { - LLMeshHandlerBase::ptr_t handler(new LLMeshSkinInfoHandler(mesh_id, offset, size)); + LLMeshHandlerBase::ptr_t handler = std::make_shared(mesh_id, offset, size); LLCore::HttpHandle handle = getByteRange(http_url, offset, size, handler); if (LLCORE_HTTP_HANDLE_INVALID == handle) { @@ -1761,7 +1761,7 @@ bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id) if (!http_url.empty()) { - LLMeshHandlerBase::ptr_t handler(new LLMeshDecompositionHandler(mesh_id, offset, size)); + LLMeshHandlerBase::ptr_t handler = std::make_shared(mesh_id, offset, size); LLCore::HttpHandle handle = getByteRange(http_url, offset, size, handler); if (LLCORE_HTTP_HANDLE_INVALID == handle) { @@ -1860,7 +1860,7 @@ bool LLMeshRepoThread::fetchMeshPhysicsShape(const LLUUID& mesh_id) if (!http_url.empty()) { - LLMeshHandlerBase::ptr_t handler(new LLMeshPhysicsShapeHandler(mesh_id, offset, size)); + LLMeshHandlerBase::ptr_t handler = std::make_shared(mesh_id, offset, size); LLCore::HttpHandle handle = getByteRange(http_url, offset, size, handler); if (LLCORE_HTTP_HANDLE_INVALID == handle) { @@ -1988,7 +1988,7 @@ bool LLMeshRepoThread::fetchMeshHeader(const LLVolumeParams& mesh_params) //within the first 4KB //NOTE -- this will break of headers ever exceed 4KB - LLMeshHandlerBase::ptr_t handler(new LLMeshHeaderHandler(mesh_params, 0, MESH_HEADER_SIZE)); + LLMeshHandlerBase::ptr_t handler = std::make_shared(mesh_params, 0, MESH_HEADER_SIZE); LLCore::HttpHandle handle = getByteRange(http_url, 0, MESH_HEADER_SIZE, handler); if (LLCORE_HTTP_HANDLE_INVALID == handle) { @@ -2164,7 +2164,7 @@ bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod) { LL_DEBUGS(LOG_MESH) << "Mesh/Cache: Mesh body for ID " << mesh_id << " - was retrieved from the simulator." << LL_ENDL; - LLMeshHandlerBase::ptr_t handler(new LLMeshLODHandler(mesh_params, lod, offset, size)); + LLMeshHandlerBase::ptr_t handler = std::make_shared(mesh_params, lod, offset, size); LLCore::HttpHandle handle = getByteRange(http_url, offset, size, handler); if (LLCORE_HTTP_HANDLE_INVALID == handle) { @@ -2611,11 +2611,11 @@ LLMeshUploadThread::LLMeshUploadThread(LLMeshUploadThread::instance_list_t& data mMeshUploadTimeOut = gSavedSettings.getS32("MeshUploadTimeOut"); mHttpRequest = new LLCore::HttpRequest; - mHttpOptions = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions); + mHttpOptions = std::make_shared(); mHttpOptions->setTransferTimeout(mMeshUploadTimeOut); mHttpOptions->setUseRetryAfter(gSavedSettings.getBOOL("MeshUseHttpRetryAfter")); mHttpOptions->setRetries(UPLOAD_RETRY_LIMIT); - mHttpHeaders = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders); + mHttpHeaders = std::make_shared(); mHttpHeaders->append(HTTP_OUT_HEADER_CONTENT_TYPE, HTTP_CONTENT_LLSD_XML); mHttpPolicyClass = LLAppViewer::instance()->getAppCoreHttp().getPolicy(LLAppCoreHttp::AP_UPLOADS); } @@ -4321,7 +4321,7 @@ S32 LLMeshRepository::loadMesh(LLVOVolume* vobj, const LLVolumeParams& mesh_para else { //first request for this mesh - std::shared_ptr request(new PendingRequestLOD(mesh_params, new_lod)); + std::shared_ptr request = std::make_shared(mesh_params, new_lod); mPendingRequests.emplace_back(request); mLoadingMeshes[new_lod][mesh_id].initData(vobj, request); LLMeshRepository::sLODPending++; @@ -4819,7 +4819,7 @@ const LLMeshSkinInfo* LLMeshRepository::getSkinInfo(const LLUUID& mesh_id, LLVOV else { //first request for this mesh - std::shared_ptr request(new PendingRequestUUID(mesh_id, MESH_REQUEST_SKIN)); + std::shared_ptr request = std::make_shared(mesh_id, MESH_REQUEST_SKIN); mLoadingSkins[mesh_id].initData(requesting_obj, request); mPendingRequests.emplace_back(request); } diff --git a/indra/newview/llnotificationmanager.cpp b/indra/newview/llnotificationmanager.cpp index 505f276f8c..29f11f7ca6 100644 --- a/indra/newview/llnotificationmanager.cpp +++ b/indra/newview/llnotificationmanager.cpp @@ -60,7 +60,7 @@ void LLNotificationManager::init() mChannels.emplace_back(new LLBrowserNotification()); mChannels.emplace_back(new LLIMHandler()); - mChatHandler = std::shared_ptr(new LLFloaterIMNearbyChatHandler()); + mChatHandler = std::make_shared(); } //-------------------------------------------------------------------------- diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 0e72771bd8..35624436b3 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -126,11 +126,11 @@ static void put_avatar_properties_coro(std::string cap_url, LLUUID agent_id, LLS { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("put_avatar_properties_coro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("put_avatar_properties_coro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLCore::HttpHeaders::ptr_t httpHeaders; - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setFollowRedirects(true); std::string finalUrl = cap_url + "/" + agent_id.asString(); diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index ed80c8b732..fe9145bf71 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -183,7 +183,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, : LLPanel(), mCallback(callback), mCallbackData(cb_data), - mListener(new LLPanelLoginListener(this)), + mListener(std::make_unique(this)), mFirstLoginThisInstall(gSavedSettings.getBOOL("FirstLoginThisInstall")), mUsernameLength(0), mPasswordLength(0), diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index fe172c8726..34d2d4d6a5 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -106,11 +106,11 @@ LLUUID post_profile_image(std::string cap_url, const LLSD &first_data, std::stri { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("post_profile_image_coro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("post_profile_image_coro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLCore::HttpHeaders::ptr_t httpHeaders; - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setFollowRedirects(true); LLSD result = httpAdapter->postAndSuspend(httpRequest, cap_url, first_data, httpOpts, httpHeaders); @@ -138,9 +138,9 @@ LLUUID post_profile_image(std::string cap_url, const LLSD &first_data, std::stri } // Upload the image - LLCore::HttpRequest::ptr_t uploaderhttpRequest(new LLCore::HttpRequest); - LLCore::HttpHeaders::ptr_t uploaderhttpHeaders(new LLCore::HttpHeaders); - LLCore::HttpOptions::ptr_t uploaderhttpOpts(new LLCore::HttpOptions); + LLCore::HttpRequest::ptr_t uploaderhttpRequest = std::make_shared(); + LLCore::HttpHeaders::ptr_t uploaderhttpHeaders = std::make_shared(); + LLCore::HttpOptions::ptr_t uploaderhttpOpts = std::make_shared(); S64 length; { diff --git a/indra/newview/llpanelwearing.cpp b/indra/newview/llpanelwearing.cpp index 3aedde74c6..4fcce50df1 100644 --- a/indra/newview/llpanelwearing.cpp +++ b/indra/newview/llpanelwearing.cpp @@ -466,8 +466,8 @@ void LLPanelWearing::getAttachmentLimitsCoro(std::string url) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getAttachmentLimitsCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("getAttachmentLimitsCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD result = httpAdapter->getAndSuspend(httpRequest, url); diff --git a/indra/newview/llpathfindingcharacterlist.cpp b/indra/newview/llpathfindingcharacterlist.cpp index 1366ba6c6f..8e03492381 100644 --- a/indra/newview/llpathfindingcharacterlist.cpp +++ b/indra/newview/llpathfindingcharacterlist.cpp @@ -65,7 +65,7 @@ void LLPathfindingCharacterList::parseCharacterListData(const LLSD& pCharacterLi continue; const std::string& uuid(characterDataIter->first); const LLSD& characterData = characterDataIter->second; - LLPathfindingObjectPtr character(new LLPathfindingCharacter(uuid, characterData)); + LLPathfindingObjectPtr character = std::make_shared(uuid, characterData); objectMap.insert(std::pair(uuid, character)); } } diff --git a/indra/newview/llpathfindinglinksetlist.cpp b/indra/newview/llpathfindinglinksetlist.cpp index 2012d7a094..81efb0a6fc 100644 --- a/indra/newview/llpathfindinglinksetlist.cpp +++ b/indra/newview/llpathfindinglinksetlist.cpp @@ -206,7 +206,7 @@ void LLPathfindingLinksetList::parseLinksetListData(const LLSD& pLinksetListData const LLSD& linksetData = linksetDataIter->second; if(linksetData.size() != 0) { - LLPathfindingObjectPtr linksetPtr(new LLPathfindingLinkset(uuid, linksetData)); + LLPathfindingObjectPtr linksetPtr = std::make_shared(uuid, linksetData); objectMap.insert(std::pair(uuid, linksetPtr)); } } diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index 84a62b3cbf..c9b0978a38 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -451,8 +451,8 @@ void LLPathfindingManager::navMeshStatusRequestCoro(std::string url, U64 regionH { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("NavMeshStatusRequest", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("NavMeshStatusRequest", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLViewerRegion *region = LLWorld::getInstance()->getRegionFromHandle(regionHandle); if (!region) @@ -541,8 +541,8 @@ void LLPathfindingManager::navAgentStateRequestCoro(std::string url) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("NavAgentStateRequest", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("NavAgentStateRequest", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD result = httpAdapter->getAndSuspend(httpRequest, url); @@ -569,8 +569,8 @@ void LLPathfindingManager::navMeshRebakeCoro(std::string url, rebake_navmesh_cal { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("NavMeshRebake", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("NavMeshRebake", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD postData = LLSD::emptyMap(); @@ -598,8 +598,8 @@ void LLPathfindingManager::linksetObjectsCoro(std::string url, LinksetsResponder { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("LinksetObjects", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("LinksetObjects", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD result; @@ -634,8 +634,8 @@ void LLPathfindingManager::linksetTerrainCoro(std::string url, LinksetsResponder { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("LinksetTerrain", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("LinksetTerrain", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD result; @@ -669,8 +669,8 @@ void LLPathfindingManager::charactersCoro(std::string url, request_id_t requestI { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("LinksetTerrain", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("charactersCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD result = httpAdapter->getAndSuspend(httpRequest, url); diff --git a/indra/newview/llpbrterrainfeatures.cpp b/indra/newview/llpbrterrainfeatures.cpp index bb771c6963..d652e23dd5 100644 --- a/indra/newview/llpbrterrainfeatures.cpp +++ b/indra/newview/llpbrterrainfeatures.cpp @@ -86,9 +86,9 @@ void LLPBRTerrainFeatures::queryRegionCoro(std::string cap_url, LLUUID region_id { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("queryRegionCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpAdapter = std::make_shared("queryRegionCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); LLCore::HttpHeaders::ptr_t httpHeaders; httpOpts->setFollowRedirects(true); @@ -159,9 +159,9 @@ void LLPBRTerrainFeatures::modifyRegionCoro(std::string cap_url, LLSD updates, v { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("modifyRegionCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpAdapter = std::make_shared("modifyRegionCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); LLCore::HttpHeaders::ptr_t httpHeaders; httpOpts->setFollowRedirects(true); diff --git a/indra/newview/llpersistentnotificationstorage.cpp b/indra/newview/llpersistentnotificationstorage.cpp index e06d025f59..1cc311e1b5 100644 --- a/indra/newview/llpersistentnotificationstorage.cpp +++ b/indra/newview/llpersistentnotificationstorage.cpp @@ -141,7 +141,7 @@ void LLPersistentNotificationStorage::loadNotifications() ++notification_it) { LLSD notification_params = *notification_it; - LLNotificationPtr notification(new LLNotification(notification_params)); + LLNotificationPtr notification = std::make_shared(notification_params); LLNotificationResponderPtr responder(createResponder(notification_params["name"], notification_params["responder"])); notification->setResponseFunctor(responder); diff --git a/indra/newview/llproductinforequest.cpp b/indra/newview/llproductinforequest.cpp index 728cb22431..d962622dfd 100644 --- a/indra/newview/llproductinforequest.cpp +++ b/indra/newview/llproductinforequest.cpp @@ -70,8 +70,8 @@ void LLProductInfoRequestManager::getLandDescriptionsCoro(std::string url) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("genericPostCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("getLandDescriptionsCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD result = httpAdapter->getAndSuspend(httpRequest, url); diff --git a/indra/newview/llremoteparcelrequest.cpp b/indra/newview/llremoteparcelrequest.cpp index d0aa1af2f3..f89afd38ab 100644 --- a/indra/newview/llremoteparcelrequest.cpp +++ b/indra/newview/llremoteparcelrequest.cpp @@ -201,8 +201,8 @@ void LLRemoteParcelInfoProcessor::regionParcelInfoCoro(std::string url, { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("RemoteParcelRequest", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("RemoteParcelRequest", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD bodyData; diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp index 9b6a87e68d..e696c2dcb5 100644 --- a/indra/newview/llsnapshotlivepreview.cpp +++ b/indra/newview/llsnapshotlivepreview.cpp @@ -1064,11 +1064,11 @@ void LLSnapshotLivePreview::saveTexture(bool outfit_snapshot, std::string name) LLFolderType::EType folder_type = outfit_snapshot ? LLFolderType::FT_NONE : LLFolderType::FT_SNAPSHOT_CATEGORY; LLInventoryType::EType inv_type = outfit_snapshot ? LLInventoryType::IT_NONE : LLInventoryType::IT_SNAPSHOT; - LLResourceUploadInfo::ptr_t assetUploadInfo(new LLResourceUploadInfo( + LLResourceUploadInfo::ptr_t assetUploadInfo = std::make_shared( tid, LLAssetType::AT_TEXTURE, res_name, res_desc, 0, folder_type, inv_type, PERM_ALL, LLFloaterPerms::getGroupPerms("Uploads"), LLFloaterPerms::getEveryonePerms("Uploads"), - expected_upload_cost, LLUUID::null, !outfit_snapshot)); + expected_upload_cost, LLUUID::null, !outfit_snapshot); upload_new_resource(assetUploadInfo); diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index dc0d834458..f079c70c6c 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -867,9 +867,9 @@ void LLIMSpeakerMgr::moderationActionCoro(std::string url, LLSD action) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("moderationActionCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions); + httpAdapter = std::make_shared("moderationActionCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setWantHeaders(true); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index a9ea741c89..59d97943e3 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2586,9 +2586,9 @@ void release_notes_coro(const std::string url) LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("releaseNotesCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions); + httpAdapter = std::make_shared("releaseNotesCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setHeadersOnly(true); // only making sure it isn't 404 or something like that diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 08adb34c3e..44bada13c2 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -715,7 +715,7 @@ void collectChildren( LLMenuGL *aMenu, ll::statusbar::SearchableItemPtr aParentM { LLMenuItemGL *pMenu = aMenu->getItem( i ); - ll::statusbar::SearchableItemPtr pItem( new ll::statusbar::SearchableItem ); + ll::statusbar::SearchableItemPtr pItem = std::make_shared(); pItem->mCtrl = pMenu; pItem->mMenu = pMenu; pItem->mLabel = utf8str_to_wstring( pMenu->ll::ui::SearchableControl::getSearchText() ); @@ -731,8 +731,8 @@ void collectChildren( LLMenuGL *aMenu, ll::statusbar::SearchableItemPtr aParentM void LLStatusBar::collectSearchableItems() { - mSearchData.reset( new ll::statusbar::SearchData ); - ll::statusbar::SearchableItemPtr pItem( new ll::statusbar::SearchableItem ); + mSearchData = std::make_unique(); + ll::statusbar::SearchableItemPtr pItem = std::make_shared(); mSearchData->mRootMenu = pItem; collectChildren( gMenuBarView, pItem ); } diff --git a/indra/newview/llsyntaxid.cpp b/indra/newview/llsyntaxid.cpp index 5114ee3672..f89ae00c5b 100644 --- a/indra/newview/llsyntaxid.cpp +++ b/indra/newview/llsyntaxid.cpp @@ -120,8 +120,8 @@ void LLSyntaxIdLSL::fetchKeywordsFileCoro(std::string url, std::string fileSpec) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("genericPostCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("fetchKeywordsFileCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); std::pair::iterator, bool> insrt = mInflightFetches.insert(fileSpec); if (!insrt.second) diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index f7cb0ee7ed..631dd1bed4 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -2462,13 +2462,13 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, bool threaded, bool qa_mod LLAppCoreHttp & app_core_http(LLAppViewer::instance()->getAppCoreHttp()); mHttpRequest = new LLCore::HttpRequest; - mHttpOptions = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions); - mHttpOptionsWithHeaders = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions); + mHttpOptions = std::make_shared(); + mHttpOptionsWithHeaders = std::make_shared(); mHttpOptionsWithHeaders->setWantHeaders(true); - mHttpHeaders = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders); + mHttpHeaders = std::make_shared(); mHttpHeaders->append(HTTP_OUT_HEADER_ACCEPT, HTTP_CONTENT_IMAGE_X_J2C); mHttpPolicyClass = app_core_http.getPolicy(LLAppCoreHttp::AP_TEXTURE); - mHttpMetricsHeaders = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders); + mHttpMetricsHeaders = std::make_shared(); mHttpMetricsHeaders->append(HTTP_OUT_HEADER_CONTENT_TYPE, HTTP_CONTENT_LLSD_XML); mHttpMetricsPolicyClass = app_core_http.getPolicy(LLAppCoreHttp::AP_REPORTING); mHttpHighWater = HTTP_NONPIPE_REQUESTS_HIGH_WATER; @@ -3572,7 +3572,7 @@ TFReqSendMetrics::TFReqSendMetrics(const std::string & caps_url, mSessionID(session_id), mAgentID(agent_id), mStatsSD(stats_sd), - mHandler(new AssetReportHandler) + mHandler(std::make_shared()) {} diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index 0f871dc1bb..b05c9fde59 100644 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -117,7 +117,7 @@ LLToast::LLToast(const LLToast::Params& p) mIsFading(false), mIsHovered(false) { - mTimer.reset(new LLToastLifeTimer(this, p.lifetime_secs)); + mTimer = std::make_unique(this, p.lifetime_secs); buildFromFile("panel_toast.xml"); diff --git a/indra/newview/lltranslate.cpp b/indra/newview/lltranslate.cpp index 72e30bd765..bc656feaba 100644 --- a/indra/newview/lltranslate.cpp +++ b/indra/newview/lltranslate.cpp @@ -155,10 +155,10 @@ void LLTranslationAPIHandler::verifyKeyCoro(LLTranslate::EService service, LLSD { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getMerchantStatusCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); - LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); + httpAdapter = std::make_shared("getMerchantStatusCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); + LLCore::HttpHeaders::ptr_t httpHeaders = std::make_shared(); std::string user_agent = stringize( @@ -210,10 +210,10 @@ void LLTranslationAPIHandler::translateMessageCoro(LanguagePair_t fromTo, std::s { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getMerchantStatusCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); - LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); + httpAdapter = std::make_shared("getMerchantStatusCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); + LLCore::HttpHeaders::ptr_t httpHeaders = std::make_shared(); std::string user_agent = stringize( diff --git a/indra/newview/llviewerassetstorage.cpp b/indra/newview/llviewerassetstorage.cpp index 255cfc998a..6b2f53c272 100644 --- a/indra/newview/llviewerassetstorage.cpp +++ b/indra/newview/llviewerassetstorage.cpp @@ -502,9 +502,9 @@ void LLViewerAssetStorage::assetRequestCoro( LLCore::HttpRequest::policy_t httpPolicy(LLAppCoreHttp::AP_TEXTURE); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("assetRequestCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions); + httpAdapter = std::make_shared("assetRequestCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); LLSD result = httpAdapter->getRawAndSuspend(httpRequest, url, httpOpts); diff --git a/indra/newview/llviewerassetupload.cpp b/indra/newview/llviewerassetupload.cpp index 5298bd1cfa..65a69acc88 100644 --- a/indra/newview/llviewerassetupload.cpp +++ b/indra/newview/llviewerassetupload.cpp @@ -864,8 +864,8 @@ LLUUID LLViewerAssetUpload::EnqueueInventoryUpload(const std::string &url, const void LLViewerAssetUpload::AssetInventoryUploadCoproc(LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t &httpAdapter, const LLUUID &id, std::string url, LLResourceUploadInfo::ptr_t uploadInfo) { - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOptions(new LLCore::HttpOptions); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOptions = std::make_shared(); httpOptions->setTimeout(LL_ASSET_UPLOAD_TIMEOUT_SEC); LLSD result = uploadInfo->prepareUpload(); diff --git a/indra/newview/llviewerdisplayname.cpp b/indra/newview/llviewerdisplayname.cpp index 243d4dec0e..c174c495ec 100644 --- a/indra/newview/llviewerdisplayname.cpp +++ b/indra/newview/llviewerdisplayname.cpp @@ -104,9 +104,9 @@ void LLViewerDisplayName::setDisplayNameCoro(const std::string& cap_url, const L { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("SetDisplayNameCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); + httpAdapter = std::make_shared("SetDisplayNameCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpHeaders::ptr_t httpHeaders = std::make_shared(); // People API can return localized error messages. Indicate our // language preference via header. diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index ec5381ddfc..6e9458597a 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -491,7 +491,7 @@ void LLViewerInventoryItem::fetchFromServer(void) const body["items"][0]["owner_id"] = mPermissions.getOwner(); body["items"][0]["item_id"] = mUUID; - LLCore::HttpHandler::ptr_t handler(new LLInventoryModel::FetchItemHttpHandler(body)); + LLCore::HttpHandler::ptr_t handler = std::make_shared(body); gInventory.requestPost(true, url, body, handler, "Inventory Item"); } } diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 89861d74bc..d5f63674e9 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1191,7 +1191,7 @@ bool LLViewerMedia::parseRawCookie(const std::string raw_cookie, std::string& na ///////////////////////////////////////////////////////////////////////////////////////// LLCore::HttpHeaders::ptr_t LLViewerMedia::getHttpHeaders() { - LLCore::HttpHeaders::ptr_t headers(new LLCore::HttpHeaders); + LLCore::HttpHeaders::ptr_t headers = std::make_shared(); headers->append(HTTP_OUT_HEADER_ACCEPT, "*/*"); headers->append(HTTP_OUT_HEADER_CONTENT_TYPE, HTTP_CONTENT_XML); @@ -1219,10 +1219,10 @@ void LLViewerMedia::getOpenIDCookieCoro(std::string url) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("getOpenIDCookieCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); - LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); + httpAdapter = std::make_shared("getOpenIDCookieCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); + LLCore::HttpHeaders::ptr_t httpHeaders = std::make_shared(); httpOpts->setFollowRedirects(true); httpOpts->setWantHeaders(true); @@ -1357,10 +1357,10 @@ void LLViewerMedia::openIDSetupCoro(std::string openidUrl, std::string openidTok { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("openIDSetupCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); - LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); + httpAdapter = std::make_shared("openIDSetupCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); + LLCore::HttpHeaders::ptr_t httpHeaders = std::make_shared(); httpOpts->setWantHeaders(true); @@ -2631,10 +2631,10 @@ void LLViewerMediaImpl::mimeDiscoveryCoro(std::string url) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("mimeDiscoveryCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); - LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); + httpAdapter = std::make_shared("mimeDiscoveryCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); + LLCore::HttpHeaders::ptr_t httpHeaders = std::make_shared(); // Increment our refcount so that we do not go away while the coroutine is active. this->ref(); diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index fcffde3caf..772abb0373 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -642,7 +642,7 @@ void do_bulk_upload(std::vector filenames, bool allow_2k, const LLU LLFileSystem fmt_file(new_asset_id, LLAssetType::AT_TEXTURE, LLFileSystem::WRITE); fmt_file.write(formatted->getData(), formatted->getDataSize()); - LLResourceUploadInfo::ptr_t assetUploadInfo(new LLResourceUploadInfo( + LLResourceUploadInfo::ptr_t assetUploadInfo = std::make_shared( tid, LLAssetType::AT_TEXTURE, asset_name, asset_name, 0, @@ -652,14 +652,14 @@ void do_bulk_upload(std::vector filenames, bool allow_2k, const LLU LLFloaterPerms::getEveryonePerms("Uploads"), LLAgentBenefitsMgr::current().getTextureUploadCost(raw_image->getWidth(), raw_image->getHeight()), dest - )); + ); upload_new_resource(assetUploadInfo); } } else { - LLNewFileResourceUploadInfo* info_p = new LLNewFileResourceUploadInfo( + LLResourceUploadInfo::ptr_t uploadInfo = std::make_shared( filename, asset_name, asset_name, 0, @@ -669,7 +669,6 @@ void do_bulk_upload(std::vector filenames, bool allow_2k, const LLU LLFloaterPerms::getEveryonePerms("Uploads"), expected_upload_cost, dest); - LLResourceUploadInfo::ptr_t uploadInfo(info_p); upload_new_resource(uploadInfo); } diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 3498c2e567..36e8e27800 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -162,8 +162,8 @@ void accept_friendship_coro(std::string url, LLSD notification) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("friendshipResponceErrorProcessing", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("friendshipResponceErrorProcessing", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); if (url.empty()) { LL_WARNS("Friendship") << "Empty capability!" << LL_ENDL; @@ -212,8 +212,8 @@ void decline_friendship_coro(std::string url, LLSD notification, S32 option) } LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("friendshipResponceErrorProcessing", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("friendshipResponceErrorProcessing", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD payload = notification["payload"]; url += "?from=" + payload["from_id"].asString(); @@ -570,8 +570,8 @@ void response_group_invitation_coro(std::string url, LLUUID group_id, bool notif LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("responseGroupInvitation", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("responseGroupInvitation", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD payload; payload["group"] = group_id; @@ -2017,7 +2017,7 @@ bool lure_callback(const LLSD& notification, const LLSD& response) if (notification_ptr) { - LLNotificationFormPtr modified_form(new LLNotificationForm(*notification_ptr->getForm())); + LLNotificationFormPtr modified_form = std::make_shared(*notification_ptr->getForm()); modified_form->setElementEnabled("Teleport", false); modified_form->setElementEnabled("Cancel", false); notification_ptr->updateForm(modified_form); diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 59bcad9a26..1675c44c5c 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -2988,8 +2988,8 @@ void LLViewerObject::fetchInventoryFromCapCoro(const LLUUID task_inv) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("TaskInventoryRequest", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("TaskInventoryRequest", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); std::string url = obj->mRegionp->getCapability("RequestTaskInventory") + "?task_id=" + obj->mID.asString(); // If we already have a copy of the inventory then add it so the server won't re-send something we already have. // We expect this case to crop up in the case of failed inventory mutations, but it might happen otherwise as well. diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index fb9e5fd0a9..1b38fed3bb 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -1055,8 +1055,8 @@ void LLViewerObjectList::fetchObjectCostsCoro(std::string url) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("genericPostCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("fetchObjectCostsCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); @@ -1179,8 +1179,8 @@ void LLViewerObjectList::fetchPhisicsFlagsCoro(std::string url) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("genericPostCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("fetchPhisicsFlagsCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD idList; U32 objectIndex = 0; diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index a085bc4d91..cd70f8f9b9 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -252,8 +252,8 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCoro(U64 regionHandle) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("BaseCapabilitiesRequest", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("BaseCapabilitiesRequest", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD result; LLViewerRegion *regionp = NULL; @@ -406,8 +406,8 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCompleteCoro(U64 regionHandle) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("BaseCapabilitiesRequest", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("BaseCapabilitiesRequest", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD result; LLViewerRegion *regionp = NULL; @@ -540,8 +540,8 @@ void LLViewerRegionImpl::requestSimulatorFeatureCoro(std::string url, U64 region { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("BaseCapabilitiesRequest", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("requestSimulatorFeatureCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLViewerRegion *regionp = NULL; S32 attemptNumber = 0; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 74b34ceee6..cb7d45564d 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1884,8 +1884,8 @@ LLViewerWindow::LLViewerWindow(const Params& p) // pass its value right now. Instead, pass it a nullary function that // will, when we later need it, return the value of gKeyboard. // boost::lambda::var() constructs such a functor on the fly. - mWindowListener.reset(new LLWindowListener(this, boost::lambda::var(gKeyboard))); - mViewerWindowListener.reset(new LLViewerWindowListener(this)); + mWindowListener = std::make_unique(this, boost::lambda::var(gKeyboard)); + mViewerWindowListener = std::make_unique(this); mSystemChannel.reset(new LLNotificationChannel("System", "Visible", LLNotificationFilters::includeEverything)); mCommunicationChannel.reset(new LLCommunicationChannel("Communication", "Visible")); diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 653c7e82eb..1e62f47082 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2211,9 +2211,9 @@ void LLVOAvatarSelf::appearanceChangeMetricsCoro(std::string url) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("appearanceChangeMetrics", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions); + httpAdapter = std::make_shared("appearanceChangeMetrics", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); S32 currentSequence = mMetricSequence; if (S32_MAX == ++mMetricSequence) diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp index fbe896ac27..b941d356a1 100644 --- a/indra/newview/llvoicechannel.cpp +++ b/indra/newview/llvoicechannel.cpp @@ -610,8 +610,8 @@ void LLVoiceChannelGroup::voiceCallCapCoro(std::string url) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("voiceCallCapCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("voiceCallCapCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD postData; postData["method"] = "call"; diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 8792ae3285..d132cbfa36 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -1164,9 +1164,9 @@ bool LLVivoxVoiceClient::provisionVoiceAccount() LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("voiceAccountProvision", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions); + httpAdapter = std::make_shared("voiceAccountProvision", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); int retryCount(0); LLSD result; @@ -1576,8 +1576,8 @@ bool LLVivoxVoiceClient::requestParcelVoiceInfo() LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("parcelVoiceInfoRequest", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("parcelVoiceInfoRequest", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD result = httpAdapter->postAndSuspend(httpRequest, url, LLSD()); @@ -4620,7 +4620,7 @@ LLVivoxVoiceClient::participantStatePtr_t LLVivoxVoiceClient::sessionState::addP if(!result) { // participant isn't already in one list or the other. - result.reset(new participantState(useAlternateURI?mSIPURI:uri)); + result = std::make_shared(useAlternateURI?mSIPURI:uri); mParticipantsByURI.insert(participantMap::value_type(result->mURI, result)); mParticipantsChanged = true; diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp index 32f2139679..3efcd763e3 100644 --- a/indra/newview/llvoicewebrtc.cpp +++ b/indra/newview/llvoicewebrtc.cpp @@ -1309,7 +1309,7 @@ LLWebRTCVoiceClient::participantStatePtr_t LLWebRTCVoiceClient::sessionState::ad if (!result) { // participant isn't already in one list or the other. - result.reset(new participantState(agent_id, region)); + result = std::make_shared(agent_id, region); mParticipantsByUUID.insert(participantUUIDMap::value_type(agent_id, result)); result->mAvatarID = agent_id; } @@ -2173,7 +2173,7 @@ bool LLWebRTCVoiceClient::estateSessionState::processConnectionStates() // Only connect if the region supports WebRTC voice server type if (isRegionWebRTCEnabled(neighbor)) { - connectionPtr_t connection(new LLVoiceWebRTCSpatialConnection(neighbor, INVALID_PARCEL_ID, mChannelID)); + connectionPtr_t connection = std::make_shared(neighbor, INVALID_PARCEL_ID, mChannelID); mWebRTCConnections.push_back(connection); connection->setMuteMic(mMuted); // mute will be set for primary connection when that connection comes up @@ -2450,11 +2450,11 @@ void LLVoiceWebRTCConnection::processIceUpdatesCoro(connectionPtr_t connection) body["viewer_session"] = connection->mViewerSession; body["voice_server_type"] = WEBRTC_VOICE_SERVER_TYPE; - LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter( - new LLCoreHttpUtil::HttpCoroutineAdapter("LLVoiceWebRTCAdHocConnection::processIceUpdatesCoro", - LLCore::HttpRequest::DEFAULT_POLICY_ID)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter = + std::make_shared("LLVoiceWebRTCAdHocConnection::processIceUpdatesCoro", + LLCore::HttpRequest::DEFAULT_POLICY_ID); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setWantHeaders(true); @@ -2664,11 +2664,11 @@ void LLVoiceWebRTCConnection::breakVoiceConnectionCoro(connectionPtr_t connectio body["viewer_session"] = connection->mViewerSession; body["voice_server_type"] = WEBRTC_VOICE_SERVER_TYPE; - LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter( - new LLCoreHttpUtil::HttpCoroutineAdapter("LLVoiceWebRTCAdHocConnection::breakVoiceConnection", - LLCore::HttpRequest::DEFAULT_POLICY_ID)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter = + std::make_shared("LLVoiceWebRTCAdHocConnection::breakVoiceConnection", + LLCore::HttpRequest::DEFAULT_POLICY_ID); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setWantHeaders(true); @@ -2733,11 +2733,11 @@ void LLVoiceWebRTCSpatialConnection::requestVoiceConnection() } body["channel_type"] = "local"; body["voice_server_type"] = WEBRTC_VOICE_SERVER_TYPE; - LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter( - new LLCoreHttpUtil::HttpCoroutineAdapter("LLVoiceWebRTCAdHocConnection::requestVoiceConnection", - LLCore::HttpRequest::DEFAULT_POLICY_ID)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter = + std::make_shared("LLVoiceWebRTCAdHocConnection::requestVoiceConnection", + LLCore::HttpRequest::DEFAULT_POLICY_ID); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setWantHeaders(true); LLSD result = httpAdapter->postAndSuspend(httpRequest, url, body, httpOpts); @@ -3343,11 +3343,11 @@ void LLVoiceWebRTCAdHocConnection::requestVoiceConnection() body["channel_type"] = "multiagent"; body["voice_server_type"] = WEBRTC_VOICE_SERVER_TYPE; - LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter( - new LLCoreHttpUtil::HttpCoroutineAdapter("LLVoiceWebRTCAdHocConnection::requestVoiceConnection", - LLCore::HttpRequest::DEFAULT_POLICY_ID)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter = + std::make_shared("LLVoiceWebRTCAdHocConnection::requestVoiceConnection", + LLCore::HttpRequest::DEFAULT_POLICY_ID); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); httpOpts->setWantHeaders(true); diff --git a/indra/newview/llwebprofile.cpp b/indra/newview/llwebprofile.cpp index 4528ad012d..132cbf4fcd 100644 --- a/indra/newview/llwebprofile.cpp +++ b/indra/newview/llwebprofile.cpp @@ -83,7 +83,7 @@ void LLWebProfile::setAuthCookie(const std::string& cookie) /*static*/ LLCore::HttpHeaders::ptr_t LLWebProfile::buildDefaultHeaders() { - LLCore::HttpHeaders::ptr_t httpHeaders(new LLCore::HttpHeaders); + LLCore::HttpHeaders::ptr_t httpHeaders = std::make_shared(); LLSD headers = LLViewerMedia::getInstance()->getHeaders(); for (LLSD::map_iterator it = headers.beginMap(); it != headers.endMap(); ++it) @@ -100,9 +100,9 @@ void LLWebProfile::uploadImageCoro(LLPointer image, std::strin { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("genericPostCoro", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); - LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + httpAdapter = std::make_shared("uploadImageCoro", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); + LLCore::HttpOptions::ptr_t httpOpts = std::make_shared(); LLCore::HttpHeaders::ptr_t httpHeaders; if (dynamic_cast(image.get()) == 0) diff --git a/indra/newview/llwindowlistener.cpp b/indra/newview/llwindowlistener.cpp index ebcdd537a5..1b2953fea6 100644 --- a/indra/newview/llwindowlistener.cpp +++ b/indra/newview/llwindowlistener.cpp @@ -465,7 +465,7 @@ static void mouseEvent(const MouseFunc& func, const LLSD& request) // to the target LLView*. But put it on the heap since "path" is // optional. Nonetheless, manage it with a boost::scoped_ptr so it // will be destroyed when we leave. - tempfunc.reset(new LLView::TemporaryDrilldownFunc(llview::TargetEvent(target))); + tempfunc = std::make_unique(llview::TargetEvent(target)); } // The question of whether the requested LLView actually handled the diff --git a/indra/newview/llwlhandlers.cpp b/indra/newview/llwlhandlers.cpp index 4e3a7a8788..aabcb2e514 100644 --- a/indra/newview/llwlhandlers.cpp +++ b/indra/newview/llwlhandlers.cpp @@ -101,8 +101,8 @@ void LLEnvironmentRequest::environmentRequestCoro(std::string url, LLEnvironment LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); S32 requestId = ++LLEnvironmentRequest::sLastRequest; LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("EnvironmentRequest", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("EnvironmentRequest", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD result = httpAdapter->getAndSuspend(httpRequest, url); @@ -193,8 +193,8 @@ void LLEnvironmentApply::environmentApplyCoro(std::string url, LLSD content, LLE { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t - httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("EnvironmentApply", httpPolicy)); - LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + httpAdapter = std::make_shared("EnvironmentApply", httpPolicy); + LLCore::HttpRequest::ptr_t httpRequest = std::make_shared(); LLSD result = httpAdapter->postAndSuspend(httpRequest, url, content); diff --git a/indra/newview/llxmlrpclistener.cpp b/indra/newview/llxmlrpclistener.cpp index 92e6c88752..758615a730 100644 --- a/indra/newview/llxmlrpclistener.cpp +++ b/indra/newview/llxmlrpclistener.cpp @@ -241,7 +241,7 @@ public: } LLSD http_params = command.get("http_params"); - mTransaction.reset(new LLXMLRPCTransaction(mUri, mMethod, request_params, http_params)); + mTransaction = std::make_unique(mUri, mMethod, request_params, http_params); mPreviousStatus = mTransaction->status(NULL); // Now ensure that we get regular callbacks to poll for completion. diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp index 7fbcb5fc04..7b0bf6f251 100644 --- a/indra/newview/llxmlrpctransaction.cpp +++ b/indra/newview/llxmlrpctransaction.cpp @@ -50,13 +50,6 @@ #include "llappviewer.h" #include "lltrans.h" -#include "boost/move/unique_ptr.hpp" - -namespace boost -{ - using ::boost::movelib::unique_ptr; // move unique_ptr into the boost namespace. -} - // Static instance of LLXMLRPCListener declared here so that every time we // bring in this code, we instantiate a listener. If we put the static // instance of LLXMLRPCListener into llxmlrpclistener.cpp, the linker would @@ -194,11 +187,11 @@ LLXMLRPCTransaction::Impl::Impl if (!mHttpRequest) { - mHttpRequest = LLCore::HttpRequest::ptr_t(new LLCore::HttpRequest); + mHttpRequest = std::make_shared(); } // LLRefCounted starts with a 1 ref, so don't add a ref in the smart pointer - httpOpts = LLCore::HttpOptions::ptr_t(new LLCore::HttpOptions()); + httpOpts = std::make_shared(); // Delay between repeats will start from 5 sec and grow to 20 sec with each repeat httpOpts->setMinBackoff((LLCore::HttpTime)5E6L); @@ -221,7 +214,7 @@ LLXMLRPCTransaction::Impl::Impl httpOpts->setSSLVerifyHost(vefifySSLCert ? 2 : 0); // LLRefCounted starts with a 1 ref, so don't add a ref in the smart pointer - httpHeaders = LLCore::HttpHeaders::ptr_t(new LLCore::HttpHeaders()); + httpHeaders = std::make_shared(); httpHeaders->append(HTTP_OUT_HEADER_CONTENT_TYPE, HTTP_CONTENT_TEXT_XML); @@ -244,7 +237,7 @@ LLXMLRPCTransaction::Impl::Impl body->append(request.c_str(), request.size()); - mHandler = LLXMLRPCTransaction::Handler::ptr_t(new Handler(mHttpRequest, this)); + mHandler = std::make_shared(mHttpRequest, this); mPostH = mHttpRequest->requestPost(LLCore::HttpRequest::DEFAULT_POLICY_ID, mURI, body.get(), httpOpts, httpHeaders, mHandler); diff --git a/indra/viewer_components/login/lllogin.cpp b/indra/viewer_components/login/lllogin.cpp index 425df0e0f9..37b70964c3 100644 --- a/indra/viewer_components/login/lllogin.cpp +++ b/indra/viewer_components/login/lllogin.cpp @@ -345,7 +345,7 @@ void LLLogin::Impl::disconnect() //********************* // LLLogin LLLogin::LLLogin() : - mImpl(new LLLogin::Impl()) + mImpl(std::make_unique()) { } -- cgit v1.3 From afb1f4d692bb593b3f200d490dd3f8fdeab8d279 Mon Sep 17 00:00:00 2001 From: Rye Date: Fri, 28 Nov 2025 13:49:27 -0500 Subject: Replace boost noncopyable and undefined function usage with modern c++ deleted operator and constructor --- indra/llcharacter/llmultigesture.h | 7 +++-- indra/llcommon/llapr.h | 10 ++++--- indra/llcommon/lldeadmantimer.h | 9 +++---- indra/llcommon/llevents.h | 1 - indra/llcommon/llmutex.h | 9 +++++-- indra/llcommon/llpounceable.h | 7 +++-- indra/llcommon/llprocess.h | 7 +++-- indra/llcommon/llprocinfo.h | 8 +++--- indra/llcommon/llqueuedthread.h | 6 ++--- indra/llcommon/llrefcount.h | 1 - indra/llcommon/llsingleton.h | 6 +++-- indra/llcorehttp/_httplibcurl.h | 8 +++--- indra/llcorehttp/_httpoperation.h | 24 +++++++---------- indra/llcorehttp/_httpoprequest.h | 4 +-- indra/llcorehttp/_httpopsetget.h | 4 +-- indra/llcorehttp/_httppolicy.h | 4 +-- indra/llcorehttp/_httppolicyclass.h | 2 +- indra/llcorehttp/_httppolicyglobal.h | 2 +- indra/llcorehttp/_httpreadyqueue.h | 4 +-- indra/llcorehttp/_httpreplyqueue.h | 7 ++--- indra/llcorehttp/_httprequestqueue.h | 4 +-- indra/llcorehttp/_httpservice.h | 4 +-- indra/llcorehttp/_refcounted.h | 5 ++-- indra/llcorehttp/_thread.h | 6 +++-- indra/llcorehttp/bufferarray.cpp | 6 ++--- indra/llcorehttp/bufferarray.h | 4 +-- indra/llcorehttp/bufferstream.h | 4 +-- indra/llcorehttp/httpcommon.h | 1 - indra/llcorehttp/httpheaders.h | 10 +++---- indra/llcorehttp/httpoptions.h | 9 +++---- indra/llcorehttp/httpresponse.h | 4 +-- indra/llinventory/llsettingsbase.h | 11 +++++--- indra/llmath/llrigginginfo.h | 7 +++-- indra/llmath/llvolumeoctree.h | 12 ++------- indra/llmessage/llcoproceduremanager.cpp | 6 ++++- indra/llrender/llatmosphere.h | 12 ++------- indra/llrender/llvertexbuffer.h | 12 ++------- indra/llui/llnotifications.h | 12 ++++++--- indra/llui/llview.h | 7 +++-- indra/newview/lldrawable.h | 13 ++------- indra/newview/llface.h | 12 ++------- indra/newview/llinventorymodel.h | 5 ++-- indra/newview/llinventorymodelbackgroundfetch.cpp | 9 +++---- indra/newview/llmeshrepository.cpp | 33 +++++++++-------------- indra/newview/llnotificationlistitem.h | 20 +++++++------- indra/newview/llspatialpartition.h | 24 +++-------------- indra/newview/lltexturefetch.cpp | 10 ++++--- indra/newview/llviewerassetstats.h | 2 +- indra/newview/llviewerassetstorage.cpp | 2 +- 49 files changed, 177 insertions(+), 219 deletions(-) (limited to 'indra/newview/llinventorymodelbackgroundfetch.cpp') diff --git a/indra/llcharacter/llmultigesture.h b/indra/llcharacter/llmultigesture.h index af0cb08650..199ed5c543 100644 --- a/indra/llcharacter/llmultigesture.h +++ b/indra/llcharacter/llmultigesture.h @@ -54,11 +54,10 @@ public: void reset(); const std::string& getTrigger() const { return mTrigger; } -protected: - LLMultiGesture(const LLMultiGesture& gest); - const LLMultiGesture& operator=(const LLMultiGesture& rhs); -public: + LLMultiGesture(const LLMultiGesture& gest) = delete; + const LLMultiGesture& operator=(const LLMultiGesture& rhs) = delete; + KEY mKey { 0 }; MASK mMask { 0 }; diff --git a/indra/llcommon/llapr.h b/indra/llcommon/llapr.h index 693cd7c01f..11e474b5dd 100644 --- a/indra/llcommon/llapr.h +++ b/indra/llcommon/llapr.h @@ -33,7 +33,6 @@ #include // Need PATH_MAX in APR headers... #endif -#include #include "llwin32headers.h" #include "apr_thread_proc.h" #include "apr_getopt.h" @@ -145,7 +144,7 @@ private: // 2, a global pool. // -class LL_COMMON_API LLAPRFile : boost::noncopyable +class LL_COMMON_API LLAPRFile { // make this non copyable since a copy closes the file private: @@ -153,9 +152,12 @@ private: LLVolatileAPRPool *mCurrentFilePoolp ; //currently in use apr_pool, could be one of them: sAPRFilePoolp, or a temp pool. public: - LLAPRFile() ; + LLAPRFile(); LLAPRFile(const std::string& filename, apr_int32_t flags, LLVolatileAPRPool* pool = NULL); - ~LLAPRFile() ; + ~LLAPRFile(); + + LLAPRFile(const LLAPRFile&) = delete; + LLAPRFile& operator=(const LLAPRFile&) = delete; apr_status_t open(const std::string& filename, apr_int32_t flags, LLVolatileAPRPool* pool = NULL, S32* sizep = NULL); apr_status_t open(const std::string& filename, apr_int32_t flags, bool use_global_pool); //use gAPRPoolp. diff --git a/indra/llcommon/lldeadmantimer.h b/indra/llcommon/lldeadmantimer.h index 3f10420d41..19d65b78b6 100644 --- a/indra/llcommon/lldeadmantimer.h +++ b/indra/llcommon/lldeadmantimer.h @@ -99,13 +99,10 @@ public: /// during updates. If false, cpu usage data isn't /// collected and will be zero if queried. LLDeadmanTimer(F64 horizon, bool inc_cpu); + ~LLDeadmanTimer() = default; - ~LLDeadmanTimer() - {} - -private: - LLDeadmanTimer(const LLDeadmanTimer &); // Not defined - void operator=(const LLDeadmanTimer &); // Not defined + LLDeadmanTimer(const LLDeadmanTimer &) = delete; + LLDeadmanTimer& operator=(const LLDeadmanTimer&) = delete; public: /// Get the current time. Zero-basis for this time diff --git a/indra/llcommon/llevents.h b/indra/llcommon/llevents.h index 4bf1fa07a2..054e57cc6c 100644 --- a/indra/llcommon/llevents.h +++ b/indra/llcommon/llevents.h @@ -41,7 +41,6 @@ #include #include -#include // noncopyable #include #include #include // reference_wrapper diff --git a/indra/llcommon/llmutex.h b/indra/llcommon/llmutex.h index 62943845a5..f3615a1270 100644 --- a/indra/llcommon/llmutex.h +++ b/indra/llcommon/llmutex.h @@ -29,7 +29,6 @@ #include "stdtypes.h" #include "llthread.h" -#include #include "mutex.h" #include @@ -249,7 +248,7 @@ private: * The constructor handles the lock, and the destructor handles * the unlock. Instances of this class are not thread safe. */ -class LL_COMMON_API LLScopedLock : private boost::noncopyable +class LL_COMMON_API LLScopedLock { public: /** @@ -265,6 +264,12 @@ public: */ ~LLScopedLock(); + /* + * @brief Non-copyable constructor and operator + */ + LLScopedLock(const LLScopedLock&) = delete; + LLScopedLock& operator=(const LLScopedLock&) = delete; + /** * @brief Check lock. */ diff --git a/indra/llcommon/llpounceable.h b/indra/llcommon/llpounceable.h index 0421ce966a..da47abd8a0 100644 --- a/indra/llcommon/llpounceable.h +++ b/indra/llcommon/llpounceable.h @@ -36,7 +36,6 @@ #define LL_LLPOUNCEABLE_H #include "llsingleton.h" -#include #include #include #include @@ -139,7 +138,7 @@ private: // LLPounceable is for an LLPounceable instance on the heap or the stack. // LLPounceable is for a static LLPounceable instance. template -class LLPounceable: public boost::noncopyable +class LLPounceable { private: typedef LLPounceableTraits traits; @@ -158,6 +157,10 @@ public: mEmpty(empty) {} + // Non-copyable + LLPounceable(const LLPounceable&) = delete; + LLPounceable& operator=(const LLPounceable&) = delete; + // make read access to mHeld as cheap and transparent as possible operator T () const { return mHeld; } typename boost::remove_pointer::type operator*() const { return *mHeld; } diff --git a/indra/llcommon/llprocess.h b/indra/llcommon/llprocess.h index d19f480c4a..0c71cfc415 100644 --- a/indra/llcommon/llprocess.h +++ b/indra/llcommon/llprocess.h @@ -32,7 +32,6 @@ #include "llexception.h" #include "apr_thread_proc.h" #include -#include #include // std::ostream #if LL_WINDOWS @@ -66,7 +65,7 @@ typedef std::shared_ptr LLProcessPtr; * indra/llcommon/tests/llprocess_test.cpp for an example of waiting for * child-process termination in a standalone test context. */ -class LL_COMMON_API LLProcess: public boost::noncopyable +class LL_COMMON_API LLProcess { LOG_CLASS(LLProcess); public: @@ -541,6 +540,10 @@ public: static std::string basename(const std::string& path); static std::string getline(std::istream&); + // Non-copyable + LLProcess(const LLProcess&) = delete; + LLProcess& operator=(const LLProcess&) = delete; + private: /// constructor is private: use create() instead LLProcess(const LLSDOrParams& params); diff --git a/indra/llcommon/llprocinfo.h b/indra/llcommon/llprocinfo.h index 5955799812..0fc8b9dbe4 100644 --- a/indra/llcommon/llprocinfo.h +++ b/indra/llcommon/llprocinfo.h @@ -51,10 +51,10 @@ public: typedef U64 time_type; /// Relative microseconds private: - LLProcInfo(); // Not defined - ~LLProcInfo(); // Not defined - LLProcInfo(const LLProcInfo &); // Not defined - void operator=(const LLProcInfo &); // Not defined + LLProcInfo() = delete; + ~LLProcInfo() = delete; + LLProcInfo(const LLProcInfo&) = delete; + LLProcInfo& operator=(const LLProcInfo&) = delete; public: /// Get accumulated system and user CPU time in diff --git a/indra/llcommon/llqueuedthread.h b/indra/llcommon/llqueuedthread.h index 02d3a96fcc..de50b8ae95 100644 --- a/indra/llcommon/llqueuedthread.h +++ b/indra/llcommon/llqueuedthread.h @@ -117,11 +117,11 @@ public: virtual ~LLQueuedThread(); virtual void shutdown(); -private: // No copy constructor or copy assignment - LLQueuedThread(const LLQueuedThread&); - LLQueuedThread& operator=(const LLQueuedThread&); + LLQueuedThread(const LLQueuedThread&) = delete; + LLQueuedThread& operator=(const LLQueuedThread&) = delete; +private: virtual bool runCondition(void); virtual void run(void); virtual void startThread(void); diff --git a/indra/llcommon/llrefcount.h b/indra/llcommon/llrefcount.h index 3a253d8fa6..93ca7d1d00 100644 --- a/indra/llcommon/llrefcount.h +++ b/indra/llcommon/llrefcount.h @@ -26,7 +26,6 @@ #ifndef LLREFCOUNT_H #define LLREFCOUNT_H -#include #include #include "llatomic.h" diff --git a/indra/llcommon/llsingleton.h b/indra/llcommon/llsingleton.h index b5659e053c..3fba8602ee 100644 --- a/indra/llcommon/llsingleton.h +++ b/indra/llcommon/llsingleton.h @@ -25,7 +25,6 @@ #ifndef LLSINGLETON_H #define LLSINGLETON_H -#include #include #include #include @@ -43,11 +42,14 @@ #pragma warning(disable : 4506) // no definition for inline function #endif -class LLSingletonBase: private boost::noncopyable +class LLSingletonBase { public: class MasterList; + LLSingletonBase(const LLSingletonBase&) = delete; + LLSingletonBase& operator=(const LLSingletonBase&) = delete; + private: // All existing LLSingleton instances are tracked in this master list. typedef std::list list_t; diff --git a/indra/llcorehttp/_httplibcurl.h b/indra/llcorehttp/_httplibcurl.h index 3631965837..58affcb796 100644 --- a/indra/llcorehttp/_httplibcurl.h +++ b/indra/llcorehttp/_httplibcurl.h @@ -61,8 +61,8 @@ public: virtual ~HttpLibcurl(); private: - HttpLibcurl(const HttpLibcurl &); // Not defined - void operator=(const HttpLibcurl &); // Not defined + HttpLibcurl(const HttpLibcurl&) = delete; + void operator=(const HttpLibcurl&) = delete; public: typedef std::shared_ptr opReqPtr_t; @@ -179,8 +179,8 @@ protected: ~HandleCache(); private: - HandleCache(const HandleCache &); // Not defined - void operator=(const HandleCache &); // Not defined + HandleCache(const HandleCache&) = delete; + void operator=(const HandleCache&) = delete; public: /// Allocate a curl handle for caller. May be freed using diff --git a/indra/llcorehttp/_httpoperation.h b/indra/llcorehttp/_httpoperation.h index ff7efe60e9..8412043aa5 100644 --- a/indra/llcorehttp/_httpoperation.h +++ b/indra/llcorehttp/_httpoperation.h @@ -68,8 +68,7 @@ class HttpService; /// via queue-like interfaces that are thread compatible /// and those interfaces establish the access rules. -class HttpOperation : private boost::noncopyable, - public std::enable_shared_from_this +class HttpOperation : public std::enable_shared_from_this { public: typedef std::shared_ptr ptr_t; @@ -82,6 +81,9 @@ public: /// Threading: called by any thread. virtual ~HttpOperation(); // Use release() + // Non-copyable + HttpOperation(const HttpOperation&) = delete; + HttpOperation& operator=(const HttpOperation&) = delete; public: /// Register a reply queue and a handler for completion notifications. @@ -220,12 +222,10 @@ class HttpOpStop : public HttpOperation { public: HttpOpStop(); - virtual ~HttpOpStop(); -private: - HttpOpStop(const HttpOpStop &); // Not defined - void operator=(const HttpOpStop &); // Not defined + HttpOpStop(const HttpOpStop &) = delete; + HttpOpStop& operator=(const HttpOpStop&) = delete; public: virtual void stageFromRequest(HttpService *); @@ -242,12 +242,10 @@ class HttpOpNull : public HttpOperation { public: HttpOpNull(); - virtual ~HttpOpNull(); -private: - HttpOpNull(const HttpOpNull &); // Not defined - void operator=(const HttpOpNull &); // Not defined + HttpOpNull(const HttpOpNull&) = delete; + HttpOpNull& operator=(const HttpOpNull&) = delete; public: virtual void stageFromRequest(HttpService *); @@ -264,12 +262,10 @@ public: // 0 does a hard spin in the operation // 1 does a soft spin continuously requeuing itself HttpOpSpin(int mode); - virtual ~HttpOpSpin(); -private: - HttpOpSpin(const HttpOpSpin &); // Not defined - void operator=(const HttpOpSpin &); // Not defined + HttpOpSpin(const HttpOpSpin&) = delete; + HttpOpSpin& operator=(const HttpOpSpin&) = delete; public: virtual void stageFromRequest(HttpService *); diff --git a/indra/llcorehttp/_httpoprequest.h b/indra/llcorehttp/_httpoprequest.h index b029bc740c..717535555c 100644 --- a/indra/llcorehttp/_httpoprequest.h +++ b/indra/llcorehttp/_httpoprequest.h @@ -73,8 +73,8 @@ public: virtual ~HttpOpRequest(); // Use release() private: - HttpOpRequest(const HttpOpRequest &); // Not defined - void operator=(const HttpOpRequest &); // Not defined + HttpOpRequest(const HttpOpRequest&) = delete; + void operator=(const HttpOpRequest&) = delete; public: enum EMethod diff --git a/indra/llcorehttp/_httpopsetget.h b/indra/llcorehttp/_httpopsetget.h index 0b927a6b71..ff8204547b 100644 --- a/indra/llcorehttp/_httpopsetget.h +++ b/indra/llcorehttp/_httpopsetget.h @@ -60,8 +60,8 @@ public: virtual ~HttpOpSetGet(); // Use release() private: - HttpOpSetGet(const HttpOpSetGet &); // Not defined - void operator=(const HttpOpSetGet &); // Not defined + HttpOpSetGet(const HttpOpSetGet&) = delete; + void operator=(const HttpOpSetGet&) = delete; public: /// Threading: called by application thread diff --git a/indra/llcorehttp/_httppolicy.h b/indra/llcorehttp/_httppolicy.h index a074949f20..82f552176e 100644 --- a/indra/llcorehttp/_httppolicy.h +++ b/indra/llcorehttp/_httppolicy.h @@ -56,8 +56,8 @@ public: virtual ~HttpPolicy(); private: - HttpPolicy(const HttpPolicy &); // Not defined - void operator=(const HttpPolicy &); // Not defined + HttpPolicy(const HttpPolicy&) = delete; + void operator=(const HttpPolicy&) = delete; public: typedef std::shared_ptr opReqPtr_t; diff --git a/indra/llcorehttp/_httppolicyclass.h b/indra/llcorehttp/_httppolicyclass.h index 32bcad4f9c..5bf0fa1fa7 100644 --- a/indra/llcorehttp/_httppolicyclass.h +++ b/indra/llcorehttp/_httppolicyclass.h @@ -53,7 +53,7 @@ public: ~HttpPolicyClass(); HttpPolicyClass & operator=(const HttpPolicyClass &); - HttpPolicyClass(const HttpPolicyClass &); // Not defined + HttpPolicyClass(const HttpPolicyClass &); public: HttpStatus set(HttpRequest::EPolicyOption opt, long value); diff --git a/indra/llcorehttp/_httppolicyglobal.h b/indra/llcorehttp/_httppolicyglobal.h index d9114d167f..3840d66b22 100644 --- a/indra/llcorehttp/_httppolicyglobal.h +++ b/indra/llcorehttp/_httppolicyglobal.h @@ -55,7 +55,7 @@ public: HttpPolicyGlobal & operator=(const HttpPolicyGlobal &); private: - HttpPolicyGlobal(const HttpPolicyGlobal &); // Not defined + HttpPolicyGlobal(const HttpPolicyGlobal &) = delete; public: HttpStatus set(HttpRequest::EPolicyOption opt, long value); diff --git a/indra/llcorehttp/_httpreadyqueue.h b/indra/llcorehttp/_httpreadyqueue.h index 0bc0723511..04fcf25356 100644 --- a/indra/llcorehttp/_httpreadyqueue.h +++ b/indra/llcorehttp/_httpreadyqueue.h @@ -77,8 +77,8 @@ public: {} protected: - HttpReadyQueue(const HttpReadyQueue &); // Not defined - void operator=(const HttpReadyQueue &); // Not defined + HttpReadyQueue(const HttpReadyQueue&) = delete; + void operator=(const HttpReadyQueue&) = delete; public: diff --git a/indra/llcorehttp/_httpreplyqueue.h b/indra/llcorehttp/_httpreplyqueue.h index d8847fafb5..e1b5648691 100644 --- a/indra/llcorehttp/_httpreplyqueue.h +++ b/indra/llcorehttp/_httpreplyqueue.h @@ -30,8 +30,6 @@ #include "_refcounted.h" #include "_mutex.h" -#include "boost/noncopyable.hpp" - namespace LLCore { @@ -59,7 +57,7 @@ class HttpOperation; /// will be coded anyway so it shouldn't be too much of a /// burden. -class HttpReplyQueue : private boost::noncopyable +class HttpReplyQueue { public: @@ -69,6 +67,9 @@ public: HttpReplyQueue(); virtual ~HttpReplyQueue(); + HttpReplyQueue(const HttpReplyQueue&) = delete; + HttpReplyQueue& operator=(const HttpReplyQueue&) = delete; + public: typedef std::vector< opPtr_t > OpContainer; diff --git a/indra/llcorehttp/_httprequestqueue.h b/indra/llcorehttp/_httprequestqueue.h index 0823126f78..82537c9053 100644 --- a/indra/llcorehttp/_httprequestqueue.h +++ b/indra/llcorehttp/_httprequestqueue.h @@ -57,8 +57,8 @@ protected: virtual ~HttpRequestQueue(); // Use release() private: - HttpRequestQueue(const HttpRequestQueue &); // Not defined - void operator=(const HttpRequestQueue &); // Not defined + HttpRequestQueue(const HttpRequestQueue&) = delete; + void operator=(const HttpRequestQueue&) = delete; public: typedef std::shared_ptr opPtr_t; diff --git a/indra/llcorehttp/_httpservice.h b/indra/llcorehttp/_httpservice.h index 13eb034f0e..7202b496fc 100644 --- a/indra/llcorehttp/_httpservice.h +++ b/indra/llcorehttp/_httpservice.h @@ -86,8 +86,8 @@ protected: virtual ~HttpService(); private: - HttpService(const HttpService &); // Not defined - void operator=(const HttpService &); // Not defined + HttpService(const HttpService&) = delete; + void operator=(const HttpService&) = delete; public: enum EState diff --git a/indra/llcorehttp/_refcounted.h b/indra/llcorehttp/_refcounted.h index 7470965a7f..de2e3fe85c 100644 --- a/indra/llcorehttp/_refcounted.h +++ b/indra/llcorehttp/_refcounted.h @@ -44,8 +44,9 @@ namespace LLCoreInt class RefCounted { private: - RefCounted(); // Not defined - may not be default constructed - void operator=(const RefCounted &); // Not defined + RefCounted() = delete; // may not be default constructed + RefCounted(const RefCounted&) = delete; + RefCounted& operator=(const RefCounted&) = delete; public: explicit RefCounted(bool const implicit) diff --git a/indra/llcorehttp/_thread.h b/indra/llcorehttp/_thread.h index 6c0e39cf92..93efbbedbc 100644 --- a/indra/llcorehttp/_thread.h +++ b/indra/llcorehttp/_thread.h @@ -42,8 +42,10 @@ namespace LLCoreInt class HttpThread : public RefCounted { private: - HttpThread(); // Not defined - void operator=(const HttpThread &); // Not defined + // May not be default constructed or copied + HttpThread() = delete; + HttpThread(const HttpThread&) = delete; + void operator=(const HttpThread &) = delete; void at_exit() { diff --git a/indra/llcorehttp/bufferarray.cpp b/indra/llcorehttp/bufferarray.cpp index 6b33661d8f..46c03f991d 100644 --- a/indra/llcorehttp/bufferarray.cpp +++ b/indra/llcorehttp/bufferarray.cpp @@ -57,12 +57,12 @@ public: void operator delete(void *); void operator delete(void *, size_t len); + Block(const Block&) = delete; + Block& operator=(const Block&) = delete; + protected: Block(size_t len); - Block(const Block &); // Not defined - void operator=(const Block &); // Not defined - // Allocate the block with the additional space for the // buffered data at the end of the object. void * operator new(size_t len, size_t addl_len); diff --git a/indra/llcorehttp/bufferarray.h b/indra/llcorehttp/bufferarray.h index 5105dbc4f7..9abe1778ed 100644 --- a/indra/llcorehttp/bufferarray.h +++ b/indra/llcorehttp/bufferarray.h @@ -79,8 +79,8 @@ protected: virtual ~BufferArray(); // Use release() private: - BufferArray(const BufferArray &); // Not defined - void operator=(const BufferArray &); // Not defined + BufferArray(const BufferArray&) = delete; + void operator=(const BufferArray&) = delete; public: // Internal magic number, may be used by unit tests. diff --git a/indra/llcorehttp/bufferstream.h b/indra/llcorehttp/bufferstream.h index 93891810aa..ba84821df3 100644 --- a/indra/llcorehttp/bufferstream.h +++ b/indra/llcorehttp/bufferstream.h @@ -91,8 +91,8 @@ public: virtual ~BufferArrayStreamBuf(); private: - BufferArrayStreamBuf(const BufferArrayStreamBuf &); // Not defined - void operator=(const BufferArrayStreamBuf &); // Not defined + BufferArrayStreamBuf(const BufferArrayStreamBuf&) = delete; + void operator=(const BufferArrayStreamBuf&) = delete; public: // Input interfaces from std::streambuf diff --git a/indra/llcorehttp/httpcommon.h b/indra/llcorehttp/httpcommon.h index ec0e538cf7..1c003a0966 100644 --- a/indra/llcorehttp/httpcommon.h +++ b/indra/llcorehttp/httpcommon.h @@ -191,7 +191,6 @@ #include "llsd.h" #include #include -#include "boost/noncopyable.hpp" namespace LLCore { diff --git a/indra/llcorehttp/httpheaders.h b/indra/llcorehttp/httpheaders.h index a5ca7749b0..6a03cf4083 100644 --- a/indra/llcorehttp/httpheaders.h +++ b/indra/llcorehttp/httpheaders.h @@ -74,7 +74,7 @@ namespace LLCore /// constructor is given a refcount. /// -class HttpHeaders: private boost::noncopyable +class HttpHeaders { public: typedef std::pair header_t; @@ -94,11 +94,11 @@ public: HttpHeaders(); virtual ~HttpHeaders(); // Use release() - //typedef LLCoreInt::IntrusivePtr ptr_t; -protected: + // Non-copyable + HttpHeaders(const HttpHeaders&) = delete; + HttpHeaders& operator=(const HttpHeaders&) = delete; - HttpHeaders(const HttpHeaders &); // Not defined - void operator=(const HttpHeaders &); // Not defined + //typedef LLCoreInt::IntrusivePtr ptr_t; public: // Empty the list of headers. diff --git a/indra/llcorehttp/httpoptions.h b/indra/llcorehttp/httpoptions.h index fdb277c66e..d50c5470ae 100644 --- a/indra/llcorehttp/httpoptions.h +++ b/indra/llcorehttp/httpoptions.h @@ -55,7 +55,7 @@ namespace LLCore /// Allocation: Refcounted, heap only. Caller of the constructor /// is given a refcount. /// -class HttpOptions : private boost::noncopyable +class HttpOptions { public: HttpOptions(); @@ -64,10 +64,9 @@ public: virtual ~HttpOptions(); // Use release() -protected: - - HttpOptions(const HttpOptions &); // Not defined - void operator=(const HttpOptions &); // Not defined + // Non-copyable + HttpOptions(const HttpOptions&) = delete; + HttpOptions& operator=(const HttpOptions&) = delete; public: diff --git a/indra/llcorehttp/httpresponse.h b/indra/llcorehttp/httpresponse.h index 99c8f1d2f9..ed2d76c10f 100644 --- a/indra/llcorehttp/httpresponse.h +++ b/indra/llcorehttp/httpresponse.h @@ -65,8 +65,8 @@ public: protected: virtual ~HttpResponse(); // Use release() - HttpResponse(const HttpResponse &); // Not defined - void operator=(const HttpResponse &); // Not defined + HttpResponse(const HttpResponse&) = delete; + void operator=(const HttpResponse&) = delete; public: /// Statistics for the HTTP diff --git a/indra/llinventory/llsettingsbase.h b/indra/llinventory/llsettingsbase.h index bea6fdec97..e8160b1503 100644 --- a/indra/llinventory/llsettingsbase.h +++ b/indra/llinventory/llsettingsbase.h @@ -49,8 +49,7 @@ #define SETTINGS_OVERRIDE override class LLSettingsBase : - public PTR_NAMESPACE::enable_shared_from_this, - private boost::noncopyable + public PTR_NAMESPACE::enable_shared_from_this { friend class LLEnvironment; friend class LLSettingsDay; @@ -96,7 +95,11 @@ public: typedef PTR_NAMESPACE::shared_ptr ptr_t; - virtual ~LLSettingsBase() { }; + virtual ~LLSettingsBase() = default; + + // Non-copyable + LLSettingsBase(const LLSettingsBase&) = delete; + LLSettingsBase& operator=(const LLSettingsBase&) = delete; //--------------------------------------------------------------------- virtual std::string getSettingsType() const = 0; @@ -430,7 +433,7 @@ public: mFinal = mInitial; } - virtual ~LLSettingsBlender() {} + virtual ~LLSettingsBlender() = default; virtual void reset( LLSettingsBase::ptr_t &initsetting, const LLSettingsBase::ptr_t &endsetting, const LLSettingsBase::TrackPosition&) { diff --git a/indra/llmath/llrigginginfo.h b/indra/llmath/llrigginginfo.h index d761af68b1..e5a41d2ecf 100644 --- a/indra/llmath/llrigginginfo.h +++ b/indra/llmath/llrigginginfo.h @@ -70,11 +70,10 @@ public: LLJointRiggingInfo* begin() { return mRigInfoPtr; } LLJointRiggingInfo* end() { return mRigInfoPtr + mSize; } -private: - // Not implemented - LLJointRiggingInfoTab& operator=(const LLJointRiggingInfoTab& src); - LLJointRiggingInfoTab(const LLJointRiggingInfoTab& src); + LLJointRiggingInfoTab& operator=(const LLJointRiggingInfoTab& src) = delete; + LLJointRiggingInfoTab(const LLJointRiggingInfoTab& src) = delete; +private: LLJointRiggingInfo *mRigInfoPtr; S32 mSize; bool mNeedsUpdate; diff --git a/indra/llmath/llvolumeoctree.h b/indra/llmath/llvolumeoctree.h index 1d74644715..b6b7e22517 100644 --- a/indra/llmath/llvolumeoctree.h +++ b/indra/llmath/llvolumeoctree.h @@ -78,16 +78,8 @@ public: LLVolumeOctreeListener(LLOctreeNode* node); ~LLVolumeOctreeListener(); - LLVolumeOctreeListener(const LLVolumeOctreeListener& rhs) - { - *this = rhs; - } - - const LLVolumeOctreeListener& operator=(const LLVolumeOctreeListener& rhs) - { - LL_ERRS() << "Illegal operation!" << LL_ENDL; - return *this; - } + LLVolumeOctreeListener(const LLVolumeOctreeListener& rhs) = delete; + const LLVolumeOctreeListener& operator=(const LLVolumeOctreeListener& rhs) = delete; //LISTENER FUNCTIONS virtual void handleChildAddition(const LLOctreeNode* parent, LLOctreeNode* child); diff --git a/indra/llmessage/llcoproceduremanager.cpp b/indra/llmessage/llcoproceduremanager.cpp index cd04d6f160..99b40e0877 100644 --- a/indra/llmessage/llcoproceduremanager.cpp +++ b/indra/llmessage/llcoproceduremanager.cpp @@ -53,7 +53,7 @@ static const U32 DEFAULT_POOL_SIZE = 5; const U32 LLCoprocedureManager::DEFAULT_QUEUE_SIZE = 1024*512; //========================================================================= -class LLCoprocedurePool: private boost::noncopyable +class LLCoprocedurePool { public: typedef LLCoprocedureManager::CoProcedure_t CoProcedure_t; @@ -61,6 +61,10 @@ public: LLCoprocedurePool(const std::string &name, size_t size, size_t queue_size); ~LLCoprocedurePool(); + // Non-copyable + LLCoprocedurePool(const LLCoprocedurePool&) = delete; + LLCoprocedurePool& operator=(const LLCoprocedurePool&) = delete; + /// Places the coprocedure on the queue for processing. /// /// @param name Is used for debugging and should identify this coroutine. diff --git a/indra/llrender/llatmosphere.h b/indra/llrender/llatmosphere.h index 4b8c7d0819..951227b41e 100644 --- a/indra/llrender/llatmosphere.h +++ b/indra/llrender/llatmosphere.h @@ -133,11 +133,8 @@ public: static void initClass(); static void cleanupClass(); - const LLAtmosphere& operator=(const LLAtmosphere& rhs) - { - LL_ERRS() << "Illegal operation!" << LL_ENDL; - return *this; - } + LLAtmosphere(const LLAtmosphere& rhs) = delete; + const LLAtmosphere& operator=(const LLAtmosphere& rhs) = delete; LLGLTexture* getTransmittance(); LLGLTexture* getScattering(); @@ -147,11 +144,6 @@ public: bool configureAtmosphericModel(AtmosphericModelSettings& settings); protected: - LLAtmosphere(const LLAtmosphere& rhs) - { - *this = rhs; - } - LLPointer m_transmittance; LLPointer m_scattering; LLPointer m_mie_scatter_texture; diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h index faaa6ba0f0..f24d75e41d 100644 --- a/indra/llrender/llvertexbuffer.h +++ b/indra/llrender/llvertexbuffer.h @@ -98,16 +98,8 @@ public: U32 mEnd; }; - LLVertexBuffer(const LLVertexBuffer& rhs) - { - *this = rhs; - } - - const LLVertexBuffer& operator=(const LLVertexBuffer& rhs) - { - LL_ERRS() << "Illegal operation!" << LL_ENDL; - return *this; - } + LLVertexBuffer(const LLVertexBuffer& rhs) = delete; + const LLVertexBuffer& operator=(const LLVertexBuffer& rhs) = delete; static void initClass(LLWindow* window); static void cleanupClass(); diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 3c8e1e85fa..637f0bd88d 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -303,7 +303,6 @@ typedef std::shared_ptr LLNotificationVisibilityRu * shared pointer. */ class LLNotification : - boost::noncopyable, public std::enable_shared_from_this { LOG_CLASS(LLNotification); @@ -429,6 +428,10 @@ private: public: LLNotification(const LLSDParamAdapter& p); + // Non-copyable + LLNotification(const LLNotification&) = delete; + LLNotification& operator=(const LLNotification&) = delete; + void setResponseFunctor(std::string const &responseFunctorName); void setResponseFunctor(const LLNotificationFunctorRegistry::ResponseFunctor& cb); @@ -817,10 +820,9 @@ typedef boost::intrusive_ptr LLNotificationChannelPtr; // manages a list of notifications // Note that if this is ever copied around, we might find ourselves with multiple copies // of a queue with notifications being added to different nonequivalent copies. So we -// make it inherit from boost::noncopyable, and then create a map of LLPointer to manage it. +// delete the copy operator and constructor, and then create a map of LLPointer to manage it. // class LLNotificationChannel : - boost::noncopyable, public LLNotificationChannelBase, public LLInstanceTracker { @@ -843,6 +845,10 @@ public: virtual ~LLNotificationChannel(); typedef LLNotificationSet::iterator Iterator; + // Non-copyable + LLNotificationChannel(const LLNotificationChannel&) = delete; + LLNotificationChannel& operator=(const LLNotificationChannel&) = delete; + std::string getName() const { return mName; } typedef std::vector::const_iterator parents_iter; boost::iterator_range getParents() const diff --git a/indra/llui/llview.h b/indra/llui/llview.h index 97212a9d2d..5695776ae6 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -50,7 +50,6 @@ #include #include -#include class LLSD; @@ -637,7 +636,7 @@ public: // LLView::TemporaryDrilldownFunc scoped_func(myfunctor); // // ... test with myfunctor ... // } // exiting block restores original LLView::sDrilldown - class TemporaryDrilldownFunc: public boost::noncopyable + class TemporaryDrilldownFunc { public: TemporaryDrilldownFunc(const DrilldownFunc& func): @@ -651,6 +650,10 @@ public: sDrilldown = mOldDrilldown; } + // Non-copyable + TemporaryDrilldownFunc(const TemporaryDrilldownFunc&) = delete; + TemporaryDrilldownFunc& operator=(const TemporaryDrilldownFunc&) = delete; + private: DrilldownFunc mOldDrilldown; }; diff --git a/indra/newview/lldrawable.h b/indra/newview/lldrawable.h index a7ac9da618..6f6faf9909 100644 --- a/indra/newview/lldrawable.h +++ b/indra/newview/lldrawable.h @@ -67,17 +67,8 @@ class LLDrawable public: typedef std::vector face_list_t; - LLDrawable(const LLDrawable& rhs) - : LLViewerOctreeEntryData(rhs) - { - *this = rhs; - } - - const LLDrawable& operator=(const LLDrawable& rhs) - { - LL_ERRS() << "Illegal operation!" << LL_ENDL; - return *this; - } + LLDrawable(const LLDrawable& rhs) = delete; + const LLDrawable& operator=(const LLDrawable& rhs) = delete; static void initClass(); diff --git a/indra/newview/llface.h b/indra/newview/llface.h index db18f6643e..df31e9ea90 100644 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -58,16 +58,8 @@ class alignas(16) LLFace { LL_ALIGN_NEW public: - LLFace(const LLFace& rhs) - { - *this = rhs; - } - - const LLFace& operator=(const LLFace& rhs) - { - LL_ERRS() << "Illegal operation!" << LL_ENDL; - return *this; - } + LLFace(const LLFace& rhs) = delete; + const LLFace& operator=(const LLFace& rhs) = delete; enum EMasks { diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index d28743357e..31345f3ab3 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -122,9 +122,8 @@ public: FetchItemHttpHandler(const LLSD & request_sd); virtual ~FetchItemHttpHandler(); - protected: - FetchItemHttpHandler(const FetchItemHttpHandler &); // Not defined - void operator=(const FetchItemHttpHandler &); // Not defined + FetchItemHttpHandler(const FetchItemHttpHandler&) = delete; + FetchItemHttpHandler& operator=(const FetchItemHttpHandler&) = delete; public: virtual void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response); diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp index fa02b0f5ab..1e5f771ba7 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.cpp +++ b/indra/newview/llinventorymodelbackgroundfetch.cpp @@ -125,9 +125,8 @@ public: LLInventoryModelBackgroundFetch::instance().incrFetchCount(-1); } -protected: - BGItemHttpHandler(const BGItemHttpHandler&); // Not defined - void operator=(const BGItemHttpHandler&); // Not defined + BGItemHttpHandler(const BGItemHttpHandler&) = delete; + BGItemHttpHandler& operator=(const BGItemHttpHandler&) = delete; }; @@ -159,8 +158,8 @@ public: } protected: - BGFolderHttpHandler(const BGFolderHttpHandler&); // Not defined - void operator=(const BGFolderHttpHandler&); // Not defined + BGFolderHttpHandler(const BGFolderHttpHandler&) = delete; + BGFolderHttpHandler& operator=(const BGFolderHttpHandler&) = delete; public: virtual void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse* response); diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index c2ef8e5abc..c0b1a5326a 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -654,12 +654,10 @@ public: mRequestedBytes(requested_bytes) {} - virtual ~LLMeshHandlerBase() - {} + virtual ~LLMeshHandlerBase() = default; -protected: - LLMeshHandlerBase(const LLMeshHandlerBase &); // Not defined - void operator=(const LLMeshHandlerBase &); // Not defined + LLMeshHandlerBase(const LLMeshHandlerBase &) = delete; + LLMeshHandlerBase& operator=(const LLMeshHandlerBase&) = delete; public: virtual void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response); @@ -693,9 +691,8 @@ public: } virtual ~LLMeshHeaderHandler(); -protected: - LLMeshHeaderHandler(const LLMeshHeaderHandler &); // Not defined - void operator=(const LLMeshHeaderHandler &); // Not defined + LLMeshHeaderHandler(const LLMeshHeaderHandler&) = delete; + LLMeshHeaderHandler& operator=(const LLMeshHeaderHandler&) = delete; public: virtual void processData(LLCore::BufferArray * body, S32 body_offset, U8 * data, S32 data_size); @@ -719,9 +716,8 @@ public: } virtual ~LLMeshLODHandler(); -protected: - LLMeshLODHandler(const LLMeshLODHandler &); // Not defined - void operator=(const LLMeshLODHandler &); // Not defined + LLMeshLODHandler(const LLMeshLODHandler&) = delete; + LLMeshLODHandler& operator=(const LLMeshLODHandler&) = delete; public: virtual void processData(LLCore::BufferArray * body, S32 body_offset, U8 * data, S32 data_size); @@ -750,9 +746,8 @@ public: } virtual ~LLMeshSkinInfoHandler(); -protected: - LLMeshSkinInfoHandler(const LLMeshSkinInfoHandler &); // Not defined - void operator=(const LLMeshSkinInfoHandler &); // Not defined + LLMeshSkinInfoHandler(const LLMeshSkinInfoHandler&) = delete; + LLMeshSkinInfoHandler& operator=(const LLMeshSkinInfoHandler&) = delete; void processSkin(U8* data, S32 data_size); @@ -778,9 +773,8 @@ public: {} virtual ~LLMeshDecompositionHandler(); -protected: - LLMeshDecompositionHandler(const LLMeshDecompositionHandler &); // Not defined - void operator=(const LLMeshDecompositionHandler &); // Not defined + LLMeshDecompositionHandler(const LLMeshDecompositionHandler&) = delete; + LLMeshDecompositionHandler& operator=(const LLMeshDecompositionHandler&) = delete; public: virtual void processData(LLCore::BufferArray * body, S32 body_offset, U8 * data, S32 data_size); @@ -804,9 +798,8 @@ public: {} virtual ~LLMeshPhysicsShapeHandler(); -protected: - LLMeshPhysicsShapeHandler(const LLMeshPhysicsShapeHandler &); // Not defined - void operator=(const LLMeshPhysicsShapeHandler &); // Not defined + LLMeshPhysicsShapeHandler(const LLMeshPhysicsShapeHandler&) = delete; + LLMeshPhysicsShapeHandler& operator=(const LLMeshPhysicsShapeHandler&) = delete; public: virtual void processData(LLCore::BufferArray * body, S32 body_offset, U8 * data, S32 data_size); diff --git a/indra/newview/llnotificationlistitem.h b/indra/newview/llnotificationlistitem.h index 2ed90e31b2..bddbe0ff16 100644 --- a/indra/newview/llnotificationlistitem.h +++ b/indra/newview/llnotificationlistitem.h @@ -156,8 +156,8 @@ protected: LLTextBox* mGroupNameBoxExp; private: - LLGroupNotificationListItem(const LLGroupNotificationListItem &); - LLGroupNotificationListItem & operator=(LLGroupNotificationListItem &); + LLGroupNotificationListItem(const LLGroupNotificationListItem&) = delete; + LLGroupNotificationListItem& operator=(LLGroupNotificationListItem&) = delete; void setGroupName(std::string name); bool updateFromCache(); @@ -175,8 +175,8 @@ public: private: friend class LLNotificationListItem; LLGroupInviteNotificationListItem(const Params& p); - LLGroupInviteNotificationListItem(const LLGroupInviteNotificationListItem &); - LLGroupInviteNotificationListItem & operator=(LLGroupInviteNotificationListItem &); + LLGroupInviteNotificationListItem(const LLGroupInviteNotificationListItem&) = delete; + LLGroupInviteNotificationListItem& operator=(LLGroupInviteNotificationListItem&) = delete; void setFee(S32 fee); @@ -202,8 +202,8 @@ public: private: friend class LLNotificationListItem; LLGroupNoticeNotificationListItem(const Params& p); - LLGroupNoticeNotificationListItem(const LLGroupNoticeNotificationListItem &); - LLGroupNoticeNotificationListItem & operator=(LLGroupNoticeNotificationListItem &); + LLGroupNoticeNotificationListItem(const LLGroupNoticeNotificationListItem&) = delete; + LLGroupNoticeNotificationListItem& operator=(LLGroupNoticeNotificationListItem&) = delete; void setSender(std::string sender); void onClickAttachment(); @@ -226,8 +226,8 @@ public: private: friend class LLNotificationListItem; LLTransactionNotificationListItem(const Params& p); - LLTransactionNotificationListItem(const LLTransactionNotificationListItem &); - LLTransactionNotificationListItem & operator=(LLTransactionNotificationListItem &); + LLTransactionNotificationListItem(const LLTransactionNotificationListItem&) = delete; + LLTransactionNotificationListItem& operator=(LLTransactionNotificationListItem&) = delete; LLAvatarIconCtrl* mAvatarIcon; LLAvatarIconCtrl* mAvatarIconExp; }; @@ -239,8 +239,8 @@ public: private: friend class LLNotificationListItem; LLSystemNotificationListItem(const Params& p); - LLSystemNotificationListItem(const LLSystemNotificationListItem &); - LLSystemNotificationListItem & operator=(LLSystemNotificationListItem &); + LLSystemNotificationListItem(const LLSystemNotificationListItem&) = delete; + LLSystemNotificationListItem & operator=(LLSystemNotificationListItem &) = delete; LLIconCtrl* mSystemNotificationIcon; LLIconCtrl* mSystemNotificationIconExp; bool mIsCaution; diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index 3aaa3d60e8..d8a94c8835 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -71,16 +71,8 @@ protected: ~LLDrawInfo(); public: - LLDrawInfo(const LLDrawInfo& rhs) - { - *this = rhs; - } - - const LLDrawInfo& operator=(const LLDrawInfo& rhs) - { - LL_ERRS() << "Illegal operation!" << LL_ENDL; - return *this; - } + LLDrawInfo(const LLDrawInfo& rhs) = delete; + const LLDrawInfo& operator=(const LLDrawInfo& rhs) = delete; // return a hash of this LLDrawInfo as a debug color LLColor4U getDebugColor() const; @@ -206,16 +198,8 @@ class LLSpatialGroup : public LLOcclusionCullingGroup friend class LLOctreeStateCheck; public: - LLSpatialGroup(const LLSpatialGroup& rhs) : LLOcclusionCullingGroup(rhs) - { - *this = rhs; - } - - const LLSpatialGroup& operator=(const LLSpatialGroup& rhs) - { - LL_ERRS() << "Illegal operation!" << LL_ENDL; - return *this; - } + LLSpatialGroup(const LLSpatialGroup& rhs) = delete; + const LLSpatialGroup& operator=(const LLSpatialGroup& rhs) = delete; static U32 sNodeCount; static bool sNoDelete; //deletion of spatial groups and draw info not allowed if true diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 631dd1bed4..51ade60827 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -743,10 +743,10 @@ public: : LLTextureFetch::TFRequest(), mRegionHandle(region_handle) {} - TFReqSetRegion & operator=(const TFReqSetRegion &); // Not defined + TFReqSetRegion(const TFReqSetRegion&) = delete; + TFReqSetRegion& operator=(const TFReqSetRegion&) = delete; - virtual ~TFReqSetRegion() - {} + virtual ~TFReqSetRegion() = default; virtual bool doWork(LLTextureFetch * fetcher); @@ -793,7 +793,9 @@ public: const LLUUID & session_id, const LLUUID & agent_id, LLSD& stats_sd); - TFReqSendMetrics & operator=(const TFReqSendMetrics &); // Not defined + + TFReqSendMetrics(const TFReqSendMetrics&) = delete; + TFReqSendMetrics& operator=(const TFReqSendMetrics&) = delete; virtual ~TFReqSendMetrics(); diff --git a/indra/newview/llviewerassetstats.h b/indra/newview/llviewerassetstats.h index de395da285..297d0a70ff 100644 --- a/indra/newview/llviewerassetstats.h +++ b/indra/newview/llviewerassetstats.h @@ -182,7 +182,7 @@ public: LLViewerAssetStats(const LLViewerAssetStats &); // Default destructor is correct. - LLViewerAssetStats & operator=(const LLViewerAssetStats &); // Not defined + LLViewerAssetStats& operator=(const LLViewerAssetStats&) = delete; // Clear all metrics data. This leaves the currently-active region // in place but with zero'd data for all metrics. All other regions diff --git a/indra/newview/llviewerassetstorage.cpp b/indra/newview/llviewerassetstorage.cpp index 6b2f53c272..141f370ecb 100644 --- a/indra/newview/llviewerassetstorage.cpp +++ b/indra/newview/llviewerassetstorage.cpp @@ -68,7 +68,7 @@ public: { } - LLViewerAssetRequest & operator=(const LLViewerAssetRequest &); // Not defined + LLViewerAssetRequest& operator=(const LLViewerAssetRequest&) = delete; // Default assignment operator valid // virtual -- cgit v1.3