#include "content/browser/devtools/service_worker_devtools_agent_host.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "content/browser/devtools/devtools_renderer_channel.h"
#include "content/browser/devtools/devtools_session.h"
#include "content/browser/devtools/network_service_devtools_observer.h"
#include "content/browser/devtools/protocol/fetch_handler.h"
#include "content/browser/devtools/protocol/inspector_handler.h"
#include "content/browser/devtools/protocol/io_handler.h"
#include "content/browser/devtools/protocol/network_handler.h"
#include "content/browser/devtools/protocol/protocol.h"
#include "content/browser/devtools/protocol/schema_handler.h"
#include "content/browser/devtools/protocol/target_handler.h"
#include "content/browser/devtools/service_worker_devtools_manager.h"
#include "content/browser/service_worker/service_worker_context_wrapper.h"
#include "content/browser/service_worker/service_worker_version.h"
#include "content/browser/storage_partition_impl.h"
#include "content/browser/url_loader_factory_params_helper.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "net/cookies/site_for_cookies.h"
#include "services/network/public/mojom/client_security_state.mojom.h"
#include "services/network/public/mojom/network_context.mojom-forward.h"
namespace content {
namespace {
class ServiceWorkerAutoAttacher
: public protocol::RendererAutoAttacherBase,
public ServiceWorkerDevToolsManager::Observer { … };
}
scoped_refptr<DevToolsAgentHost> DevToolsAgentHost::GetForServiceWorker(
ServiceWorkerContext* context,
int64_t version_id) { … }
ServiceWorkerDevToolsAgentHost::ServiceWorkerDevToolsAgentHost(
int worker_process_id,
int worker_route_id,
scoped_refptr<ServiceWorkerContextWrapper> context_wrapper,
int64_t version_id,
const GURL& url,
const GURL& scope,
bool is_installed_version,
network::mojom::ClientSecurityStatePtr client_security_state,
mojo::PendingRemote<network::mojom::CrossOriginEmbedderPolicyReporter>
coep_reporter,
const base::UnguessableToken& devtools_worker_token)
: … { … }
BrowserContext* ServiceWorkerDevToolsAgentHost::GetBrowserContext() { … }
std::string ServiceWorkerDevToolsAgentHost::GetType() { … }
std::string ServiceWorkerDevToolsAgentHost::GetTitle() { … }
GURL ServiceWorkerDevToolsAgentHost::GetURL() { … }
bool ServiceWorkerDevToolsAgentHost::Activate() { … }
void ServiceWorkerDevToolsAgentHost::Reload() { … }
bool ServiceWorkerDevToolsAgentHost::Close() { … }
void ServiceWorkerDevToolsAgentHost::WorkerVersionInstalled() { … }
void ServiceWorkerDevToolsAgentHost::WorkerVersionDoomed() { … }
void ServiceWorkerDevToolsAgentHost::WorkerMainScriptFetchingFailed() { … }
ServiceWorkerDevToolsAgentHost::~ServiceWorkerDevToolsAgentHost() { … }
bool ServiceWorkerDevToolsAgentHost::AttachSession(DevToolsSession* session,
bool acquire_wake_lock) { … }
void ServiceWorkerDevToolsAgentHost::DetachSession(DevToolsSession* session) { … }
protocol::TargetAutoAttacher* ServiceWorkerDevToolsAgentHost::auto_attacher() { … }
void ServiceWorkerDevToolsAgentHost::WorkerReadyForInspection(
mojo::PendingRemote<blink::mojom::DevToolsAgent> agent_remote,
mojo::PendingReceiver<blink::mojom::DevToolsAgentHost> host_receiver) { … }
void ServiceWorkerDevToolsAgentHost::UpdateClientSecurityState(
network::mojom::ClientSecurityStatePtr client_security_state,
mojo::PendingRemote<network::mojom::CrossOriginEmbedderPolicyReporter>
coep_reporter) { … }
void ServiceWorkerDevToolsAgentHost::WorkerStarted(int worker_process_id,
int worker_route_id) { … }
void ServiceWorkerDevToolsAgentHost::WorkerStopped() { … }
void ServiceWorkerDevToolsAgentHost::UpdateIsAttached(bool attached) { … }
void ServiceWorkerDevToolsAgentHost::UpdateProcessHost() { … }
void ServiceWorkerDevToolsAgentHost::RenderProcessHostDestroyed(
RenderProcessHost* host) { … }
void ServiceWorkerDevToolsAgentHost::UpdateLoaderFactories(
base::OnceClosure callback) { … }
DevToolsAgentHostImpl::NetworkLoaderFactoryParamsAndInfo
ServiceWorkerDevToolsAgentHost::CreateNetworkFactoryParamsForDevTools() { … }
RenderProcessHost* ServiceWorkerDevToolsAgentHost::GetProcessHost() { … }
std::optional<network::CrossOriginEmbedderPolicy>
ServiceWorkerDevToolsAgentHost::cross_origin_embedder_policy(
const std::string&) { … }
void ServiceWorkerDevToolsAgentHost::set_should_pause_on_start(
bool should_pause_on_start) { … }
}