diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-08-30 10:22:43 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-08-30 12:36:28 +0000 |
commit | 271a6c3487a14599023a9106329505597638d793 (patch) | |
tree | e040d58ffc86c1480b79ca8528020ca9ec919bf8 /chromium/third_party/blink/renderer/core/script/value_wrapper_synthetic_module_script.h | |
parent | 7b2ffa587235a47d4094787d72f38102089f402a (diff) | |
download | qtwebengine-chromium-271a6c3487a14599023a9106329505597638d793.tar.gz |
BASELINE: Update Chromium to 77.0.3865.59
Change-Id: I1e89a5f3b009a9519a6705102ad65c92fe736f21
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/third_party/blink/renderer/core/script/value_wrapper_synthetic_module_script.h')
-rw-r--r-- | chromium/third_party/blink/renderer/core/script/value_wrapper_synthetic_module_script.h | 78 |
1 files changed, 78 insertions, 0 deletions
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<ModuleScriptCreationParams>& params, + Modulator* settings_object, + const ScriptFetchOptions options_); + + static ValueWrapperSyntheticModuleScript* CreateWithDefaultExport( + v8::Local<v8::Value> 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<v8::Value> value, + Modulator* settings_object, + const KURL& source_url, + const KURL& base_url, + const ScriptFetchOptions& fetch_options, + v8::Local<v8::Value> 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<v8::Value> value, + const TextPosition& start_position); + + // <specdef + // href="https://heycam.github.io/webidl/#synthetic-module-record"> + // 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<v8::Value> EvaluationSteps( + v8::Local<v8::Context> context, + v8::Local<v8::Module> module); + + String InlineSourceTextForCSP() const override; + void Trace(blink::Visitor* visitor) override; + + private: + TraceWrapperV8Reference<v8::Value> export_value_; +}; + +} // namespace blink + +#endif // THIRD_PARTY_BLINK_RENDERER_CORE_SCRIPT_VALUE_WRAPPER_SYNTHETIC_MODULE_SCRIPT_H_
\ No newline at end of file |