summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/core/workers/dedicated_worker.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/blink/renderer/core/workers/dedicated_worker.cc')
-rw-r--r--chromium/third_party/blink/renderer/core/workers/dedicated_worker.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/chromium/third_party/blink/renderer/core/workers/dedicated_worker.cc b/chromium/third_party/blink/renderer/core/workers/dedicated_worker.cc
index 7f4cf6368c8..21d27a9c1e0 100644
--- a/chromium/third_party/blink/renderer/core/workers/dedicated_worker.cc
+++ b/chromium/third_party/blink/renderer/core/workers/dedicated_worker.cc
@@ -76,6 +76,14 @@ DedicatedWorker* DedicatedWorker::Create(ExecutionContext* context,
return nullptr;
}
+ auto origin = SecurityOrigin::Create(script_request_url);
+ if (origin->IsBroken()) {
+ exception_state.ThrowDOMException(
+ DOMExceptionCode::kNotSupportedError,
+ "Access to dedicated workers is denied to origin '" + origin->ToString() + "'.");
+ return nullptr;
+ }
+
if (context->IsWorkerGlobalScope())
UseCounter::Count(context, WebFeature::kNestedDedicatedWorker);