#include "chrome/updater/ipc/update_service_internal_proxy_posix.h"
#include <memory>
#include <optional>
#include <utility>
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/functional/callback.h"
#include "base/memory/scoped_refptr.h"
#include "base/process/launch.h"
#include "base/task/bind_post_task.h"
#include "base/task/task_traits.h"
#include "base/task/thread_pool.h"
#include "base/thread_annotations.h"
#include "base/time/time.h"
#include "chrome/updater/app/server/posix/mojom/updater_service_internal.mojom.h"
#include "chrome/updater/constants.h"
#include "chrome/updater/ipc/ipc_names.h"
#include "chrome/updater/ipc/update_service_dialer.h"
#include "chrome/updater/ipc/update_service_internal_proxy.h"
#include "chrome/updater/service_proxy_factory.h"
#include "chrome/updater/update_service_internal.h"
#include "chrome/updater/updater_scope.h"
#include "chrome/updater/util/util.h"
#include "components/named_mojo_ipc_server/named_mojo_ipc_server_client_util.h"
#include "mojo/public/cpp/bindings/callback_helpers.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/platform/named_platform_channel.h"
#include "mojo/public/cpp/platform/platform_channel.h"
#include "mojo/public/cpp/platform/platform_channel_endpoint.h"
#include "mojo/public/cpp/system/isolated_connection.h"
namespace updater {
namespace {
constexpr base::TimeDelta kConnectionTimeout = …;
std::optional<mojo::PlatformChannelEndpoint> ConnectMojo(UpdaterScope scope,
int retries) { … }
void Connect(
UpdaterScope scope,
int tries,
base::Time deadline,
base::OnceCallback<void(std::optional<mojo::PlatformChannelEndpoint>)>
connected_callback) { … }
}
UpdateServiceInternalProxyImpl::UpdateServiceInternalProxyImpl(
UpdaterScope scope)
: … { … }
void UpdateServiceInternalProxyImpl::Run(
base::OnceCallback<void(std::optional<RpcError>)> callback) { … }
void UpdateServiceInternalProxyImpl::Hello(
base::OnceCallback<void(std::optional<RpcError>)> callback) { … }
UpdateServiceInternalProxyImpl::~UpdateServiceInternalProxyImpl() = default;
void UpdateServiceInternalProxyImpl::EnsureConnecting() { … }
void UpdateServiceInternalProxyImpl::OnDisconnected() { … }
void UpdateServiceInternalProxyImpl::OnConnected(
mojo::PendingReceiver<mojom::UpdateServiceInternal> pending_receiver,
std::optional<mojo::PlatformChannelEndpoint> endpoint) { … }
scoped_refptr<UpdateServiceInternal> CreateUpdateServiceInternalProxy(
UpdaterScope scope) { … }
}