Audacity 3.2.0
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
audacity::network_manager::NetworkManager Class Referencefinal

#include <NetworkManager.h>

Collaboration diagram for audacity::network_manager::NetworkManager:
[legend]

Public Member Functions

ResponsePtr doGet (const Request &request)
 
ResponsePtr doHead (const Request &request)
 
ResponsePtr doDelete (const Request &request)
 
ResponsePtr doPost (const Request &request, const void *data, size_t size)
 
ResponsePtr doPost (const Request &request, RequestPayloadStreamPtr payloadStream)
 
ResponsePtr doPost (const Request &request, std::unique_ptr< MultipartData > form)
 
ResponsePtr doPut (const Request &request, const void *data, size_t size)
 
ResponsePtr doPut (const Request &request, RequestPayloadStreamPtr payloadStream)
 
ResponsePtr doPut (const Request &request, std::unique_ptr< MultipartData > form)
 
ResponsePtr doPatch (const Request &request, const void *data, size_t size)
 
ResponsePtr doPatch (const Request &request, RequestPayloadStreamPtr payloadStream)
 
void setProxy (const std::string &proxy)
 

Static Public Member Functions

static NetworkManagerGetInstance ()
 
static void Terminate ()
 

Private Member Functions

 NetworkManager ()
 
 ~NetworkManager ()
 

Private Attributes

std::unique_ptr< IResponseFactorymResponseFactory
 

Detailed Description

Definition at line 33 of file NetworkManager.h.

Constructor & Destructor Documentation

◆ NetworkManager()

NetworkManager::NetworkManager ( )
private

Definition at line 32 of file NetworkManager.cpp.

33{
34 mResponseFactory = std::make_unique<CurlResponseFactory> ();
35}
std::unique_ptr< IResponseFactory > mResponseFactory

References mResponseFactory.

◆ ~NetworkManager()

NetworkManager::~NetworkManager ( )
private

Definition at line 37 of file NetworkManager.cpp.

38{}

Member Function Documentation

◆ doDelete()

ResponsePtr NetworkManager::doDelete ( const Request request)

◆ doGet()

ResponsePtr NetworkManager::doGet ( const Request request)

◆ doHead()

ResponsePtr NetworkManager::doHead ( const Request request)

Definition at line 57 of file NetworkManager.cpp.

58{
59 return mResponseFactory->performRequest (RequestVerb::Head, request);
60}

References audacity::network_manager::Head, and mResponseFactory.

◆ doPatch() [1/2]

ResponsePtr NetworkManager::doPatch ( const Request request,
const void *  data,
size_t  size 
)

Definition at line 106 of file NetworkManager.cpp.

107{
108 return mResponseFactory->performRequest(
109 RequestVerb::Patch, request,
110 CreateRequestPayloadStream(data, size, true));
111}
RequestPayloadStreamPtr CreateRequestPayloadStream(const void *data, int64_t size, bool copyData)

References audacity::network_manager::CreateRequestPayloadStream(), mResponseFactory, audacity::network_manager::Patch, and size.

Referenced by audacity::cloud::audiocom::anonymous_namespace{UploadService.cpp}::AudiocomUploadOperation::HandleUploadProgress().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ doPatch() [2/2]

ResponsePtr NetworkManager::doPatch ( const Request request,
RequestPayloadStreamPtr  payloadStream 
)

Definition at line 113 of file NetworkManager.cpp.

115{
116 return mResponseFactory->performRequest(
117 RequestVerb::Patch, request, std::move(payloadStream));
118}

References mResponseFactory, and audacity::network_manager::Patch.

◆ doPost() [1/3]

ResponsePtr NetworkManager::doPost ( const Request request,
const void *  data,
size_t  size 
)

Definition at line 67 of file NetworkManager.cpp.

68{
69 return mResponseFactory->performRequest(
71}

References audacity::network_manager::CreateRequestPayloadStream(), mResponseFactory, audacity::network_manager::Post, and size.

Referenced by audacity::cloud::audiocom::OAuthService::Authorize(), audacity::cloud::audiocom::sync::DataUploader::UploadOperation::ConfirmUpload(), audacity::cloud::audiocom::OAuthService::DoAuthorise(), audacity::cloud::audiocom::sync::DataUploader::UploadOperation::FailUpload(), audacity::cloud::audiocom::anonymous_namespace{UploadService.cpp}::AudiocomUploadOperation::HandleS3UploadCompleted(), audacity::cloud::audiocom::anonymous_namespace{UploadService.cpp}::AudiocomUploadOperation::HandleUploadPolicy(), audacity::cloud::audiocom::anonymous_namespace{UploadService.cpp}::AudiocomUploadOperation::InitiateUpload(), audacity::cloud::audiocom::sync::LocalProjectSnapshot::MarkSnapshotSynced(), audacity::cloud::audiocom::sync::anonymous_namespace{ResumedSnaphotUploadOperation.cpp}::ResumedSnaphotUploadOperation::MarkSnapshotSynced(), audacity::cloud::audiocom::OAuthService::Register(), audacity::sentry::Report::ReportImpl::Send(), and audacity::cloud::audiocom::sync::LocalProjectSnapshot::UpdateProjectSnapshot().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ doPost() [2/3]

ResponsePtr NetworkManager::doPost ( const Request request,
RequestPayloadStreamPtr  payloadStream 
)

Definition at line 73 of file NetworkManager.cpp.

75{
76 return mResponseFactory->performRequest(
77 RequestVerb::Post, request, std::move(payloadStream));
78}

References mResponseFactory, and audacity::network_manager::Post.

◆ doPost() [3/3]

ResponsePtr NetworkManager::doPost ( const Request request,
std::unique_ptr< MultipartData form 
)

Definition at line 80 of file NetworkManager.cpp.

82{
83 return mResponseFactory->performRequest(RequestVerb::Post, request, std::move(form));
84}

References mResponseFactory, and audacity::network_manager::Post.

◆ doPut() [1/3]

ResponsePtr NetworkManager::doPut ( const Request request,
const void *  data,
size_t  size 
)

Definition at line 86 of file NetworkManager.cpp.

87{
88 return mResponseFactory->performRequest(
89 RequestVerb::Put, request, CreateRequestPayloadStream(data, size, true));
90}

References audacity::network_manager::CreateRequestPayloadStream(), mResponseFactory, audacity::network_manager::Put, and size.

Referenced by audacity::cloud::audiocom::sync::DataUploader::UploadOperation::PerformUpload().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ doPut() [2/3]

ResponsePtr NetworkManager::doPut ( const Request request,
RequestPayloadStreamPtr  payloadStream 
)

Definition at line 92 of file NetworkManager.cpp.

94{
95 return mResponseFactory->performRequest(
96 RequestVerb::Put, request, std::move(payloadStream));
97}

References mResponseFactory, and audacity::network_manager::Put.

◆ doPut() [3/3]

ResponsePtr NetworkManager::doPut ( const Request request,
std::unique_ptr< MultipartData form 
)

Definition at line 99 of file NetworkManager.cpp.

101{
102 return mResponseFactory->performRequest(RequestVerb::Put, request, std::move(form));
103}

References mResponseFactory, and audacity::network_manager::Put.

◆ GetInstance()

NetworkManager & NetworkManager::GetInstance ( )
static

Definition at line 40 of file NetworkManager.cpp.

41{
42 static NetworkManager instance;
43
44 return instance;
45}
Class for performing HTTP requests.

Referenced by audacity::cloud::audiocom::OAuthService::Authorize(), audacity::cloud::audiocom::sync::DataUploader::UploadOperation::ConfirmUpload(), audacity::cloud::audiocom::sync::LocalProjectSnapshot::DeleteSnapshot(), audacity::cloud::audiocom::anonymous_namespace{UploadService.cpp}::AudiocomUploadOperation::DiscardResult(), audacity::cloud::audiocom::OAuthService::DoAuthorise(), audacity::cloud::audiocom::UserService::DownloadAvatar(), audacity::cloud::audiocom::sync::RemoteProjectSnapshot::DownloadBlob(), audacity::cloud::audiocom::sync::DataUploader::UploadOperation::FailUpload(), UpdateManager::GetUpdates(), audacity::cloud::audiocom::anonymous_namespace{UploadService.cpp}::AudiocomUploadOperation::HandleS3UploadCompleted(), audacity::cloud::audiocom::anonymous_namespace{UploadService.cpp}::AudiocomUploadOperation::HandleUploadPolicy(), audacity::cloud::audiocom::anonymous_namespace{UploadService.cpp}::AudiocomUploadOperation::HandleUploadProgress(), audacity::cloud::audiocom::anonymous_namespace{UploadService.cpp}::AudiocomUploadOperation::InitiateUpload(), audacity::cloud::audiocom::sync::LocalProjectSnapshot::MarkSnapshotSynced(), audacity::cloud::audiocom::sync::anonymous_namespace{ResumedSnaphotUploadOperation.cpp}::ResumedSnaphotUploadOperation::MarkSnapshotSynced(), AudacityApp::OnExit(), audacity::cloud::audiocom::anonymous_namespace{CloudSyncService.cpp}::PerformProjectGetRequest(), audacity::cloud::audiocom::sync::DataUploader::UploadOperation::PerformUpload(), audacity::cloud::audiocom::sync::anonymous_namespace{ResumedSnaphotUploadOperation.cpp}::ResumedSnaphotUploadOperation::RefreshUrls(), audacity::cloud::audiocom::OAuthService::Register(), audacity::sentry::Report::ReportImpl::Send(), Terminate(), audacity::cloud::audiocom::sync::LocalProjectSnapshot::UpdateProjectSnapshot(), and audacity::cloud::audiocom::UserService::UpdateUserData().

Here is the caller graph for this function:

◆ setProxy()

void NetworkManager::setProxy ( const std::string &  proxy)

Definition at line 120 of file NetworkManager.cpp.

121{
122 mResponseFactory->setProxy (proxy);
123}

References mResponseFactory.

◆ Terminate()

void NetworkManager::Terminate ( )
static

Definition at line 47 of file NetworkManager.cpp.

48{
49 GetInstance ().mResponseFactory->terminate ();
50}

References GetInstance(), and mResponseFactory.

Referenced by AudacityApp::OnExit().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ mResponseFactory

std::unique_ptr<IResponseFactory> audacity::network_manager::NetworkManager::mResponseFactory
private

The documentation for this class was generated from the following files: