chromium/components/offline_pages/core/background/pick_request_task.cc

// Copyright 2016 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/offline_pages/core/background/pick_request_task.h"

#include <memory>
#include <unordered_set>
#include <utility>
#include <vector>

#include "base/check.h"
#include "base/functional/bind.h"
#include "base/time/time.h"
#include "components/offline_pages/core/background/device_conditions.h"
#include "components/offline_pages/core/background/offliner_policy.h"
#include "components/offline_pages/core/background/offliner_policy_utils.h"
#include "components/offline_pages/core/background/request_coordinator_event_logger.h"
#include "components/offline_pages/core/background/request_notifier.h"
#include "components/offline_pages/core/background/request_queue_store.h"
#include "components/offline_pages/core/background/save_page_request.h"
#include "components/offline_pages/core/offline_clock.h"
#include "components/offline_pages/core/offline_page_client_policy.h"

namespace {
template <typename T>
int signum(T t) {}

bool kCleanupNeeded =;
bool kNonUserRequestsFound =;

#define CALL_MEMBER_FUNCTION(object, ptrToMember)
}  // namespace

namespace offline_pages {

const base::TimeDelta PickRequestTask::kDeferInterval =;

PickRequestTask::PickRequestTask(
    RequestQueueStore* store,
    OfflinerPolicy* policy,
    RequestPickedCallback picked_callback,
    RequestNotPickedCallback not_picked_callback,
    DeviceConditions device_conditions,
    const std::set<int64_t>& disabled_requests,
    base::circular_deque<int64_t>* prioritized_requests)
    :{}

PickRequestTask::~PickRequestTask() {}

void PickRequestTask::Run() {}

void PickRequestTask::GetRequests() {}

void PickRequestTask::Choose(
    bool success,
    std::vector<std::unique_ptr<SavePageRequest>> requests) {}

// Filter out requests that don't meet the current conditions.  For instance, if
// this is a predictive request, and we are not on WiFi, it should be ignored
// this round.
bool PickRequestTask::RequestConditionsSatisfied(
    const SavePageRequest& request) {}

// Look at policies to decide which requests to prefer.
bool PickRequestTask::IsNewRequestBetter(const SavePageRequest& oldRequest,
                                         const SavePageRequest& newRequest,
                                         RequestCompareFunction comparator) {}

// Compare the results, checking request count before recency.  Returns true if
// left hand side is better, false otherwise.
bool PickRequestTask::RetryCountFirstCompareFunction(
    const SavePageRequest& left,
    const SavePageRequest& right) {}

// Compare the results, checking recency before request count. Returns true if
// left hand side is better, false otherwise.
bool PickRequestTask::RecencyFirstCompareFunction(
    const SavePageRequest& left,
    const SavePageRequest& right) {}

// Compare left and right side, returning 1 if the left side is better
// (preferred by policy), 0 if the same, and -1 if the right side is better.
int PickRequestTask::CompareRetryCount(const SavePageRequest& left,
                                       const SavePageRequest& right) {}

// Compare left and right side, returning 1 if the left side is better
// (preferred by policy), 0 if the same, and -1 if the right side is better.
int PickRequestTask::CompareCreationTime(const SavePageRequest& left,
                                         const SavePageRequest& right) {}

}  // namespace offline_pages