Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(216)

Unified Diff: third_party/WebKit/Source/bindings/tests/results/core/ConditionalFeaturesForCore.cpp

Issue 2970003002: Add code generation for ConditionalFeatures bindings code (Closed)
Patch Set: Readability fixes Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/tests/results/core/ConditionalFeaturesForCore.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/ConditionalFeaturesForCore.cpp b/third_party/WebKit/Source/bindings/tests/results/core/ConditionalFeaturesForCore.cpp
similarity index 65%
rename from third_party/WebKit/Source/bindings/core/v8/ConditionalFeaturesForCore.cpp
rename to third_party/WebKit/Source/bindings/tests/results/core/ConditionalFeaturesForCore.cpp
index 986b764e20eb7f68c5a8b279fbf66de4a18c7311..4f2a9b197319d3298c45a2247ae6f709374a8c50 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ConditionalFeaturesForCore.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/ConditionalFeaturesForCore.cpp
@@ -1,12 +1,18 @@
-// Copyright 2017 The Chromium Authors. All rights reserved.
+// Copyright 2014 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.
+// This file has been auto-generated by generate_conditional_features.py.
+// DO NOT MODIFY!
+
+// This file has been generated from the Jinja2 template in
+// third_party/WebKit/Source/bindings/templates/ConditionalFeaturesForCore.cpp.tmpl
+
+// clang-format off
+
#include "bindings/core/v8/ConditionalFeaturesForCore.h"
-#include "bindings/core/v8/V8Document.h"
-#include "bindings/core/v8/V8HTMLLinkElement.h"
-#include "bindings/core/v8/V8Navigator.h"
+#include "bindings/core/v8/V8TestObject.h"
#include "bindings/core/v8/V8Window.h"
#include "core/context_features/ContextFeatureSettings.h"
#include "core/dom/ExecutionContext.h"
@@ -24,21 +30,21 @@ InstallPendingConditionalFeatureFunction
g_old_install_pending_conditional_feature_function = nullptr;
}
-void InstallConditionalFeaturesCore(const WrapperTypeInfo* wrapper_type_info,
- const ScriptState* script_state,
- v8::Local<v8::Object> prototype_object,
- v8::Local<v8::Function> interface_object) {
+void InstallConditionalFeaturesForCore(
+ const WrapperTypeInfo* wrapper_type_info,
+ const ScriptState* script_state,
+ v8::Local<v8::Object> prototype_object,
+ v8::Local<v8::Function> interface_object) {
(*g_old_install_conditional_features_function)(
wrapper_type_info, script_state, prototype_object, interface_object);
- // TODO(iclelland): Generate all of this logic at compile-time, based on the
- // configuration of origin trial enabled attributes and interfaces in IDL
- // files. (crbug.com/615060)
ExecutionContext* execution_context = ExecutionContext::From(script_state);
if (!execution_context)
return;
v8::Isolate* isolate = script_state->GetIsolate();
const DOMWrapperWorld& world = script_state->World();
+ // TODO(iclelland): Unify ContextFeatureSettings with the rest of the
+ // conditional features.
if (wrapper_type_info == &V8Window::wrapperTypeInfo) {
auto* settings = ContextFeatureSettings::From(
execution_context,
@@ -49,34 +55,33 @@ void InstallConditionalFeaturesCore(const WrapperTypeInfo* wrapper_type_info,
V8Window::installMojoJS(isolate, world, instance_object, prototype_object,
interface_object);
}
- } else if (wrapper_type_info == &V8HTMLLinkElement::wrapperTypeInfo) {
- if (OriginTrials::linkServiceWorkerEnabled(execution_context)) {
- V8HTMLLinkElement::installLinkServiceWorker(
- isolate, world, v8::Local<v8::Object>(), prototype_object,
- interface_object);
+ }
+ // TODO(iclelland): Extract this common code out of ConditionalFeaturesForCore
+ // and ConditionalFeaturesForModules into a block.
+ if (wrapper_type_info == &V8TestObject::wrapperTypeInfo) {
+ if (OriginTrials::featureNameEnabled(execution_context)) {
+ V8TestObject::installFeatureName(
+ isolate, world, v8::Local<v8::Object>(), prototype_object, interface_object);
}
}
}
-void InstallPendingConditionalFeatureCore(const String& feature,
- const ScriptState* script_state) {
+void InstallPendingConditionalFeatureForCore(const String& feature,
+ const ScriptState* script_state) {
(*g_old_install_pending_conditional_feature_function)(feature, script_state);
- // TODO(iclelland): Generate all of this logic at compile-time, based on the
- // configuration of origin trial enabled attributes and interfaces in IDL
- // files. (crbug.com/615060)
+ // TODO(iclelland): Extract this common code out of ConditionalFeaturesForCore
+ // and ConditionalFeaturesForModules into a block.
v8::Local<v8::Object> prototype_object;
v8::Local<v8::Function> interface_object;
v8::Isolate* isolate = script_state->GetIsolate();
const DOMWrapperWorld& world = script_state->World();
V8PerContextData* context_data = script_state->PerContextData();
- if (feature == "ForeignFetch") {
+ if (feature == "FeatureName") {
if (context_data->GetExistingConstructorAndPrototypeForType(
- &V8HTMLLinkElement::wrapperTypeInfo, &prototype_object,
- &interface_object)) {
- V8HTMLLinkElement::installLinkServiceWorker(
- isolate, world, v8::Local<v8::Object>(), prototype_object,
- interface_object);
+ &V8TestObject::wrapperTypeInfo, &prototype_object, &interface_object)) {
+ V8TestObject::installFeatureName(
+ isolate, world, v8::Local<v8::Object>(), prototype_object, interface_object);
}
return;
}
@@ -95,10 +100,10 @@ void InstallConditionalFeaturesOnWindow(const ScriptState* script_state) {
void RegisterInstallConditionalFeaturesForCore() {
g_old_install_conditional_features_function =
- SetInstallConditionalFeaturesFunction(&InstallConditionalFeaturesCore);
+ SetInstallConditionalFeaturesFunction(&InstallConditionalFeaturesForCore);
g_old_install_pending_conditional_feature_function =
SetInstallPendingConditionalFeatureFunction(
- &InstallPendingConditionalFeatureCore);
+ &InstallPendingConditionalFeatureForCore);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698