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

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

Issue 544223003: Add SetSupportsQuic method to explicitly specify server that supports QUIC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added QUIC hints to HttpUrlRequestFactoryConfig. Created 6 years, 3 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/java/src/org/chromium/net/ChromiumUrlRequestContext.java
diff --git a/components/cronet/android/java/src/org/chromium/net/ChromiumUrlRequestContext.java b/components/cronet/android/java/src/org/chromium/net/ChromiumUrlRequestContext.java
index d5a5c9b4e8c7dfffbeae5c680816d082ee2accce..b67cc20cec61bdbdd74b2d05034d86258e2e7d63 100644
--- a/components/cronet/android/java/src/org/chromium/net/ChromiumUrlRequestContext.java
+++ b/components/cronet/android/java/src/org/chromium/net/ChromiumUrlRequestContext.java
@@ -86,6 +86,20 @@ public class ChromiumUrlRequestContext {
nativeStopNetLog(mChromiumUrlRequestContextAdapter);
}
+ /**
+ * Explicitly mark |server| as supporting QUIC.
+ * Note that DISK CACHE must be enabled to take advantage or 0RTT QUIC.
+ *
+ * @param server URL of the server that supports QUIC
+ * @param alternatePort to use for QUIC
+ */
+ public void setQuicHint(String server, int alternatePort) {
+ if (!nativeSetQuicHint(mChromiumUrlRequestContextAdapter, server,
+ alternatePort)) {
+ throw new IllegalArgumentException("Invalid server URL: " + server);
+ }
+ }
+
@CalledByNative
private void initNetworkThread() {
Thread.currentThread().setName("ChromiumNet");
@@ -125,14 +139,18 @@ public class ChromiumUrlRequestContext {
String userAgent, int loggingLevel, String config);
private native void nativeReleaseRequestContextAdapter(
- long ChromiumUrlRequestContextAdapter);
+ long chromiumUrlRequestContextAdapter);
private native void nativeInitializeStatistics();
private native String nativeGetStatisticsJSON(String filter);
private native void nativeStartNetLogToFile(
- long ChromiumUrlRequestContextAdapter, String fileName);
+ long chromiumUrlRequestContextAdapter, String fileName);
+
+ private native void nativeStopNetLog(long chromiumUrlRequestContextAdapter);
- private native void nativeStopNetLog(long ChromiumUrlRequestContextAdapter);
+ private native boolean nativeSetQuicHint(
+ long chromiumUrlRequestContextAdapter, String server,
+ int alternatePort);
}

Powered by Google App Engine
This is Rietveld 408576698