chromium/components/update_client/update_client.cc

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/update_client/update_client.h"

#include <algorithm>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>

#include "base/check.h"
#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/observer_list.h"
#include "base/sequence_checker.h"
#include "base/task/sequenced_task_runner.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/update_client/configurator.h"
#include "components/update_client/crx_update_item.h"
#include "components/update_client/persisted_data.h"
#include "components/update_client/ping_manager.h"
#include "components/update_client/protocol_definition.h"
#include "components/update_client/protocol_parser.h"
#include "components/update_client/task_check_for_update.h"
#include "components/update_client/task_send_ping.h"
#include "components/update_client/task_update.h"
#include "components/update_client/update_checker.h"
#include "components/update_client/update_client_errors.h"
#include "components/update_client/update_client_internal.h"
#include "components/update_client/update_engine.h"
#include "components/update_client/utils.h"
#include "url/gurl.h"

namespace update_client {

CrxInstaller::InstallParams::InstallParams(
    const std::string& run,
    const std::string& arguments,
    const std::string& server_install_data)
    :{}

CrxUpdateItem::CrxUpdateItem() :{}
CrxUpdateItem::CrxUpdateItem(const CrxUpdateItem& other) = default;
CrxUpdateItem& CrxUpdateItem::operator=(const CrxUpdateItem& other) = default;
CrxUpdateItem::~CrxUpdateItem() = default;

CrxComponent::CrxComponent() = default;
CrxComponent::CrxComponent(const CrxComponent& other) = default;
CrxComponent& CrxComponent::operator=(const CrxComponent& other) = default;
CrxComponent::~CrxComponent() = default;

// It is important that an instance of the UpdateClient binds an unretained
// pointer to itself. Otherwise, a life time circular dependency between this
// instance and its inner members prevents the destruction of this instance.
// Using unretained references is allowed in this case since the life time of
// the UpdateClient instance exceeds the life time of its inner members,
// including any sequences that might execute callbacks bound to it.
UpdateClientImpl::UpdateClientImpl(
    scoped_refptr<Configurator> config,
    scoped_refptr<PingManager> ping_manager,
    UpdateChecker::Factory update_checker_factory)
    :{}

UpdateClientImpl::~UpdateClientImpl() {}

base::RepeatingClosure UpdateClientImpl::Install(
    const std::string& id,
    CrxDataCallback crx_data_callback,
    CrxStateChangeCallback crx_state_change_callback,
    Callback callback) {}

// Update tasks are background tasks and queued up.
void UpdateClientImpl::Update(const std::vector<std::string>& ids,
                              CrxDataCallback crx_data_callback,
                              CrxStateChangeCallback crx_state_change_callback,
                              bool is_foreground,
                              Callback callback) {}

// Update check tasks are queued up.
void UpdateClientImpl::CheckForUpdate(
    const std::string& id,
    CrxDataCallback crx_data_callback,
    CrxStateChangeCallback crx_state_change_callback,
    bool is_foreground,
    Callback callback) {}

void UpdateClientImpl::RunTask(scoped_refptr<Task> task) {}

void UpdateClientImpl::RunOrEnqueueTask(scoped_refptr<Task> task) {}

void UpdateClientImpl::OnTaskComplete(Callback callback,
                                      scoped_refptr<Task> task,
                                      Error error) {}

void UpdateClientImpl::AddObserver(Observer* observer) {}

void UpdateClientImpl::RemoveObserver(Observer* observer) {}

void UpdateClientImpl::NotifyObservers(Observer::Events event,
                                       const std::string& id) {}

bool UpdateClientImpl::GetCrxUpdateState(const std::string& id,
                                         CrxUpdateItem* update_item) const {}

bool UpdateClientImpl::IsUpdating(const std::string& id) const {}

void UpdateClientImpl::Stop() {}

void UpdateClientImpl::SendPing(const CrxComponent& crx_component,
                                PingParams ping_params,
                                Callback callback) {}

scoped_refptr<UpdateClient> UpdateClientFactory(
    scoped_refptr<Configurator> config) {}

void RegisterPrefs(PrefRegistrySimple* registry) {}

// This function has the exact same implementation as RegisterPrefs. We have
// this implementation here to make the intention more clear that is local user
// profile access is needed.
void RegisterProfilePrefs(PrefRegistrySimple* registry) {}

}  // namespace update_client