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

Unified Diff: components/cronet/android/api/src/org/chromium/net/CronetEngine.java

Issue 1414053008: [Cronet] Replace setExperimentalQuicConnectionOptions with a more general API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Misha's comments Created 5 years, 2 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: components/cronet/android/api/src/org/chromium/net/CronetEngine.java
diff --git a/components/cronet/android/api/src/org/chromium/net/CronetEngine.java b/components/cronet/android/api/src/org/chromium/net/CronetEngine.java
index 9316a7c0e25e02ce30f26e93e09645620fe4e0a6..079cefa8ff4994003141eb0672bd2c8e53cc32d9 100644
--- a/components/cronet/android/api/src/org/chromium/net/CronetEngine.java
+++ b/components/cronet/android/api/src/org/chromium/net/CronetEngine.java
@@ -314,15 +314,34 @@ public abstract class CronetEngine {
}
/**
- * Sets experimental QUIC connection options, overwriting any pre-existing
- * options. List of options is subject to change.
+ * Sets experimental options to be used in Cronet.
*
- * @param quicConnectionOptions comma-separated QUIC options (for example
- * "PACE,IW10") to use if QUIC is enabled.
- * @return the builder to facilitate chaining.
+ * Experimental options encoded as a string in a JSON format containing
+ * experiments and their corresponding configuration options. The format
+ * is a JSON object with the name of the experiment as the key, and
+ * experiment options as the value; the experiment options for an
pauljensen 2015/10/30 18:05:23 change semicolon to period?
xunjieli 2015/10/30 18:30:57 Done.
+ * experiment is encoded as a JSON object with option name as the key
pauljensen 2015/10/30 18:05:23 remove "for an experiment"
pauljensen 2015/10/30 18:05:23 is->are
xunjieli 2015/10/30 18:30:57 Done.
xunjieli 2015/10/30 18:30:57 Done.
+ * and option value as the value:
+ * <pre>
+ * {"experiment1": {"option1": "option_value1", "option2":
+ * "option_value2", ...}, "experiment2: {"option3", "option_value3",
+ * ...}, ...}
+ * </pre>
+ * Here's an example to set QUIC connection options using this method:
pauljensen 2015/10/30 18:05:23 I don't think we want specific examples in our pub
xunjieli 2015/10/30 18:30:57 Done.
+ * <pre>
+ * {@code
+ * JSONObject quicParams = new JSONObject().put("connection_options",
+ * "PACE,IW10,FOO,DEADBEEF");
+ * JSONObject experimentalOptions = new JSONObject().put("QUIC",
+ * quicParams);
+ * builder.setExperimentalOptions(experimentalOptions.toString());
+ * }
+ * </pre>
+ * @param experimentalOptions experimental options as a JSON formatted
+ * string
*/
- public Builder setExperimentalQuicConnectionOptions(String quicConnectionOptions) {
- return putString(CronetEngineBuilderList.QUIC_OPTIONS, quicConnectionOptions);
+ public Builder setExperimentalOptions(String experimentalOptions) {
+ return putString(CronetEngineBuilderList.EXPERIMENTAL_OPTIONS, experimentalOptions);
}
/**

Powered by Google App Engine
This is Rietveld 408576698