Commit a19d7fc6 authored by Camillo Bruni's avatar Camillo Bruni Committed by Commit Bot

[features] Add kTopLevelAwait feature flag

The new feature flags enables top-level await for JavaScript modules.

TC39 proposal: https://github.com/tc39/proposal-top-level-await

Bug: 1022182, v8:9344
Change-Id: Icdba59e1b988c636b041d600e6c003bad2dd2f3a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2105375Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarKouhei Ueno <kouhei@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#750886}
parent c69a0d7c
...@@ -137,6 +137,7 @@ CONTENT_EXPORT extern const base::Feature kStorageServiceSandbox; ...@@ -137,6 +137,7 @@ CONTENT_EXPORT extern const base::Feature kStorageServiceSandbox;
CONTENT_EXPORT extern const base::Feature kStrictOriginIsolation; CONTENT_EXPORT extern const base::Feature kStrictOriginIsolation;
CONTENT_EXPORT extern const base::Feature kSyntheticPointerActions; CONTENT_EXPORT extern const base::Feature kSyntheticPointerActions;
CONTENT_EXPORT extern const base::Feature kTimerThrottlingForHiddenFrames; CONTENT_EXPORT extern const base::Feature kTimerThrottlingForHiddenFrames;
CONTENT_EXPORT extern const base::Feature kTopLevelAwait;
CONTENT_EXPORT extern const base::Feature kTouchpadAsyncPinchEvents; CONTENT_EXPORT extern const base::Feature kTouchpadAsyncPinchEvents;
CONTENT_EXPORT extern const base::Feature kTouchpadOverscrollHistoryNavigation; CONTENT_EXPORT extern const base::Feature kTouchpadOverscrollHistoryNavigation;
CONTENT_EXPORT extern const base::Feature kTrustedDOMTypes; CONTENT_EXPORT extern const base::Feature kTrustedDOMTypes;
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include "content/public/common/content_switches.h" #include "content/public/common/content_switches.h"
#include "content/public/renderer/content_renderer_client.h" #include "content/public/renderer/content_renderer_client.h"
#include "services/service_manager/embedder/switches.h" #include "services/service_manager/embedder/switches.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/web/web_frame.h" #include "third_party/blink/public/web/web_frame.h"
#include "v8/include/v8.h" #include "v8/include/v8.h"
...@@ -140,6 +141,9 @@ RenderProcessImpl::RenderProcessImpl() ...@@ -140,6 +141,9 @@ RenderProcessImpl::RenderProcessImpl()
SetV8FlagIfNotFeature(features::kWebAssemblySimd, SetV8FlagIfNotFeature(features::kWebAssemblySimd,
"--no-experimental-wasm-simd"); "--no-experimental-wasm-simd");
SetV8FlagIfFeature(blink::features::kTopLevelAwait,
"--harmony-top-level-await");
if (base::FeatureList::IsEnabled(features::kWebAssemblyThreads)) { if (base::FeatureList::IsEnabled(features::kWebAssemblyThreads)) {
constexpr char kFlags[] = constexpr char kFlags[] =
"--harmony-sharedarraybuffer " "--harmony-sharedarraybuffer "
......
...@@ -61,6 +61,10 @@ const base::Feature kDisplayLocking{"DisplayLocking", ...@@ -61,6 +61,10 @@ const base::Feature kDisplayLocking{"DisplayLocking",
const base::Feature kJSONModules{"JSONModules", const base::Feature kJSONModules{"JSONModules",
base::FEATURE_DISABLED_BY_DEFAULT}; base::FEATURE_DISABLED_BY_DEFAULT};
// Enables top-level await in modules.
const base::Feature kTopLevelAwait{"TopLevelAwait",
base::FEATURE_DISABLED_BY_DEFAULT};
// Enable LayoutNG. // Enable LayoutNG.
const base::Feature kLayoutNG{"LayoutNG", base::FEATURE_ENABLED_BY_DEFAULT}; const base::Feature kLayoutNG{"LayoutNG", base::FEATURE_ENABLED_BY_DEFAULT};
......
...@@ -31,6 +31,7 @@ BLINK_COMMON_EXPORT extern const base::Feature kDisplayLocking; ...@@ -31,6 +31,7 @@ BLINK_COMMON_EXPORT extern const base::Feature kDisplayLocking;
BLINK_COMMON_EXPORT extern const base::Feature BLINK_COMMON_EXPORT extern const base::Feature
kAssumeOverlapAfterFixedOrStickyPosition; kAssumeOverlapAfterFixedOrStickyPosition;
BLINK_COMMON_EXPORT extern const base::Feature kJSONModules; BLINK_COMMON_EXPORT extern const base::Feature kJSONModules;
BLINK_COMMON_EXPORT extern const base::Feature kTopLevelAwait;
BLINK_COMMON_EXPORT extern const base::Feature kLayoutNG; BLINK_COMMON_EXPORT extern const base::Feature kLayoutNG;
BLINK_COMMON_EXPORT extern const base::Feature kMixedContentAutoupgrade; BLINK_COMMON_EXPORT extern const base::Feature kMixedContentAutoupgrade;
BLINK_COMMON_EXPORT extern const base::Feature kNavigationPredictor; BLINK_COMMON_EXPORT extern const base::Feature kNavigationPredictor;
......
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