From 271a6c3487a14599023a9106329505597638d793 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 30 Aug 2019 10:22:43 +0200 Subject: BASELINE: Update Chromium to 77.0.3865.59 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I1e89a5f3b009a9519a6705102ad65c92fe736f21 Reviewed-by: Michael BrĂ¼ning --- .../script/value_wrapper_synthetic_module_script.h | 78 ++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 chromium/third_party/blink/renderer/core/script/value_wrapper_synthetic_module_script.h (limited to 'chromium/third_party/blink/renderer/core/script/value_wrapper_synthetic_module_script.h') diff --git a/chromium/third_party/blink/renderer/core/script/value_wrapper_synthetic_module_script.h b/chromium/third_party/blink/renderer/core/script/value_wrapper_synthetic_module_script.h new file mode 100644 index 00000000000..ae19c095cd9 --- /dev/null +++ b/chromium/third_party/blink/renderer/core/script/value_wrapper_synthetic_module_script.h @@ -0,0 +1,78 @@ +// Copyright 2019 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_SCRIPT_VALUE_WRAPPER_SYNTHETIC_MODULE_SCRIPT_H_ +#define THIRD_PARTY_BLINK_RENDERER_CORE_SCRIPT_VALUE_WRAPPER_SYNTHETIC_MODULE_SCRIPT_H_ + +#include "third_party/blink/renderer/core/core_export.h" +#include "third_party/blink/renderer/core/script/module_script.h" + +namespace WTF { +class TextPosition; +} // namespace WTF + +namespace blink { + +class KURL; +class Modulator; +class ModuleScriptCreationParams; + +// ValueWrapperSyntheticModuleScript is a module script +// (https://html.spec.whatwg.org/C/#module-script) that default-exports a single +// v8::Value, for example JSON Module Script: +// https://html.spec.whatwg.org/multipage/webappapis.html#json-module-script +class CORE_EXPORT ValueWrapperSyntheticModuleScript final + : public ModuleScript { + public: + static ValueWrapperSyntheticModuleScript* + CreateJSONWrapperSyntheticModuleScript( + const base::Optional& params, + Modulator* settings_object, + const ScriptFetchOptions options_); + + static ValueWrapperSyntheticModuleScript* CreateWithDefaultExport( + v8::Local value, + Modulator* settings_object, + const KURL& source_url, + const KURL& base_url, + const ScriptFetchOptions& fetch_options, + const TextPosition& start_position = TextPosition::MinimumPosition()); + + static ValueWrapperSyntheticModuleScript* CreateWithError( + v8::Local value, + Modulator* settings_object, + const KURL& source_url, + const KURL& base_url, + const ScriptFetchOptions& fetch_options, + v8::Local error, + const TextPosition& start_position = TextPosition::MinimumPosition()); + + ValueWrapperSyntheticModuleScript(Modulator* settings_object, + ModuleRecord record, + const KURL& source_url, + const KURL& base_url, + const ScriptFetchOptions& fetch_options, + v8::Local value, + const TextPosition& start_position); + + // + // An abstract operation that will be performed upon evaluation of the module, + // taking the Synthetic Module Record as its sole argument. These will usually + // set up the exported values, by using SetSyntheticModuleExport. They must + // not modify [[ExportNames]]. They may return an abrupt completion. + static v8::MaybeLocal EvaluationSteps( + v8::Local context, + v8::Local module); + + String InlineSourceTextForCSP() const override; + void Trace(blink::Visitor* visitor) override; + + private: + TraceWrapperV8Reference export_value_; +}; + +} // namespace blink + +#endif // THIRD_PARTY_BLINK_RENDERER_CORE_SCRIPT_VALUE_WRAPPER_SYNTHETIC_MODULE_SCRIPT_H_ \ No newline at end of file -- cgit v1.2.1