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

Unified Diff: third_party/WebKit/Source/bindings/scripts/v8_utilities.py

Issue 2620153004: [Bindings] Code cleanup: Early return if funtime enabled interface is false (Closed)
Patch Set: . Created 3 years, 11 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/scripts/v8_utilities.py
diff --git a/third_party/WebKit/Source/bindings/scripts/v8_utilities.py b/third_party/WebKit/Source/bindings/scripts/v8_utilities.py
index 4fb4ea4802657d1cb2aa4ca52c496aa872abab8b..a0da30569c88cac1334d7601ffb600fb033346f6 100644
--- a/third_party/WebKit/Source/bindings/scripts/v8_utilities.py
+++ b/third_party/WebKit/Source/bindings/scripts/v8_utilities.py
@@ -112,6 +112,11 @@ def uncapitalize(name):
return name[0].lower() + name[1:]
+def runtime_enabled_function(name):
Yuki 2017/01/13 02:38:37 I'm uneasy with this name because "runtime enabled
peria 2017/01/13 05:54:26 I'll make a follow up CL. But I think the prefix "
+ """Returns a function call of a runtime enabled feature."""
+ return 'RuntimeEnabledFeatures::%sEnabled()' % uncapitalize(name)
+
+
def unique_by(dict_list, key):
"""Returns elements from a list of dictionaries with unique values for the named key."""
keys_seen = set()
@@ -294,8 +299,7 @@ class ExposureSet:
exposed = ('executionContext->%s()' %
EXPOSED_EXECUTION_CONTEXT_METHOD[exposure.exposed])
if exposure.runtime_enabled is not None:
- runtime_enabled = ('RuntimeEnabledFeatures::%sEnabled()' %
- uncapitalize(exposure.runtime_enabled))
+ runtime_enabled = (runtime_enabled_function(exposure.runtime_enabled))
return '({0} && {1})'.format(exposed, runtime_enabled)
return exposed

Powered by Google App Engine
This is Rietveld 408576698