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

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: Updated javadocs. Created 7 years, 1 month 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
« no previous file with comments | « no previous file | chrome/android/testshell/chrome_data_reduction_proxy_testshell_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 (as passed in to Tab.onReceivedHttpAut hRequest()) are such
136 * that a authentication token can be generated. The host must match one of the configured proxy
137 * hosts, and the realm must be prefixed with the authentication realm strin g used by the data
138 * reduction proxies.
139 * @param host The host requesting authentication.
140 * @param realm The authentication realm.
141 * @return True if host and realm can be authenticated.
142 */
143 public boolean isAcceptableAuthChallenge(String host, String realm) {
144 return nativeIsAcceptableAuthChallenge(mNativeDataReductionProxySettings , host, realm);
145 }
146
147 /**
148 * Returns an authentication token for the data reduction proxy. If the toke n cannot be
149 * generated, an empty string is returned.
150 * @param host The host requesting authentication.
151 * @param realm The authentication realm.
152 * @return The generated token.
153 */
154 public String getTokenForAuthChallenge(String host, String realm) {
155 return nativeGetTokenForAuthChallenge(mNativeDataReductionProxySettings, host, realm);
156 }
157
158 /**
142 * Retrieves the history of daily totals of bytes that would have been 159 * Retrieves the history of daily totals of bytes that would have been
143 * received if no data reducing mechanism had been applied. 160 * received if no data reducing mechanism had been applied.
144 * @return The history of daily totals 161 * @return The history of daily totals
145 */ 162 */
146 public long[] getOriginalNetworkStatsHistory() { 163 public long[] getOriginalNetworkStatsHistory() {
147 return nativeGetDailyOriginalContentLengths(mNativeDataReductionProxySet tings); 164 return nativeGetDailyOriginalContentLengths(mNativeDataReductionProxySet tings);
148 } 165 }
149 166
150 /** 167 /**
151 * Retrieves the history of daily totals of bytes that were received after 168 * Retrieves the history of daily totals of bytes that were received after
(...skipping 24 matching lines...) Expand all
176 private native void nativeBypassHostPattern( 193 private native void nativeBypassHostPattern(
177 int nativeDataReductionProxySettingsAndroid, String pattern); 194 int nativeDataReductionProxySettingsAndroid, String pattern);
178 private native void nativeBypassURLPattern( 195 private native void nativeBypassURLPattern(
179 int nativeDataReductionProxySettingsAndroid, String pattern); 196 int nativeDataReductionProxySettingsAndroid, String pattern);
180 private native boolean nativeIsDataReductionProxyAllowed( 197 private native boolean nativeIsDataReductionProxyAllowed(
181 int nativeDataReductionProxySettingsAndroid); 198 int nativeDataReductionProxySettingsAndroid);
182 private native boolean nativeIsDataReductionProxyPromoAllowed( 199 private native boolean nativeIsDataReductionProxyPromoAllowed(
183 int nativeDataReductionProxySettingsAndroid); 200 int nativeDataReductionProxySettingsAndroid);
184 private native String nativeGetDataReductionProxyOrigin( 201 private native String nativeGetDataReductionProxyOrigin(
185 int nativeDataReductionProxySettingsAndroid); 202 int nativeDataReductionProxySettingsAndroid);
186 private native String nativeGetDataReductionProxyAuth(
187 int nativeDataReductionProxySettingsAndroid);
188 private native boolean nativeIsDataReductionProxyEnabled( 203 private native boolean nativeIsDataReductionProxyEnabled(
189 int nativeDataReductionProxySettingsAndroid); 204 int nativeDataReductionProxySettingsAndroid);
190 private native boolean nativeIsDataReductionProxyManaged( 205 private native boolean nativeIsDataReductionProxyManaged(
191 int nativeDataReductionProxySettingsAndroid); 206 int nativeDataReductionProxySettingsAndroid);
192 private native void nativeSetDataReductionProxyEnabled( 207 private native void nativeSetDataReductionProxyEnabled(
193 int nativeDataReductionProxySettingsAndroid, boolean enabled); 208 int nativeDataReductionProxySettingsAndroid, boolean enabled);
194 private native long nativeGetDataReductionLastUpdateTime( 209 private native long nativeGetDataReductionLastUpdateTime(
195 int nativeDataReductionProxySettingsAndroid); 210 int nativeDataReductionProxySettingsAndroid);
196 private native ContentLengths nativeGetContentLengths( 211 private native ContentLengths nativeGetContentLengths(
197 int nativeDataReductionProxySettingsAndroid); 212 int nativeDataReductionProxySettingsAndroid);
213 private native boolean nativeIsAcceptableAuthChallenge(
214 int nativeDataReductionProxySettingsAndroid, String host, String rea lm);
215 private native String nativeGetTokenForAuthChallenge(
216 int nativeDataReductionProxySettingsAndroid, String host, String rea lm);
198 private native long[] nativeGetDailyOriginalContentLengths( 217 private native long[] nativeGetDailyOriginalContentLengths(
199 int nativeDataReductionProxySettingsAndroid); 218 int nativeDataReductionProxySettingsAndroid);
200 private native long[] nativeGetDailyReceivedContentLengths( 219 private native long[] nativeGetDailyReceivedContentLengths(
201 int nativeDataReductionProxySettingsAndroid); 220 int nativeDataReductionProxySettingsAndroid);
202 } 221 }
OLDNEW
« 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