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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ContentFeatureList.java

Issue 2755673005: [Android] Trigger native event batching through Feature API (Closed)
Patch Set: Address isherman@'s comments: Fix nits Created 3 years, 9 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: content/public/android/java/src/org/chromium/content/browser/ContentFeatureList.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentFeatureList.java b/content/public/android/java/src/org/chromium/content/browser/ContentFeatureList.java
new file mode 100644
index 0000000000000000000000000000000000000000..cd7d04f4dce6020d5f7de5e4cbff924d4662a063
--- /dev/null
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentFeatureList.java
@@ -0,0 +1,36 @@
+// Copyright 2017 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.
+
+package org.chromium.content.browser;
+
+import org.chromium.base.annotations.JNINamespace;
+import org.chromium.base.annotations.MainDex;
+
+/**
+ * Java accessor for base/feature_list.h state.
+ */
+@JNINamespace("content::android")
+@MainDex
+public class ContentFeatureList {
Ilya Sherman 2017/03/16 17:38:53 Hmm, why did you remove "abstract" here? Should i
chongz 2017/03/16 18:54:04 I'm not an expert on Java but I don't feel that we
Ilya Sherman 2017/03/16 18:59:12 Okay. I suspect it was to help ensure that nobody
chongz 2017/03/16 19:16:54 Oh I see, that sounds reasonable. Anyway I've adde
+ // Prevent instantiation.
+ private ContentFeatureList() {}
+
+ /**
+ * Returns whether the specified feature is enabled or not.
+ *
+ * Note: Features queried through this API must be added to the array
+ * |kFeaturesExposedToJava| in content/browser/android/content_feature_list.cc
+ *
+ * @param featureName The name of the feature to query.
+ * @return Whether the feature is enabled or not.
+ */
+ public static boolean isEnabled(String featureName) {
+ return nativeIsEnabled(featureName);
+ }
+
+ // Alphabetical:
+ public static final String REQUEST_UNBUFFERED_DISPATCH = "RequestUnbufferedDispatch";
+
+ private static native boolean nativeIsEnabled(String featureName);
+}

Powered by Google App Engine
This is Rietveld 408576698