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

Issue 10206014: Upstream Android proxy config service. (Closed)

Created:
8 years, 8 months ago by Philippe
Modified:
8 years, 6 months ago
CC:
John Knottenbelt, chromium-reviews, erikwright (departed), cbentzel+watch_chromium.org, darin-cc_chromium.org, brettw-cc_chromium.org
Visibility:
Public.

Description

Upstream Android proxy config service. This change adds in an Android-specific system proxy provider called ProxyConfigServiceAndroid. This is created as required from C++. In turn ProxyConfigServiceAndroid creates a java object which provides the link to Android's proxy changed broadcast, as well as the functionality to read the Java system properties where the current proxy settings are located. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=140748

Patch Set 1 #

Patch Set 2 : Sync #

Patch Set 3 : Add proxy_test_cases.py #

Total comments: 59

Patch Set 4 : Address Ryan's comments #

Total comments: 31

Patch Set 5 : Address Ryan and Yaron's comments #

Total comments: 47

Patch Set 6 : Address Ryan's comments #

Patch Set 7 : Pass scoped_refptr by const reference #

Total comments: 14

Patch Set 8 : Address Ryan's comments #

Total comments: 4

Patch Set 9 : Address Ryan's comments #

Patch Set 10 : Fix comment #

Total comments: 6

Patch Set 11 : Address Ryan's comments #

Patch Set 12 : Remove a DCHECK for consistency #

Patch Set 13 : Make Java methods non-synchronized #

Total comments: 19

Patch Set 14 : Address Ryan's comments #

Patch Set 15 : Fix two threading issues + Sync #

Total comments: 8

Patch Set 16 : Address Ryan's comments #

Total comments: 7

Patch Set 17 : Address Ryan's comments #

Total comments: 2

Patch Set 18 : Fix comment #

Total comments: 8

Patch Set 19 : Address Marcus' comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1217 lines, -3 lines) Patch
M base/android/jni_generator/jni_generator.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +0 lines, -1 line 0 comments Download
A net/android/java/org/chromium/net/ProxyChangeListener.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +91 lines, -0 lines 0 comments Download
M net/android/net_jni_registrar.cc View 1 2 3 4 5 2 chunks +3 lines, -1 line 0 comments Download
A net/android/tools/proxy_test_cases.py View 1 2 3 4 5 6 7 8 9 10 1 chunk +343 lines, -0 lines 0 comments Download
M net/net.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +6 lines, -1 line 0 comments Download
A net/proxy/proxy_config_service_android.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +81 lines, -0 lines 0 comments Download
A net/proxy/proxy_config_service_android.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +334 lines, -0 lines 0 comments Download
A net/proxy/proxy_config_service_android_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +353 lines, -0 lines 0 comments Download
M net/proxy/proxy_service.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +6 lines, -0 lines 0 comments Download

Messages

Total messages: 39 (0 generated)
Philippe
Note that the original author is John Knottenbelt (CCed).
8 years, 8 months ago (2012-04-24 12:45:27 UTC) #1
Ryan Sleevi
First stab at review. I think there's some subtle threading issues, so I wanted to ...
8 years, 8 months ago (2012-04-24 18:20:04 UTC) #2
Philippe
Thanks Ryan for this first round of comments. I will have a deeper look at ...
8 years, 8 months ago (2012-04-25 15:39:08 UTC) #3
Yaron
https://chromiumcodereview.appspot.com/10206014/diff/4002/net/android/network_library.cc File net/android/network_library.cc (right): https://chromiumcodereview.appspot.com/10206014/diff/4002/net/android/network_library.cc#newcode87 net/android/network_library.cc:87: return RegisterNativesImpl(env) && drive-by: This doesn't belong and we ...
8 years, 8 months ago (2012-04-27 20:06:06 UTC) #4
Ryan Sleevi
I'll need to take another look at the threading issues later today, but since I ...
8 years, 7 months ago (2012-05-07 17:12:20 UTC) #5
Yaron
http://codereview.chromium.org/10206014/diff/30002/net/android/network_library.cc File net/android/network_library.cc (right): http://codereview.chromium.org/10206014/diff/30002/net/android/network_library.cc#newcode88 net/android/network_library.cc:88: ProxyConfigServiceAndroid::Init(env); So instead of doing this, you can add ...
8 years, 7 months ago (2012-05-07 19:15:30 UTC) #6
John Knottenbelt
http://codereview.chromium.org/10206014/diff/30002/net/proxy/proxy_config_service_android.cc File net/proxy/proxy_config_service_android.cc (right): http://codereview.chromium.org/10206014/diff/30002/net/proxy/proxy_config_service_android.cc#newcode53 net/proxy/proxy_config_service_android.cc:53: const std::string proxy_port = delegate->GetProperty("proxyPort"); ConstructProxyServer checks for empty ...
8 years, 7 months ago (2012-05-08 11:43:12 UTC) #7
Philippe
I'm publishing my comments for both the first round of comments and the recent one. ...
8 years, 7 months ago (2012-05-09 11:48:39 UTC) #8
Ryan Sleevi
Thanks Philippe. More comments - certainly not trying to drag this out, but I am ...
8 years, 7 months ago (2012-05-14 18:00:24 UTC) #9
Philippe
Thanks Ryan for spending so much time reviewing this! Hopefully we will land that soon. ...
8 years, 7 months ago (2012-05-15 16:12:47 UTC) #10
Philippe
http://codereview.chromium.org/10206014/diff/31004/net/proxy/proxy_config_service_android.h File net/proxy/proxy_config_service_android.h (right): http://codereview.chromium.org/10206014/diff/31004/net/proxy/proxy_config_service_android.h#newcode81 net/proxy/proxy_config_service_android.h:81: scoped_refptr<SharedState> callback_state); On 2012/05/15 16:12:48, Philippe wrote: > On ...
8 years, 7 months ago (2012-05-16 08:01:05 UTC) #11
Ryan Sleevi
Right, Bind uses BindStorage, which uses CallbackStorageTraits. The CallbackStorageTraits for all concrete types is store ...
8 years, 7 months ago (2012-05-19 01:26:31 UTC) #12
Ryan Sleevi
oh, and for naming, "network_task_runner" and "jni_task_runner" are the suggested names. I used IO/UI for ...
8 years, 7 months ago (2012-05-19 01:28:32 UTC) #13
Philippe
I moved delegate_ out of the SharedState class since I don't use it in the ...
8 years, 7 months ago (2012-05-22 15:23:04 UTC) #14
Ryan Sleevi
Philippe: I feel like we've taken a step back with the locking. You can/should be ...
8 years, 7 months ago (2012-05-22 18:26:19 UTC) #15
Philippe
Hi Ryan, I made quite a lot of changes following your comments. That was quite ...
8 years, 7 months ago (2012-05-25 16:20:09 UTC) #16
Ryan Sleevi
Thanks for putting up with the review comments. I think this looks much better, and ...
8 years, 7 months ago (2012-05-25 17:42:14 UTC) #17
Philippe
Indeed, using a single message loop makes testing MUCH easier :) I was missing RunAllPending(). ...
8 years, 6 months ago (2012-05-29 10:05:29 UTC) #18
Philippe
On 2012/05/29 10:05:29, Philippe wrote: > Indeed, using a single message loop makes testing MUCH ...
8 years, 6 months ago (2012-05-29 13:10:27 UTC) #19
Ryan Sleevi
Almost! One potential use-after-free here, and a few nits about the tests, but nothing too ...
8 years, 6 months ago (2012-05-29 17:34:42 UTC) #20
Philippe
I'm glad to see that we are almost there :) http://codereview.chromium.org/10206014/diff/52026/net/proxy/proxy_config_service_android.cc File net/proxy/proxy_config_service_android.cc (right): http://codereview.chromium.org/10206014/diff/52026/net/proxy/proxy_config_service_android.cc#newcode175 ...
8 years, 6 months ago (2012-06-01 13:06:36 UTC) #21
Philippe
http://codereview.chromium.org/10206014/diff/52026/net/proxy/proxy_config_service_android.cc File net/proxy/proxy_config_service_android.cc (right): http://codereview.chromium.org/10206014/diff/52026/net/proxy/proxy_config_service_android.cc#newcode175 net/proxy/proxy_config_service_android.cc:175: base::Bind(&Delegate::SetupOnJNIThread, this, service)); On 2012/06/01 13:06:37, Philippe wrote: > ...
8 years, 6 months ago (2012-06-01 14:11:21 UTC) #22
Philippe
Hi Ryan, This last patch set should have fixed the threading issue at destruction. When ...
8 years, 6 months ago (2012-06-01 17:14:09 UTC) #23
Ryan Sleevi
On 2012/06/01 17:14:09, Philippe wrote: > Hi Ryan, > > This last patch set should ...
8 years, 6 months ago (2012-06-01 18:09:49 UTC) #24
Ryan Sleevi
Great! I think you've fixed just about everything. I have one concern that a bit ...
8 years, 6 months ago (2012-06-01 18:10:58 UTC) #25
Philippe
You were right, the message loop is initialized by the net test suite (in NetTestSuite::InitializeTestThreadNoNetworkChangeNotifier() ...
8 years, 6 months ago (2012-06-04 10:02:37 UTC) #26
Ryan Sleevi
LGTM, but with a sharp edge and some nits below. http://codereview.chromium.org/10206014/diff/89002/net/android/java/org/chromium/net/ProxyChangeListener.java File net/android/java/org/chromium/net/ProxyChangeListener.java (right): http://codereview.chromium.org/10206014/diff/89002/net/android/java/org/chromium/net/ProxyChangeListener.java#newcode68 ...
8 years, 6 months ago (2012-06-04 21:49:18 UTC) #27
Philippe
Thanks a lot Ryan for spending so much time and reviewing this so carefully! I ...
8 years, 6 months ago (2012-06-05 09:07:54 UTC) #28
Ryan Sleevi
LGTM! One comment nit, but no need to wait for my re-review. Address as/if you ...
8 years, 6 months ago (2012-06-05 16:50:13 UTC) #29
Philippe
Thanks Ryan! I addressed the small comment. Otherwise I think you did a great job. ...
8 years, 6 months ago (2012-06-06 08:45:20 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pliard@chromium.org/10206014/102002
8 years, 6 months ago (2012-06-06 09:53:15 UTC) #31
commit-bot: I haz the power
Presubmit check for 10206014-102002 failed and returned exit status 1. Running presubmit commit checks ...
8 years, 6 months ago (2012-06-06 09:53:19 UTC) #32
Philippe
I'm adding bulach@ for base/android/.
8 years, 6 months ago (2012-06-06 09:56:39 UTC) #33
bulach
lgtm, just a few nits: http://codereview.chromium.org/10206014/diff/102002/base/android/jni_generator/jni_generator.py File base/android/jni_generator/jni_generator.py (right): http://codereview.chromium.org/10206014/diff/102002/base/android/jni_generator/jni_generator.py#newcode188 base/android/jni_generator/jni_generator.py:188: 'Lorg/chromium/net/NetworkChangeNotifier', nit: seems duplicated ...
8 years, 6 months ago (2012-06-06 10:57:38 UTC) #34
Philippe
Thanks Marcus! http://codereview.chromium.org/10206014/diff/102002/base/android/jni_generator/jni_generator.py File base/android/jni_generator/jni_generator.py (right): http://codereview.chromium.org/10206014/diff/102002/base/android/jni_generator/jni_generator.py#newcode188 base/android/jni_generator/jni_generator.py:188: 'Lorg/chromium/net/NetworkChangeNotifier', On 2012/06/06 10:57:38, bulach wrote: > ...
8 years, 6 months ago (2012-06-06 11:36:58 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pliard@chromium.org/10206014/97005
8 years, 6 months ago (2012-06-06 11:37:18 UTC) #36
commit-bot: I haz the power
Change committed as 140748
8 years, 6 months ago (2012-06-06 12:57:47 UTC) #37
joth
https://chromiumcodereview.appspot.com/10206014/diff/31004/net/proxy/proxy_config_service_android.cc File net/proxy/proxy_config_service_android.cc (right): https://chromiumcodereview.appspot.com/10206014/diff/31004/net/proxy/proxy_config_service_android.cc#newcode165 net/proxy/proxy_config_service_android.cc:165: // Question: Conversion to/from UTF8 ok here? On 2012/05/15 ...
8 years, 6 months ago (2012-06-21 01:12:43 UTC) #38
Philippe
8 years, 6 months ago (2012-06-21 11:32:55 UTC) #39
https://chromiumcodereview.appspot.com/10206014/diff/31004/net/proxy/proxy_co...
File net/proxy/proxy_config_service_android.cc (right):

https://chromiumcodereview.appspot.com/10206014/diff/31004/net/proxy/proxy_co...
net/proxy/proxy_config_service_android.cc:165: // Question: Conversion to/from
UTF8 ok here?
On 2012/06/21 01:12:43, joth wrote:
> On 2012/05/15 16:12:48, Philippe wrote:
> > On 2012/05/14 18:00:25, Ryan Sleevi wrote:
> > > Should there be a TODO and a bug followed for follow-up?
> > > 
> > > Otherwise, this comment will never go answered and just serve to confuse
> > future
> > > readers as to whether or not there is or isn't a bug a here.
> > 
> > I made it a TODO and will file a bug.
> 
> Was there a bug?
> AFAICT UTF8 should be fine: the property names are well known and all simple
> ascii.
> The results should only be hostnames (with possible wild card or | delim) and
so
> again ascii. If we do get invalid uf8 back, the device is broken, but anyway
the
> converter will drop it and give us an empty string thereby disabling that part
> of proxy support which is probably the least worse thing to do in that
scenario.

No, it seems that I forgot to create the bug :/ I'm glad that there is finally
no bug here. I will create a CL to remove the TODO.

Thanks Jonathan!

Powered by Google App Engine
This is Rietveld 408576698