#include "chrome/browser/extensions/extension_garbage_collector.h"
#include <stddef.h>
#include <memory>
#include <utility>
#include "base/check_op.h"
#include "base/files/file_enumerator.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/notreached.h"
#include "base/one_shot_event.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/single_thread_task_runner.h"
#include "base/time/time.h"
#include "chrome/browser/extensions/extension_garbage_collector_factory.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_util.h"
#include "chrome/browser/extensions/install_tracker.h"
#include "chrome/browser/extensions/pending_extension_manager.h"
#include "chrome/browser/profiles/profile.h"
#include "components/crx_file/id_util.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "extensions/browser/extension_file_task_runner.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h"
#include "extensions/browser/extension_util.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_features.h"
#include "extensions/common/extension_id.h"
#include "extensions/common/file_util.h"
namespace extensions {
namespace {
constexpr base::TimeDelta kGarbageCollectRetryDelay = …;
constexpr base::TimeDelta kGarbageCollectStartupDelay = …;
ExtensionPathsMultimap;
void CheckExtensionDirectory(const base::FilePath& path,
const ExtensionPathsMultimap& extension_paths) { … }
void CheckUnpackedExtensionDirectory(
const base::FilePath& extension_directory,
const ExtensionPathsMultimap& installed_extension_dirs) { … }
}
ExtensionGarbageCollector::ExtensionGarbageCollector(
content::BrowserContext* context)
: … { … }
ExtensionGarbageCollector::~ExtensionGarbageCollector() { … }
ExtensionGarbageCollector* ExtensionGarbageCollector::Get(
content::BrowserContext* context) { … }
void ExtensionGarbageCollector::Shutdown() { … }
void ExtensionGarbageCollector::GarbageCollectExtensionsForTest() { … }
void ExtensionGarbageCollector::GarbageCollectExtensionsOnFileThread(
const base::FilePath& install_directory,
const ExtensionPathsMultimap& extension_paths,
bool unpacked) { … }
void ExtensionGarbageCollector::GarbageCollectExtensions() { … }
void ExtensionGarbageCollector::OnBeginCrxInstall(
content::BrowserContext* context,
const CrxInstaller& installer,
const ExtensionId& extension_id) { … }
void ExtensionGarbageCollector::OnFinishCrxInstall(
content::BrowserContext* context,
const CrxInstaller& installer,
const ExtensionId& extension_id,
bool success) { … }
}