Commit d814ce06 authored by Hiroshige Hayashizaki's avatar Hiroshige Hayashizaki Committed by Chromium LUCI CQ

Unify GetV8CacheOptions() to ModulatorImplBase

Follow-up of
https://chromium-review.googlesource.com/c/chromium/src/+/2541362
that introduced ExecutionContext::GetV8CacheOptions().

This CL doesn't change the behavior.

Bug: 1111134
Change-Id: I0b11b7f43b4d8b5574bb94b1aabd8d7e590cb475
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2556386
Commit-Queue: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: default avatarKouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#833578}
parent 9eeb09a7
...@@ -4,11 +4,7 @@ ...@@ -4,11 +4,7 @@
#include "third_party/blink/renderer/core/script/document_modulator_impl.h" #include "third_party/blink/renderer/core/script/document_modulator_impl.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/settings.h"
#include "third_party/blink/renderer/core/loader/modulescript/document_module_script_fetcher.h" #include "third_party/blink/renderer/core/loader/modulescript/document_module_script_fetcher.h"
#include "third_party/blink/renderer/platform/bindings/script_state.h"
namespace blink { namespace blink {
...@@ -26,12 +22,4 @@ bool DocumentModulatorImpl::IsDynamicImportForbidden(String* reason) { ...@@ -26,12 +22,4 @@ bool DocumentModulatorImpl::IsDynamicImportForbidden(String* reason) {
return false; return false;
} }
mojom::blink::V8CacheOptions DocumentModulatorImpl::GetV8CacheOptions() const {
LocalDOMWindow* window = To<LocalDOMWindow>(GetExecutionContext());
const Settings* settings = window->GetFrame()->GetSettings();
if (settings)
return settings->GetV8CacheOptions();
return mojom::blink::V8CacheOptions::kDefault;
}
} // namespace blink } // namespace blink
...@@ -31,7 +31,6 @@ class DocumentModulatorImpl final : public ModulatorImplBase { ...@@ -31,7 +31,6 @@ class DocumentModulatorImpl final : public ModulatorImplBase {
private: private:
// Implements ModulatorImplBase. // Implements ModulatorImplBase.
bool IsDynamicImportForbidden(String* reason) override; bool IsDynamicImportForbidden(String* reason) override;
mojom::blink::V8CacheOptions GetV8CacheOptions() const override;
}; };
} // namespace blink } // namespace blink
......
...@@ -57,6 +57,10 @@ bool ModulatorImplBase::ImportMapsEnabled() const { ...@@ -57,6 +57,10 @@ bool ModulatorImplBase::ImportMapsEnabled() const {
return RuntimeEnabledFeatures::ImportMapsEnabled(GetExecutionContext()); return RuntimeEnabledFeatures::ImportMapsEnabled(GetExecutionContext());
} }
mojom::blink::V8CacheOptions ModulatorImplBase::GetV8CacheOptions() const {
return GetExecutionContext()->GetV8CacheOptions();
}
// <specdef label="fetch-a-module-script-tree" // <specdef label="fetch-a-module-script-tree"
// href="https://html.spec.whatwg.org/C/#fetch-a-module-script-tree"> // href="https://html.spec.whatwg.org/C/#fetch-a-module-script-tree">
// <specdef label="fetch-a-module-worker-script-tree" // <specdef label="fetch-a-module-worker-script-tree"
......
...@@ -44,6 +44,8 @@ class ModulatorImplBase : public Modulator { ...@@ -44,6 +44,8 @@ class ModulatorImplBase : public Modulator {
bool ImportMapsEnabled() const override; bool ImportMapsEnabled() const override;
mojom::blink::V8CacheOptions GetV8CacheOptions() const final;
ModuleRecordResolver* GetModuleRecordResolver() override { ModuleRecordResolver* GetModuleRecordResolver() override {
return module_record_resolver_.Get(); return module_record_resolver_.Get();
} }
......
...@@ -4,12 +4,10 @@ ...@@ -4,12 +4,10 @@
#include "third_party/blink/renderer/core/script/worker_modulator_impl.h" #include "third_party/blink/renderer/core/script/worker_modulator_impl.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h"
#include "third_party/blink/renderer/core/loader/modulescript/document_module_script_fetcher.h" #include "third_party/blink/renderer/core/loader/modulescript/document_module_script_fetcher.h"
#include "third_party/blink/renderer/core/loader/modulescript/installed_service_worker_module_script_fetcher.h" #include "third_party/blink/renderer/core/loader/modulescript/installed_service_worker_module_script_fetcher.h"
#include "third_party/blink/renderer/core/loader/modulescript/worker_module_script_fetcher.h" #include "third_party/blink/renderer/core/loader/modulescript/worker_module_script_fetcher.h"
#include "third_party/blink/renderer/core/workers/worker_global_scope.h" #include "third_party/blink/renderer/core/workers/worker_global_scope.h"
#include "third_party/blink/renderer/platform/bindings/v8_throw_exception.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h" #include "third_party/blink/renderer/platform/runtime_enabled_features.h"
namespace blink { namespace blink {
...@@ -55,9 +53,4 @@ bool WorkerModulatorImpl::IsDynamicImportForbidden(String* reason) { ...@@ -55,9 +53,4 @@ bool WorkerModulatorImpl::IsDynamicImportForbidden(String* reason) {
return true; return true;
} }
mojom::blink::V8CacheOptions WorkerModulatorImpl::GetV8CacheOptions() const {
auto* scope = To<WorkerGlobalScope>(GetExecutionContext());
return scope->GetV8CacheOptions();
}
} // namespace blink } // namespace blink
...@@ -27,7 +27,6 @@ class WorkerModulatorImpl final : public ModulatorImplBase { ...@@ -27,7 +27,6 @@ class WorkerModulatorImpl final : public ModulatorImplBase {
private: private:
// Implements ModulatorImplBase. // Implements ModulatorImplBase.
bool IsDynamicImportForbidden(String* reason) override; bool IsDynamicImportForbidden(String* reason) override;
mojom::blink::V8CacheOptions GetV8CacheOptions() const override;
}; };
} // namespace blink } // namespace blink
......
...@@ -27,9 +27,4 @@ bool WorkletModulatorImpl::IsDynamicImportForbidden(String* reason) { ...@@ -27,9 +27,4 @@ bool WorkletModulatorImpl::IsDynamicImportForbidden(String* reason) {
return true; return true;
} }
mojom::blink::V8CacheOptions WorkletModulatorImpl::GetV8CacheOptions() const {
auto* scope = To<WorkletGlobalScope>(GetExecutionContext());
return scope->GetV8CacheOptions();
}
} // namespace blink } // namespace blink
...@@ -29,7 +29,6 @@ class WorkletModulatorImpl final : public ModulatorImplBase { ...@@ -29,7 +29,6 @@ class WorkletModulatorImpl final : public ModulatorImplBase {
private: private:
// Implements ModulatorImplBase. // Implements ModulatorImplBase.
bool IsDynamicImportForbidden(String* reason) override; bool IsDynamicImportForbidden(String* reason) override;
mojom::blink::V8CacheOptions GetV8CacheOptions() const override;
}; };
} // namespace blink } // namespace blink
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment