#include "content/browser/service_worker/service_worker_registration_object_host.h"
#include "base/debug/crash_logging.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "content/browser/service_worker/service_worker_consts.h"
#include "content/browser/service_worker/service_worker_container_host.h"
#include "content/browser/service_worker/service_worker_context_core.h"
#include "content/browser/service_worker/service_worker_context_wrapper.h"
#include "content/browser/service_worker/service_worker_object_host.h"
#include "content/browser/service_worker/service_worker_security_utils.h"
#include "net/http/http_util.h"
#include "third_party/blink/public/mojom/service_worker/service_worker_registration.mojom.h"
namespace content {
namespace {
blink::mojom::ServiceWorkerObjectInfoPtr CreateCompleteObjectInfoToSend(
ServiceWorkerContainerHost* container_host,
ServiceWorkerVersion* version) { … }
}
ServiceWorkerRegistrationObjectHost::ServiceWorkerRegistrationObjectHost(
base::WeakPtr<ServiceWorkerContextCore> context,
ServiceWorkerContainerHost* container_host,
scoped_refptr<ServiceWorkerRegistration> registration)
: … { … }
ServiceWorkerRegistrationObjectHost::~ServiceWorkerRegistrationObjectHost() { … }
blink::mojom::ServiceWorkerRegistrationObjectInfoPtr
ServiceWorkerRegistrationObjectHost::CreateObjectInfo() { … }
void ServiceWorkerRegistrationObjectHost::OnVersionAttributesChanged(
ServiceWorkerRegistration* registration,
blink::mojom::ChangedServiceWorkerObjectsMaskPtr changed_mask) { … }
void ServiceWorkerRegistrationObjectHost::OnUpdateViaCacheChanged(
ServiceWorkerRegistration* registration) { … }
void ServiceWorkerRegistrationObjectHost::OnRegistrationFailed(
ServiceWorkerRegistration* registration) { … }
void ServiceWorkerRegistrationObjectHost::OnUpdateFound(
ServiceWorkerRegistration* registration) { … }
void ServiceWorkerRegistrationObjectHost::Update(
blink::mojom::FetchClientSettingsObjectPtr
outside_fetch_client_settings_object,
UpdateCallback callback) { … }
void ServiceWorkerRegistrationObjectHost::Unregister(
UnregisterCallback callback) { … }
void ServiceWorkerRegistrationObjectHost::EnableNavigationPreload(
bool enable,
EnableNavigationPreloadCallback callback) { … }
void ServiceWorkerRegistrationObjectHost::GetNavigationPreloadState(
GetNavigationPreloadStateCallback callback) { … }
void ServiceWorkerRegistrationObjectHost::SetNavigationPreloadHeader(
const std::string& value,
SetNavigationPreloadHeaderCallback callback) { … }
void ServiceWorkerRegistrationObjectHost::UnregistrationComplete(
UnregisterCallback callback,
blink::ServiceWorkerStatusCode status) { … }
void ServiceWorkerRegistrationObjectHost::DidUpdateNavigationPreloadEnabled(
bool enable,
EnableNavigationPreloadCallback callback,
blink::ServiceWorkerStatusCode status) { … }
void ServiceWorkerRegistrationObjectHost::DidUpdateNavigationPreloadHeader(
const std::string& value,
SetNavigationPreloadHeaderCallback callback,
blink::ServiceWorkerStatusCode status) { … }
void ServiceWorkerRegistrationObjectHost::SetServiceWorkerObjects(
blink::mojom::ChangedServiceWorkerObjectsMaskPtr changed_mask,
ServiceWorkerVersion* installing_version,
ServiceWorkerVersion* waiting_version,
ServiceWorkerVersion* active_version) { … }
void ServiceWorkerRegistrationObjectHost::OnConnectionError() { … }
template <typename CallbackType, typename... Args>
bool ServiceWorkerRegistrationObjectHost::CanServeRegistrationObjectHostMethods(
CallbackType* callback,
const std::string& error_prefix,
Args... args) { … }
}