chromium/components/offline_pages/core/model/store_visuals_task.cc

// Copyright 2019 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/model/store_visuals_task.h"

#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "components/offline_pages/core/offline_clock.h"
#include "components/offline_pages/core/offline_page_metadata_store.h"
#include "sql/database.h"
#include "sql/statement.h"
#include "sql/transaction.h"

namespace offline_pages {

// Visuals are marked to expire after this delta. Expired visuals are
// eventually deleted if their offline_id does not correspond to an offline
// item. Two days gives us plenty of time so that the prefetched item can be
// imported into the offline item database.
const base::TimeDelta kVisualsExpirationDelta =;

namespace {

bool EnsureRowExistsSync(sql::Database* db,
                         int64_t offline_id,
                         base::Time expiration) {}

bool StoreThumbnailSync(sql::Database* db,
                        int64_t offline_id,
                        base::Time expiration,
                        const std::string& thumbnail) {}

bool StoreFaviconSync(sql::Database* db,
                      int64_t offline_id,
                      base::Time expiration,
                      const std::string& favicon) {}

bool StoreVisualsSync(int64_t offline_id,
                      base::Time expiration,
                      const std::string& thumbnail,
                      const std::string& favicon,
                      sql::Database* db) {}

}  // namespace

// static
std::unique_ptr<StoreVisualsTask> StoreVisualsTask::MakeStoreThumbnailTask(
    OfflinePageMetadataStore* store,
    int64_t offline_id,
    std::string thumbnail,
    CompleteCallback callback) {}

// static
std::unique_ptr<StoreVisualsTask> StoreVisualsTask::MakeStoreFaviconTask(
    OfflinePageMetadataStore* store,
    int64_t offline_id,
    std::string favicon,
    CompleteCallback callback) {}

StoreVisualsTask::StoreVisualsTask(OfflinePageMetadataStore* store,
                                   int64_t offline_id,
                                   std::string thumbnail,
                                   std::string favicon,
                                   RowUpdatedCallback complete_callback)
    :{}

StoreVisualsTask::~StoreVisualsTask() = default;

void StoreVisualsTask::Run() {}

void StoreVisualsTask::Complete(bool success) {}

}  // namespace offline_pages