#include "extensions/browser/lazy_background_task_queue.h"
#include "base/check.h"
#include "base/containers/contains.h"
#include "base/functional/callback.h"
#include "base/notreached.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/site_instance.h"
#include "content/public/browser/web_contents.h"
#include "extensions/browser/extension_host.h"
#include "extensions/browser/extensions_browser_client.h"
#include "extensions/browser/lazy_background_task_queue_factory.h"
#include "extensions/browser/lazy_context_id.h"
#include "extensions/browser/process_manager.h"
#include "extensions/browser/process_map.h"
#include "extensions/common/extension.h"
#include "extensions/common/manifest_handlers/background_info.h"
#include "extensions/common/mojom/view_type.mojom.h"
namespace extensions {
namespace {
bool CreateLazyBackgroundHost(ProcessManager* pm, const Extension* extension) { … }
}
LazyBackgroundTaskQueue::LazyBackgroundTaskQueue(
content::BrowserContext* browser_context)
: … { … }
LazyBackgroundTaskQueue::~LazyBackgroundTaskQueue() { … }
LazyBackgroundTaskQueue* LazyBackgroundTaskQueue::Get(
content::BrowserContext* browser_context) { … }
bool LazyBackgroundTaskQueue::ShouldEnqueueTask(
content::BrowserContext* browser_context,
const Extension* extension) const { … }
bool LazyBackgroundTaskQueue::IsReadyToRunTasks(
content::BrowserContext* browser_context,
const Extension* extension) const { … }
void LazyBackgroundTaskQueue::AddPendingTask(const LazyContextId& context_id,
PendingTask task) { … }
void LazyBackgroundTaskQueue::ProcessPendingTasks(
ExtensionHost* host,
content::BrowserContext* browser_context,
const Extension* extension) { … }
void LazyBackgroundTaskQueue::NotifyTasksExtensionFailedToLoad(
content::BrowserContext* browser_context,
const Extension* extension) { … }
void LazyBackgroundTaskQueue::OnExtensionHostCompletedFirstLoad(
content::BrowserContext* browser_context,
ExtensionHost* host) { … }
void LazyBackgroundTaskQueue::OnExtensionHostDestroyed(
content::BrowserContext* browser_context,
ExtensionHost* host) { … }
void LazyBackgroundTaskQueue::OnExtensionLoaded(
content::BrowserContext* browser_context,
const Extension* extension) { … }
void LazyBackgroundTaskQueue::OnExtensionUnloaded(
content::BrowserContext* browser_context,
const Extension* extension,
UnloadedExtensionReason reason) { … }
void LazyBackgroundTaskQueue::CreateLazyBackgroundHostOnExtensionLoaded(
content::BrowserContext* browser_context,
const Extension* extension) { … }
}