Commit 97b3131d authored by Sebastien Marchand's avatar Sebastien Marchand Committed by Commit Bot

Copy the LocalSiteChar...Database file to RC/PM/persistence/site_data

ps1 is a simple file move and rename.
ps2 updates the content of the file (to rename the class etc).
ps3-4: Rename the file once more (to disk_site_data_store) and update the
name of the functions to use Store instead of Database.
ps6: The name is not site_data_store.

Bug: 961336
Change-Id: I9d94973e980f7a27fcb508237f8905fb7300cf72
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1602599
Commit-Queue: Sébastien Marchand <sebmarchand@chromium.org>
Reviewed-by: default avatarChris Hamilton <chrisha@chromium.org>
Cr-Commit-Position: refs/heads/master@{#659090}
parent 7e9793c1
...@@ -1108,6 +1108,7 @@ jumbo_split_static_library("browser") { ...@@ -1108,6 +1108,7 @@ jumbo_split_static_library("browser") {
"performance_manager/performance_manager_clock.h", "performance_manager/performance_manager_clock.h",
"performance_manager/performance_manager_tab_helper.cc", "performance_manager/performance_manager_tab_helper.cc",
"performance_manager/performance_manager_tab_helper.h", "performance_manager/performance_manager_tab_helper.h",
"performance_manager/persistence/site_data/disk_site_data_store.h",
"performance_manager/public/graph/frame_node.h", "performance_manager/public/graph/frame_node.h",
"performance_manager/public/graph/graph.h", "performance_manager/public/graph/graph.h",
"performance_manager/public/graph/node_attached_data.h", "performance_manager/public/graph/node_attached_data.h",
......
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_PERFORMANCE_MANAGER_PERSISTENCE_SITE_DATA_SITE_DATA_STORE_H_
#define CHROME_BROWSER_PERFORMANCE_MANAGER_PERSISTENCE_SITE_DATA_SITE_DATA_STORE_H_
#include <vector>
#include "base/callback.h"
#include "base/macros.h"
#include "base/optional.h"
#include "chrome/browser/performance_manager/persistence/site_data/site_data.pb.h"
#include "url/origin.h"
class SiteDataProto;
namespace performance_manager {
// Interface for an on-disk SiteData store.
class SiteDataStore {
public:
// Callback to call once the initialization from the store has completed,
// |site_data_proto| should be equal to base::nullopt if the initialization
// has failed.
using ReadSiteDataFromStoreCallback =
base::OnceCallback<void(base::Optional<SiteDataProto> site_data_proto)>;
using GetStoreSizeCallback =
base::OnceCallback<void(base::Optional<int64_t> num_rows,
base::Optional<int64_t> on_disk_size_kb)>;
SiteDataStore() = default;
virtual ~SiteDataStore() {}
// Checks the if there's an entry with the key |origin| and if pass the
// corresponding proto to |callback|.
virtual void ReadSiteDataFromStore(
const url::Origin& origin,
ReadSiteDataFromStoreCallback callback) = 0;
// Store an entry in the store, create it if it doesn't exist and update it it
// it does.
virtual void WriteSiteDataIntoStore(const url::Origin& origin,
const SiteDataProto& site_data_proto) = 0;
// Removes some entries from the store.
virtual void RemoveSiteDataFromStore(
const std::vector<url::Origin>& site_origins) = 0;
// Clear the store, removes every entries that it contains.
virtual void ClearStore() = 0;
// Retrieve the size of the store.
virtual void GetStoreSize(GetStoreSizeCallback callback) = 0;
};
} // namespace performance_manager
#endif // CHROME_BROWSER_PERFORMANCE_MANAGER_PERSISTENCE_SITE_DATA_SITE_DATA_STORE_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment