#include "components/sync/engine/net/sync_server_connection_manager.h"
#include <stdint.h>
#include <utility>
#include "base/memory/raw_ptr.h"
#include "components/sync/engine/cancelation_signal.h"
#include "components/sync/engine/net/http_post_provider.h"
#include "components/sync/engine/net/http_post_provider_factory.h"
#include "net/base/net_errors.h"
#include "net/http/http_status_code.h"
#include "third_party/abseil-cpp/absl/cleanup/cleanup.h"
namespace syncer {
namespace {
class Connection : public CancelationSignal::Observer { … };
Connection::Connection(HttpPostProviderFactory* factory,
CancelationSignal* cancelation_signal)
: … { … }
Connection::~Connection() = default;
HttpResponse Connection::PostRequestAndDownloadResponse(
const GURL& sync_request_url,
const std::string& access_token,
const std::string& payload,
std::string* buffer_out) { … }
void Connection::OnCancelationSignalReceived() { … }
}
SyncServerConnectionManager::SyncServerConnectionManager(
const GURL& sync_request_url,
std::unique_ptr<HttpPostProviderFactory> factory,
CancelationSignal* cancelation_signal)
: … { … }
SyncServerConnectionManager::~SyncServerConnectionManager() = default;
HttpResponse SyncServerConnectionManager::PostBuffer(
const std::string& buffer_in,
const std::string& access_token,
std::string* buffer_out) { … }
}