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

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: Minor fixes from trybot runs. 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
« 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
David Trainor- moved to gerrit 2013/10/23 16:12:38 Update javadoc: @return. Add @param for the param
marq (ping after 24h) 2013/10/23 16:28:49 Done.
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 */
140 public boolean isAcceptableAuthChallenge(String host, String realm) {
141 return nativeIsAcceptableAuthChallenge(mNativeDataReductionProxySettings , host, realm);
142 }
143
144 /**
145 * Returns an authentication token for the data reduction proxy. If the toke n cannot be
146 * generated, an empty string is returned.
147 * @return The generated token.
148 */
149 public String getTokenForAuthChallenge(String host, String realm) {
David Trainor- moved to gerrit 2013/10/23 16:12:38 Add @param for parameters.
marq (ping after 24h) 2013/10/23 16:28:49 Done.
150 return nativeGetTokenForAuthChallenge(mNativeDataReductionProxySettings, host, realm);
151 }
152
153 /**
142 * Retrieves the history of daily totals of bytes that would have been 154 * Retrieves the history of daily totals of bytes that would have been
143 * received if no data reducing mechanism had been applied. 155 * received if no data reducing mechanism had been applied.
144 * @return The history of daily totals 156 * @return The history of daily totals
145 */ 157 */
146 public long[] getOriginalNetworkStatsHistory() { 158 public long[] getOriginalNetworkStatsHistory() {
147 return nativeGetDailyOriginalContentLengths(mNativeDataReductionProxySet tings); 159 return nativeGetDailyOriginalContentLengths(mNativeDataReductionProxySet tings);
148 } 160 }
149 161
150 /** 162 /**
151 * Retrieves the history of daily totals of bytes that were received after 163 * Retrieves the history of daily totals of bytes that were received after
(...skipping 24 matching lines...) Expand all
176 private native void nativeBypassHostPattern( 188 private native void nativeBypassHostPattern(
177 int nativeDataReductionProxySettingsAndroid, String pattern); 189 int nativeDataReductionProxySettingsAndroid, String pattern);
178 private native void nativeBypassURLPattern( 190 private native void nativeBypassURLPattern(
179 int nativeDataReductionProxySettingsAndroid, String pattern); 191 int nativeDataReductionProxySettingsAndroid, String pattern);
180 private native boolean nativeIsDataReductionProxyAllowed( 192 private native boolean nativeIsDataReductionProxyAllowed(
181 int nativeDataReductionProxySettingsAndroid); 193 int nativeDataReductionProxySettingsAndroid);
182 private native boolean nativeIsDataReductionProxyPromoAllowed( 194 private native boolean nativeIsDataReductionProxyPromoAllowed(
183 int nativeDataReductionProxySettingsAndroid); 195 int nativeDataReductionProxySettingsAndroid);
184 private native String nativeGetDataReductionProxyOrigin( 196 private native String nativeGetDataReductionProxyOrigin(
185 int nativeDataReductionProxySettingsAndroid); 197 int nativeDataReductionProxySettingsAndroid);
186 private native String nativeGetDataReductionProxyAuth(
187 int nativeDataReductionProxySettingsAndroid);
188 private native boolean nativeIsDataReductionProxyEnabled( 198 private native boolean nativeIsDataReductionProxyEnabled(
189 int nativeDataReductionProxySettingsAndroid); 199 int nativeDataReductionProxySettingsAndroid);
190 private native boolean nativeIsDataReductionProxyManaged( 200 private native boolean nativeIsDataReductionProxyManaged(
191 int nativeDataReductionProxySettingsAndroid); 201 int nativeDataReductionProxySettingsAndroid);
192 private native void nativeSetDataReductionProxyEnabled( 202 private native void nativeSetDataReductionProxyEnabled(
193 int nativeDataReductionProxySettingsAndroid, boolean enabled); 203 int nativeDataReductionProxySettingsAndroid, boolean enabled);
194 private native long nativeGetDataReductionLastUpdateTime( 204 private native long nativeGetDataReductionLastUpdateTime(
195 int nativeDataReductionProxySettingsAndroid); 205 int nativeDataReductionProxySettingsAndroid);
196 private native ContentLengths nativeGetContentLengths( 206 private native ContentLengths nativeGetContentLengths(
197 int nativeDataReductionProxySettingsAndroid); 207 int nativeDataReductionProxySettingsAndroid);
208 private native boolean nativeIsAcceptableAuthChallenge(
209 int nativeDataReductionProxySettingsAndroid, String host, String rea lm);
210 private native String nativeGetTokenForAuthChallenge(
211 int nativeDataReductionProxySettingsAndroid, String host, String rea lm);
198 private native long[] nativeGetDailyOriginalContentLengths( 212 private native long[] nativeGetDailyOriginalContentLengths(
199 int nativeDataReductionProxySettingsAndroid); 213 int nativeDataReductionProxySettingsAndroid);
200 private native long[] nativeGetDailyReceivedContentLengths( 214 private native long[] nativeGetDailyReceivedContentLengths(
201 int nativeDataReductionProxySettingsAndroid); 215 int nativeDataReductionProxySettingsAndroid);
202 } 216 }
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