summaryrefslogtreecommitdiff
path: root/indra/llmessage/llcorehttputil.h
diff options
context:
space:
mode:
authorRye <rye@alchemyviewer.org>2025-11-28 11:03:31 -0500
committerGitHub <noreply@github.com>2025-11-28 18:03:31 +0200
commit54b3f3de64f3749022d95063c7439bfed316645f (patch)
tree62b539ac973ed24ba6baef8aaeda8980c9bd99c0 /indra/llmessage/llcorehttputil.h
parentbae1e1053de5db189b729f7c40e77fa26fe83766 (diff)
#5072 Use make_shared for more efficient ref counting and allocation
Diffstat (limited to 'indra/llmessage/llcorehttputil.h')
-rw-r--r--indra/llmessage/llcorehttputil.h98
1 files changed, 49 insertions, 49 deletions
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<HttpCoroutineAdapter> ptr_t;
typedef std::weak_ptr<HttpCoroutineAdapter> 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::HttpOptions>(),
+ LLCore::HttpHeaders::ptr_t headers = std::make_shared<LLCore::HttpHeaders>());
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::HttpOptions>(),
+ LLCore::HttpHeaders::ptr_t headers = std::make_shared<LLCore::HttpHeaders>());
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<LLCore::HttpOptions>(), 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<LLCore::HttpOptions>(), 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::HttpOptions>(),
+ LLCore::HttpHeaders::ptr_t headers = std::make_shared<LLCore::HttpHeaders>());
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<LLCore::HttpOptions>(), 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::HttpOptions>(),
+ LLCore::HttpHeaders::ptr_t headers = std::make_shared<LLCore::HttpHeaders>());
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<LLCore::HttpOptions>(), 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::HttpOptions>(),
+ LLCore::HttpHeaders::ptr_t headers = std::make_shared<LLCore::HttpHeaders>());
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<LLCore::HttpOptions>(), 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::HttpOptions>(),
+ LLCore::HttpHeaders::ptr_t headers = std::make_shared<LLCore::HttpHeaders>());
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<LLCore::HttpOptions>(), 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::HttpOptions>(),
+ LLCore::HttpHeaders::ptr_t headers = std::make_shared<LLCore::HttpHeaders>());
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<LLCore::HttpOptions>(), 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::HttpOptions>(),
+ LLCore::HttpHeaders::ptr_t headers = std::make_shared<LLCore::HttpHeaders>());
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<LLCore::HttpOptions>(), 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::HttpOptions>(),
+ LLCore::HttpHeaders::ptr_t headers = std::make_shared<LLCore::HttpHeaders>());
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<LLCore::HttpOptions>(),
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::HttpOptions>(),
+ LLCore::HttpHeaders::ptr_t headers = std::make_shared<LLCore::HttpHeaders>());
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<LLCore::HttpOptions>(),
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::HttpOptions>(),
+ LLCore::HttpHeaders::ptr_t headers = std::make_shared<LLCore::HttpHeaders>());
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<LLCore::HttpOptions>(),
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::HttpOptions>(),
+ LLCore::HttpHeaders::ptr_t headers = std::make_shared<LLCore::HttpHeaders>());
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<LLCore::HttpOptions>(),
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::HttpOptions>(),
+ LLCore::HttpHeaders::ptr_t headers = std::make_shared<LLCore::HttpHeaders>());
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<LLCore::HttpOptions>(),
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::HttpOptions>(),
+ LLCore::HttpHeaders::ptr_t headers = std::make_shared<LLCore::HttpHeaders>());
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<LLCore::HttpOptions>(), 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::HttpOptions>(),
+ LLCore::HttpHeaders::ptr_t headers = std::make_shared<LLCore::HttpHeaders>());
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<LLCore::HttpOptions>(), 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::HttpOptions>(),
+ LLCore::HttpHeaders::ptr_t headers = std::make_shared<LLCore::HttpHeaders>());
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<LLCore::HttpOptions>(), headers);
}
///