| Index: third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp
|
| diff --git a/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp b/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp
|
| index 8743d587960f8145e9fd6db7cd6e97f53abcee2f..108d35c1f638dbb838af1caa6cc3ebf01829b660 100644
|
| --- a/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp
|
| +++ b/third_party/WebKit/Source/core/workers/WorkerOrWorkletGlobalScope.cpp
|
| @@ -4,6 +4,7 @@
|
|
|
| #include "core/workers/WorkerOrWorkletGlobalScope.h"
|
|
|
| +#include "bindings/core/v8/WorkerOrWorkletScriptController.h"
|
| #include "core/dom/ExecutionContextTask.h"
|
| #include "core/dom/TaskRunnerHelper.h"
|
| #include "core/frame/Deprecation.h"
|
| @@ -16,8 +17,10 @@
|
|
|
| namespace blink {
|
|
|
| -WorkerOrWorkletGlobalScope::WorkerOrWorkletGlobalScope()
|
| - : used_features_(UseCounter::kNumberOfFeatures) {}
|
| +WorkerOrWorkletGlobalScope::WorkerOrWorkletGlobalScope(v8::Isolate* isolate)
|
| + : script_controller_(
|
| + WorkerOrWorkletScriptController::Create(this, isolate)),
|
| + used_features_(UseCounter::kNumberOfFeatures) {}
|
|
|
| WorkerOrWorkletGlobalScope::~WorkerOrWorkletGlobalScope() = default;
|
|
|
| @@ -46,6 +49,14 @@ void WorkerOrWorkletGlobalScope::CountDeprecation(UseCounter::Feature feature) {
|
| ReportDeprecation(feature);
|
| }
|
|
|
| +bool WorkerOrWorkletGlobalScope::IsJSExecutionForbidden() const {
|
| + return script_controller_->IsExecutionForbidden();
|
| +}
|
| +
|
| +void WorkerOrWorkletGlobalScope::DisableEval(const String& error_message) {
|
| + script_controller_->DisableEval(error_message);
|
| +}
|
| +
|
| void WorkerOrWorkletGlobalScope::PostTask(
|
| TaskType type,
|
| const WebTraceLocation& location,
|
| @@ -66,6 +77,17 @@ void WorkerOrWorkletGlobalScope::PostTask(
|
| is_instrumented));
|
| }
|
|
|
| +void WorkerOrWorkletGlobalScope::Dispose() {
|
| + DCHECK(script_controller_);
|
| + script_controller_->Dispose();
|
| + script_controller_.Clear();
|
| +}
|
| +
|
| +DEFINE_TRACE(WorkerOrWorkletGlobalScope) {
|
| + visitor->Trace(script_controller_);
|
| + ExecutionContext::Trace(visitor);
|
| +}
|
| +
|
| void WorkerOrWorkletGlobalScope::RunTask(
|
| std::unique_ptr<ExecutionContextTask> task,
|
| bool is_instrumented) {
|
|
|