#include "extensions/browser/api/offscreen/offscreen_document_manager.h"
#include "base/check.h"
#include "base/containers/contains.h"
#include "base/dcheck_is_on.h"
#include "base/not_fatal_until.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
#include "content/public/browser/browser_context.h"
#include "extensions/browser/api/offscreen/lifetime_enforcer_factories.h"
#include "extensions/browser/api/offscreen/offscreen_document_lifetime_enforcer.h"
#include "extensions/browser/extension_registry_factory.h"
#include "extensions/browser/extension_util.h"
#include "extensions/browser/extensions_browser_client.h"
#include "extensions/browser/offscreen_document_host.h"
#include "extensions/browser/process_manager.h"
#include "extensions/browser/process_manager_factory.h"
#include "extensions/common/manifest_handlers/incognito_info.h"
#include "url/gurl.h"
#include "url/origin.h"
namespace extensions {
namespace {
class OffscreenDocumentManagerFactory
: public BrowserContextKeyedServiceFactory { … };
OffscreenDocumentManagerFactory::OffscreenDocumentManagerFactory()
: … { … }
OffscreenDocumentManager* OffscreenDocumentManagerFactory::GetForBrowserContext(
content::BrowserContext* browser_context) { … }
content::BrowserContext*
OffscreenDocumentManagerFactory::GetBrowserContextToUse(
content::BrowserContext* context) const { … }
KeyedService* OffscreenDocumentManagerFactory::BuildServiceInstanceFor(
content::BrowserContext* context) const { … }
}
OffscreenDocumentManager::OffscreenDocumentData::OffscreenDocumentData() =
default;
OffscreenDocumentManager::OffscreenDocumentData::~OffscreenDocumentData() =
default;
OffscreenDocumentManager::OffscreenDocumentData::OffscreenDocumentData(
OffscreenDocumentData&&) = default;
OffscreenDocumentManager::OffscreenDocumentManager(
content::BrowserContext* browser_context)
: … { … }
OffscreenDocumentManager::~OffscreenDocumentManager() = default;
OffscreenDocumentManager* OffscreenDocumentManager::Get(
content::BrowserContext* browser_context) { … }
BrowserContextKeyedServiceFactory* OffscreenDocumentManager::GetFactory() { … }
OffscreenDocumentHost* OffscreenDocumentManager::CreateOffscreenDocument(
const Extension& extension,
const GURL& url,
std::set<api::offscreen::Reason> reasons) { … }
OffscreenDocumentHost*
OffscreenDocumentManager::GetOffscreenDocumentForExtension(
const Extension& extension) { … }
void OffscreenDocumentManager::CloseOffscreenDocumentForExtension(
const Extension& extension) { … }
void OffscreenDocumentManager::CloseOffscreenDocumentForExtensionId(
const ExtensionId& extension_id) { … }
void OffscreenDocumentManager::OnOffscreenDocumentActivityChanged(
const ExtensionId& extension_id) { … }
void OffscreenDocumentManager::OnExtensionUnloaded(
content::BrowserContext* browser_context,
const Extension* extension,
UnloadedExtensionReason reason) { … }
void OffscreenDocumentManager::Shutdown() { … }
void OffscreenDocumentManager::CloseOffscreenDocument(
ExtensionHost* offscreen_document) { … }
}