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

Side by Side 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: Unit tests passing, feedback applied. 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.chrome.browser.net.spdyproxy; 5 package org.chromium.chrome.browser.net.spdyproxy;
6 6
7 import org.chromium.base.CalledByNative; 7 import org.chromium.base.CalledByNative;
8 import org.chromium.base.ThreadUtils; 8 import org.chromium.base.ThreadUtils;
9 9
10 public class DataReductionProxySettings { 10 public class DataReductionProxySettings {
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 } 91 }
92 92
93 /** 93 /**
94 * Returns the current data reduction proxy origin. 94 * Returns the current data reduction proxy origin.
95 */ 95 */
96 public String getDataReductionProxyOrigin() { 96 public String getDataReductionProxyOrigin() {
97 return nativeGetDataReductionProxyOrigin(mNativeDataReductionProxySettin gs); 97 return nativeGetDataReductionProxyOrigin(mNativeDataReductionProxySettin gs);
98 } 98 }
99 99
100 /** 100 /**
101 * Returns a configuration string for the data reduction proxy.
102 */
103 public String getDataReductionProxyAuth() {
104 return nativeGetDataReductionProxyAuth(mNativeDataReductionProxySettings );
105 }
106
107 /**
108 * Sets the preference on whether to enable/disable the SPDY proxy. This wil l zero out the 101 * Sets the preference on whether to enable/disable the SPDY proxy. This wil l zero out the
109 * data reduction statistics if this is the first time the SPDY proxy has be en enabled. 102 * data reduction statistics if this is the first time the SPDY proxy has be en enabled.
110 */ 103 */
111 public void setDataReductionProxyEnabled(boolean enabled) { 104 public void setDataReductionProxyEnabled(boolean enabled) {
112 nativeSetDataReductionProxyEnabled(mNativeDataReductionProxySettings, en abled); 105 nativeSetDataReductionProxyEnabled(mNativeDataReductionProxySettings, en abled);
113 } 106 }
114 107
115 /** Returns true if the SPDY proxy is enabled. */ 108 /** Returns true if the SPDY proxy is enabled. */
116 public boolean isDataReductionProxyEnabled() { 109 public boolean isDataReductionProxyEnabled() {
117 return nativeIsDataReductionProxyEnabled(mNativeDataReductionProxySettin gs); 110 return nativeIsDataReductionProxyEnabled(mNativeDataReductionProxySettin gs);
(...skipping 14 matching lines...) Expand all
132 125
133 /** 126 /**
134 * Returns aggregate original and received content lengths. 127 * Returns aggregate original and received content lengths.
135 * @return The content lengths. 128 * @return The content lengths.
136 */ 129 */
137 public ContentLengths getContentLengths() { 130 public ContentLengths getContentLengths() {
138 return nativeGetContentLengths(mNativeDataReductionProxySettings); 131 return nativeGetContentLengths(mNativeDataReductionProxySettings);
139 } 132 }
140 133
141 /** 134 /**
135 * Returns true if the host and realm describe an appropriate authentication challenge
bengr 2013/10/22 17:49:30 I don't know what this comment means. Please clari
marq (ping after 24h) 2013/10/22 21:18:01 Done.
136 * for the data reduction proxy.
137 */
138 public boolean isAcceptableAuthChallenge(String host, String realm) {
bengr 2013/10/22 17:49:30 What makes it an appropriate challenge?
marq (ping after 24h) 2013/10/22 21:18:01 Done.
139 return nativeIsAcceptableAuthChallenge(mNativeDataReductionProxySettings , host, realm);
140 }
141
142 /**
143 * Returns a string suitable for sending back to the data reduction proxy se rver to act as an
bengr 2013/10/22 17:49:30 Returns an authentication token for the data reduc
marq (ping after 24h) 2013/10/22 21:18:01 Done.
144 * authentication token. If the token cannot be generated, an empty string i s returned.
145 * @return The generated token.
146 */
147 public String getTokenForAuthChallenge(String host, String realm) {
148 return nativeGetTokenForAuthChallenge(mNativeDataReductionProxySettings, host, realm);
149 }
150
151 /**
142 * Retrieves the history of daily totals of bytes that would have been 152 * Retrieves the history of daily totals of bytes that would have been
143 * received if no data reducing mechanism had been applied. 153 * received if no data reducing mechanism had been applied.
144 * @return The history of daily totals 154 * @return The history of daily totals
145 */ 155 */
146 public long[] getOriginalNetworkStatsHistory() { 156 public long[] getOriginalNetworkStatsHistory() {
147 return nativeGetDailyOriginalContentLengths(mNativeDataReductionProxySet tings); 157 return nativeGetDailyOriginalContentLengths(mNativeDataReductionProxySet tings);
148 } 158 }
149 159
150 /** 160 /**
151 * Retrieves the history of daily totals of bytes that were received after 161 * Retrieves the history of daily totals of bytes that were received after
(...skipping 24 matching lines...) Expand all
176 private native void nativeBypassHostPattern( 186 private native void nativeBypassHostPattern(
177 int nativeDataReductionProxySettingsAndroid, String pattern); 187 int nativeDataReductionProxySettingsAndroid, String pattern);
178 private native void nativeBypassURLPattern( 188 private native void nativeBypassURLPattern(
179 int nativeDataReductionProxySettingsAndroid, String pattern); 189 int nativeDataReductionProxySettingsAndroid, String pattern);
180 private native boolean nativeIsDataReductionProxyAllowed( 190 private native boolean nativeIsDataReductionProxyAllowed(
181 int nativeDataReductionProxySettingsAndroid); 191 int nativeDataReductionProxySettingsAndroid);
182 private native boolean nativeIsDataReductionProxyPromoAllowed( 192 private native boolean nativeIsDataReductionProxyPromoAllowed(
183 int nativeDataReductionProxySettingsAndroid); 193 int nativeDataReductionProxySettingsAndroid);
184 private native String nativeGetDataReductionProxyOrigin( 194 private native String nativeGetDataReductionProxyOrigin(
185 int nativeDataReductionProxySettingsAndroid); 195 int nativeDataReductionProxySettingsAndroid);
186 private native String nativeGetDataReductionProxyAuth(
187 int nativeDataReductionProxySettingsAndroid);
188 private native boolean nativeIsDataReductionProxyEnabled( 196 private native boolean nativeIsDataReductionProxyEnabled(
189 int nativeDataReductionProxySettingsAndroid); 197 int nativeDataReductionProxySettingsAndroid);
190 private native boolean nativeIsDataReductionProxyManaged( 198 private native boolean nativeIsDataReductionProxyManaged(
191 int nativeDataReductionProxySettingsAndroid); 199 int nativeDataReductionProxySettingsAndroid);
192 private native void nativeSetDataReductionProxyEnabled( 200 private native void nativeSetDataReductionProxyEnabled(
193 int nativeDataReductionProxySettingsAndroid, boolean enabled); 201 int nativeDataReductionProxySettingsAndroid, boolean enabled);
194 private native long nativeGetDataReductionLastUpdateTime( 202 private native long nativeGetDataReductionLastUpdateTime(
195 int nativeDataReductionProxySettingsAndroid); 203 int nativeDataReductionProxySettingsAndroid);
196 private native ContentLengths nativeGetContentLengths( 204 private native ContentLengths nativeGetContentLengths(
197 int nativeDataReductionProxySettingsAndroid); 205 int nativeDataReductionProxySettingsAndroid);
206 private native boolean nativeIsAcceptableAuthChallenge(
207 int nativeDataReductionProxySettingsAndroid, String host, String rea lm);
208 private native String nativeGetTokenForAuthChallenge(
209 int nativeDataReductionProxySettingsAndroid, String host, String rea lm);
198 private native long[] nativeGetDailyOriginalContentLengths( 210 private native long[] nativeGetDailyOriginalContentLengths(
199 int nativeDataReductionProxySettingsAndroid); 211 int nativeDataReductionProxySettingsAndroid);
200 private native long[] nativeGetDailyReceivedContentLengths( 212 private native long[] nativeGetDailyReceivedContentLengths(
201 int nativeDataReductionProxySettingsAndroid); 213 int nativeDataReductionProxySettingsAndroid);
202 } 214 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698