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

Unified Diff: net/android/java/src/org/chromium/net/ProxyChangeListener.java

Issue 421493002: Use Android proxy's exclusion list to enable proxy bypass (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix some compile errors Created 6 years, 5 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 | net/proxy/proxy_config_service_android.h » ('j') | net/proxy/proxy_config_service_android.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/android/java/src/org/chromium/net/ProxyChangeListener.java
diff --git a/net/android/java/src/org/chromium/net/ProxyChangeListener.java b/net/android/java/src/org/chromium/net/ProxyChangeListener.java
index 634c379ff7077d60bee256240f2c6394b454ee33..f49714fe2b282447e8bffd2d7afa38f50ec73cef 100644
--- a/net/android/java/src/org/chromium/net/ProxyChangeListener.java
+++ b/net/android/java/src/org/chromium/net/ProxyChangeListener.java
@@ -32,14 +32,19 @@ public class ProxyChangeListener {
private Delegate mDelegate;
private static class ProxyConfig {
- public ProxyConfig(String host, int port) {
+ public ProxyConfig(String host, int port, String exclusionList) {
mHost = host;
mPort = port;
+ mExclusionList = exclusionList;
}
public final String mHost;
public final int mPort;
+ public final String mExclusionList;
}
+ /**
+ * The delegate for ProxyChangeListener. Use for testing.
+ */
public interface Delegate {
public void proxySettingsChanged();
}
@@ -99,6 +104,7 @@ public class ProxyChangeListener {
final String CLASS_NAME = "android.net.ProxyProperties";
final String GET_HOST_NAME = "getHost";
final String GET_PORT_NAME = "getPort";
+ final String GET_EXCLUSION_LIST = "getExclusionList";
Object props = intent.getExtras().get("proxy");
if (props == null) {
return null;
@@ -106,11 +112,12 @@ public class ProxyChangeListener {
Class<?> cls = Class.forName(CLASS_NAME);
Method getHostMethod = cls.getDeclaredMethod(GET_HOST_NAME);
Method getPortMethod = cls.getDeclaredMethod(GET_PORT_NAME);
+ Method getExclusionListMethod = cls.getDeclaredMethod(GET_EXCLUSION_LIST);
String host = (String) getHostMethod.invoke(props);
int port = (Integer) getPortMethod.invoke(props);
-
- return new ProxyConfig(host, port);
+ String exclusionList = (String) getExclusionListMethod.invoke(props);
+ return new ProxyConfig(host, port, exclusionList);
} catch (ClassNotFoundException ex) {
return null;
} catch (NoSuchMethodException ex) {
@@ -138,7 +145,7 @@ public class ProxyChangeListener {
// Note that this code currently runs on a MESSAGE_LOOP_UI thread, but
// the C++ code must run the callbacks on the network thread.
if (cfg != null) {
- nativeProxySettingsChangedTo(mNativePtr, cfg.mHost, cfg.mPort);
+ nativeProxySettingsChangedTo(mNativePtr, cfg.mHost, cfg.mPort, cfg.mExclusionList);
} else {
nativeProxySettingsChanged(mNativePtr);
}
@@ -168,7 +175,8 @@ public class ProxyChangeListener {
@NativeClassQualifiedName("ProxyConfigServiceAndroid::JNIDelegate")
private native void nativeProxySettingsChangedTo(long nativePtr,
String host,
- int port);
+ int port,
+ String exclusionList);
@NativeClassQualifiedName("ProxyConfigServiceAndroid::JNIDelegate")
private native void nativeProxySettingsChanged(long nativePtr);
}
« no previous file with comments | « no previous file | net/proxy/proxy_config_service_android.h » ('j') | net/proxy/proxy_config_service_android.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698