#include "extensions/browser/state_store.h"
#include <stddef.h>
#include <utility>
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/observer_list.h"
#include "components/value_store/value_store_factory.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "extensions/browser/extension_file_task_runner.h"
#include "extensions/common/constants.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_id.h"
namespace {
std::string GetFullKey(const extensions::ExtensionId& extension_id,
const std::string& key) { … }
}
namespace extensions {
class StateStore::DelayedTaskQueue { … };
void StateStore::DelayedTaskQueue::InvokeWhenReady(base::OnceClosure task) { … }
void StateStore::DelayedTaskQueue::SetReady() { … }
StateStore::StateStore(
content::BrowserContext* context,
const scoped_refptr<value_store::ValueStoreFactory>& store_factory,
BackendType backend_type,
bool deferred_load)
: … { … }
StateStore::~StateStore() { … }
void StateStore::RegisterKey(const std::string& key) { … }
void StateStore::GetExtensionValue(const ExtensionId& extension_id,
const std::string& key,
ReadCallback callback) { … }
void StateStore::SetExtensionValue(const ExtensionId& extension_id,
const std::string& key,
base::Value value) { … }
void StateStore::RemoveExtensionValue(const ExtensionId& extension_id,
const std::string& key) { … }
void StateStore::AddObserver(TestObserver* observer) { … }
void StateStore::RemoveObserver(TestObserver* observer) { … }
void StateStore::FlushForTesting(base::OnceClosure flushed_callback) { … }
bool StateStore::IsInitialized() const { … }
void StateStore::OnExtensionWillBeInstalled(
content::BrowserContext* browser_context,
const Extension* extension,
bool is_update,
const std::string& old_name) { … }
void StateStore::OnExtensionUninstalled(
content::BrowserContext* browser_context,
const Extension* extension,
extensions::UninstallReason reason) { … }
void StateStore::Init() { … }
void StateStore::RemoveKeysForExtension(const ExtensionId& extension_id) { … }
}