Skip to content

Commit

Permalink
ASSERTION FAILED: m_suspendIfNeededWasCalled
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=268194
rdar://121689893

Reviewed by Darin Adler.

Protect the scriptExecutionContext in NavigatorBase::serviceWorker()
before passing it to ServiceWorkerContainer::create().

* Source/WebCore/page/NavigatorBase.cpp:
(WebCore::NavigatorBase::serviceWorker):

Canonical link: https://commits.webkit.org/273637@main
  • Loading branch information
cdumez committed Jan 29, 2024
1 parent d7621ef commit 23ed729
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Source/WebCore/page/NavigatorBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ ServiceWorkerContainer& NavigatorBase::serviceWorker()
{
ASSERT(!scriptExecutionContext() || scriptExecutionContext()->settingsValues().serviceWorkersEnabled);
if (!m_serviceWorkerContainer)
m_serviceWorkerContainer = ServiceWorkerContainer::create(scriptExecutionContext(), *this).moveToUniquePtr();
m_serviceWorkerContainer = ServiceWorkerContainer::create(protectedScriptExecutionContext().get(), *this).moveToUniquePtr();
return *m_serviceWorkerContainer;
}

Expand Down
1 change: 1 addition & 0 deletions Source/WebCore/workers/WorkerOrWorkletGlobalScope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ WorkerOrWorkletGlobalScope::WorkerOrWorkletGlobalScope(WorkerThreadType type, PA
, m_referrerPolicy(referrerPolicy)
, m_noiseInjectionHashSalt(noiseInjectionHashSalt)
{
relaxAdoptionRequirement();
}

WorkerOrWorkletGlobalScope::~WorkerOrWorkletGlobalScope() = default;
Expand Down
1 change: 0 additions & 1 deletion Source/WebCore/workers/shared/SharedWorkerGlobalScope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ SharedWorkerGlobalScope::SharedWorkerGlobalScope(const String& name, const Worke
, m_name(name)
{
SCOPE_RELEASE_LOG("SharedWorkerGlobalScope:");
relaxAdoptionRequirement();
applyContentSecurityPolicyResponseHeaders(params.contentSecurityPolicyResponseHeaders);
}

Expand Down

0 comments on commit 23ed729

Please sign in to comment.