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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/net/spdyproxy/DataReductionProxySettings.java

Issue 30883003: Simple fallback implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@patched
Patch Set: Updated javadocs. Created 7 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
« no previous file with comments | « no previous file | chrome/android/testshell/chrome_data_reduction_proxy_testshell_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/net/spdyproxy/DataReductionProxySettings.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/net/spdyproxy/DataReductionProxySettings.java b/chrome/android/java/src/org/chromium/chrome/browser/net/spdyproxy/DataReductionProxySettings.java
index d378b5d9e34e868f9b8ab9bd59c7d364a8b6cc40..d01b171f33c06cc63e95d6539ab4e162dc38c1ea 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/net/spdyproxy/DataReductionProxySettings.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/net/spdyproxy/DataReductionProxySettings.java
@@ -98,13 +98,6 @@ public class DataReductionProxySettings {
}
/**
- * Returns a configuration string for the data reduction proxy.
- */
- public String getDataReductionProxyAuth() {
- return nativeGetDataReductionProxyAuth(mNativeDataReductionProxySettings);
- }
-
- /**
* Sets the preference on whether to enable/disable the SPDY proxy. This will zero out the
* data reduction statistics if this is the first time the SPDY proxy has been enabled.
*/
@@ -139,6 +132,30 @@ public class DataReductionProxySettings {
}
/**
+ * Returns true if the host and realm (as passed in to Tab.onReceivedHttpAuthRequest()) are such
+ * that a authentication token can be generated. The host must match one of the configured proxy
+ * hosts, and the realm must be prefixed with the authentication realm string used by the data
+ * reduction proxies.
+ * @param host The host requesting authentication.
+ * @param realm The authentication realm.
+ * @return True if host and realm can be authenticated.
+ */
+ public boolean isAcceptableAuthChallenge(String host, String realm) {
+ return nativeIsAcceptableAuthChallenge(mNativeDataReductionProxySettings, host, realm);
+ }
+
+ /**
+ * Returns an authentication token for the data reduction proxy. If the token cannot be
+ * generated, an empty string is returned.
+ * @param host The host requesting authentication.
+ * @param realm The authentication realm.
+ * @return The generated token.
+ */
+ public String getTokenForAuthChallenge(String host, String realm) {
+ return nativeGetTokenForAuthChallenge(mNativeDataReductionProxySettings, host, realm);
+ }
+
+ /**
* Retrieves the history of daily totals of bytes that would have been
* received if no data reducing mechanism had been applied.
* @return The history of daily totals
@@ -183,8 +200,6 @@ public class DataReductionProxySettings {
int nativeDataReductionProxySettingsAndroid);
private native String nativeGetDataReductionProxyOrigin(
int nativeDataReductionProxySettingsAndroid);
- private native String nativeGetDataReductionProxyAuth(
- int nativeDataReductionProxySettingsAndroid);
private native boolean nativeIsDataReductionProxyEnabled(
int nativeDataReductionProxySettingsAndroid);
private native boolean nativeIsDataReductionProxyManaged(
@@ -195,6 +210,10 @@ public class DataReductionProxySettings {
int nativeDataReductionProxySettingsAndroid);
private native ContentLengths nativeGetContentLengths(
int nativeDataReductionProxySettingsAndroid);
+ private native boolean nativeIsAcceptableAuthChallenge(
+ int nativeDataReductionProxySettingsAndroid, String host, String realm);
+ private native String nativeGetTokenForAuthChallenge(
+ int nativeDataReductionProxySettingsAndroid, String host, String realm);
private native long[] nativeGetDailyOriginalContentLengths(
int nativeDataReductionProxySettingsAndroid);
private native long[] nativeGetDailyReceivedContentLengths(
« no previous file with comments | « no previous file | chrome/android/testshell/chrome_data_reduction_proxy_testshell_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698