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

Issue 3047052: chromeos: 1st draft of ProxyConfigService for chromeos... (Closed)

Created:
10 years, 4 months ago by kuan
Modified:
9 years, 7 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, darin-cc_chromium.org
Visibility:
Public.

Description

chromeos: 1st draft of ProxyConfigService for chromeos what this cl is: - a REALLY bare skeleton implementation of ProxyConfigService for chromeos (lots of design details remain to be worked out on the chromeos side, but i needed to get something basic up) - focused on getting chrome part correct, extracting design flow and implementation from linux variant that are relevant to chromeos, e.g.: - provide access of ProxyConfigService interface on IO thread - provide methods on UI thread for UI to read/modify proxy config (like linux's GConf notifications on UI thread) - fetch initial config on UI thread (this is not absolutely necessary for chromeos, 'cos i don't use GConf, but i just follow linux for now) - however, the class is RefCountedThreadSafe (so that both net::ProxyService and DOMUI can access it), and the code resides in chrome/browser/chromeos dir instead of net/proxy. - design details are in .h files - initial config is hardcoded as pac script and loaded as owner (TODO: load this from cros settings persisted on chromeos device) - this should work like the current chromeos session manager which sets the auto-proxy environment variable in login script to the same pac script - implement an augmented analogue to net::ProxyConfig to hold actual proxy config and UI settings (e.g. source and readonly attributes) - backend uses this as the main proxy config, and only converts it to net:::ProxyConfig for network stack on the IO thread in net::ProxyService::GetLatestProxyConfig. - UI methods also use this structure - provide methods to get and set configs from UI thread - UI can use dom_ui->GetProfile()->GetChromeOSProxyConfigServiceImpl() to access these methods on the UI thread - these methods are by no means final - i only added them here to verify the design flow that modifications can be made from UI thread and picked up by IO thread. - david and i will improve or modify them to whatever works best for frontend and backend. - unittest that tests most functionalities: socks and bypass_rules will be enabled in a later cl. TODOs after this cl: - work with UI, load initial config as owner from cros settings - implement policy mechanism, merge it with owner during initial load and modifications - persist proxy settings - etc etc etc BUG=chromium-os:5127 TEST=nothing yet. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=57204

Patch Set 1 #

Total comments: 2

Patch Set 2 : '' #

Total comments: 56

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Total comments: 43

Patch Set 6 : '' #

Total comments: 15

Patch Set 7 : '' #

Total comments: 10

Patch Set 8 : '' #

Patch Set 9 : '' #

Total comments: 12

Patch Set 10 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1156 lines, -6 lines) Patch
A chrome/browser/chromeos/proxy_config_service.h View 2 3 4 5 1 chunk +42 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/proxy_config_service_impl.h View 2 3 4 5 1 chunk +191 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/proxy_config_service_impl.cc View 2 3 4 5 6 7 1 chunk +305 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/proxy_config_service_impl_unittest.cc View 2 3 4 5 6 7 8 9 1 chunk +539 lines, -0 lines 0 comments Download
M chrome/browser/net/chrome_url_request_context.cc View 2 3 4 5 6 7 3 chunks +13 lines, -4 lines 0 comments Download
M chrome/browser/profile.h View 2 3 4 5 6 7 2 chunks +13 lines, -0 lines 0 comments Download
M chrome/browser/profile.cc View 2 3 4 5 6 7 1 chunk +7 lines, -0 lines 0 comments Download
M chrome/browser/profile_impl.h View 2 3 4 5 6 7 2 chunks +7 lines, -0 lines 0 comments Download
M chrome/browser/profile_impl.cc View 2 3 4 5 6 7 2 chunks +13 lines, -0 lines 0 comments Download
M chrome/chrome_browser.gypi View 2 3 4 5 6 7 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M chrome/test/testing_profile.h View 2 3 4 5 6 7 1 chunk +6 lines, -1 line 0 comments Download
M net/net.gyp View 1 2 3 4 5 6 7 2 chunks +11 lines, -0 lines 0 comments Download
M net/proxy/proxy_service.cc View 1 2 3 4 5 6 7 2 chunks +5 lines, -1 line 0 comments Download

Messages

Total messages: 16 (0 generated)
kuan
10 years, 4 months ago (2010-08-06 16:07:15 UTC) #1
Paweł Hajdan Jr.
Drive-by with a test comment. Please let me take another look before committing. http://codereview.chromium.org/3047052/diff/1/5 File ...
10 years, 4 months ago (2010-08-06 17:45:40 UTC) #2
kuan
i've restructured and reimplemented the original cl per eric's suggestions on a separate email thread. ...
10 years, 4 months ago (2010-08-12 21:21:22 UTC) #3
Paweł Hajdan Jr.
http://codereview.chromium.org/3047052/diff/8001/9004 File chrome/browser/chromeos/proxy_config_service_impl_unittest.cc (right): http://codereview.chromium.org/3047052/diff/8001/9004#newcode56 chrome/browser/chromeos/proxy_config_service_impl_unittest.cc:56: // We have to return something, so simply use ...
10 years, 4 months ago (2010-08-12 21:30:21 UTC) #4
eroman
This looks like a good start! Some high level comments before I get caught up ...
10 years, 4 months ago (2010-08-13 07:41:21 UTC) #5
kuan
i addressed all ur comments in the latest uploaded snapshot, including the major ones: - ...
10 years, 4 months ago (2010-08-18 16:33:20 UTC) #6
Paweł Hajdan Jr.
LGTM
10 years, 4 months ago (2010-08-18 18:07:52 UTC) #7
eroman
http://codereview.chromium.org/3047052/diff/8001/9003 File chrome/browser/chromeos/proxy_config_service_impl.h (right): http://codereview.chromium.org/3047052/diff/8001/9003#newcode61 chrome/browser/chromeos/proxy_config_service_impl.h:61: ProxyConfigServiceImpl(); On 2010/08/18 16:33:20, kuan wrote: > On 2010/08/13 ...
10 years, 4 months ago (2010-08-18 18:50:37 UTC) #8
eroman
http://codereview.chromium.org/3047052/diff/8001/9003 File chrome/browser/chromeos/proxy_config_service_impl.h (right): http://codereview.chromium.org/3047052/diff/8001/9003#newcode39 chrome/browser/chromeos/proxy_config_service_impl.h:39: // ProxyConfigServiceImpl is created on the UI thread in ...
10 years, 4 months ago (2010-08-18 20:31:19 UTC) #9
kuan
i've addressed all ur comments, except for the unittest, in the latest snapshot. cld u ...
10 years, 4 months ago (2010-08-20 16:56:12 UTC) #10
eroman
http://codereview.chromium.org/3047052/diff/19003/52002 File chrome/browser/chromeos/proxy_config_service_impl.cc (right): http://codereview.chromium.org/3047052/diff/19003/52002#newcode24 chrome/browser/chromeos/proxy_config_service_impl.cc:24: source_name = "SOURCE_NONE"; This switch can be simplified (Please ...
10 years, 4 months ago (2010-08-20 18:48:27 UTC) #11
kuan
i've addressed ur comments in the latest snapshot (patch 6). again, unittest is not ready ...
10 years, 4 months ago (2010-08-20 21:26:08 UTC) #12
eroman
Other than the unittests, LGTM http://codereview.chromium.org/3047052/diff/19003/52002 File chrome/browser/chromeos/proxy_config_service_impl.cc (right): http://codereview.chromium.org/3047052/diff/19003/52002#newcode137 chrome/browser/chromeos/proxy_config_service_impl.cc:137: net::ProxyConfig::ProxyRules::TYPE_SINGLE_PROXY; On 2010/08/20 21:26:08, ...
10 years, 4 months ago (2010-08-20 22:37:53 UTC) #13
kuan
i've addressed ur comments for proxy_config_service_impl.cc in patch 7 and rewrote unittest for proxy_config_service_impl_unittest.cc in ...
10 years, 4 months ago (2010-08-23 13:39:18 UTC) #14
eroman
LGTM. I ran out of steam looking through the unittest, but overall looked good. http://codereview.chromium.org/3047052/diff/19004/67004 ...
10 years, 4 months ago (2010-08-23 20:18:12 UTC) #15
kuan
10 years, 4 months ago (2010-08-24 16:31:39 UTC) #16
just fyi: i've addressed ur comments in the latest snapshot.  since u've already
lgtm'ed, i'll be submitting soon.
thanks!

http://codereview.chromium.org/3047052/diff/19004/67004
File chrome/browser/chromeos/proxy_config_service_impl_unittest.cc (right):

http://codereview.chromium.org/3047052/diff/19004/67004#newcode264
chrome/browser/chromeos/proxy_config_service_impl_unittest.cc:264: // Takes
ownership of |config_service|.
On 2010/08/23 20:18:13, eroman wrote:
> What does "take ownership" of a refcounted value mean?

Done. copied blindly, removed now.

http://codereview.chromium.org/3047052/diff/19004/67004#newcode269
chrome/browser/chromeos/proxy_config_service_impl_unittest.cc:269: void
SetAutomaticProxy(ProxyConfigServiceImpl::ProxyConfig::Mode mode,
On 2010/08/23 20:18:13, eroman wrote:
> Please place each argument on its own line. See
> http://dev.chromium.org/developers/coding-style for more details.
> 
> (it talks about it in the context of function calls, but applies the same for
> function declarations).

Done.

http://codereview.chromium.org/3047052/diff/19004/67004#newcode279
chrome/browser/chromeos/proxy_config_service_impl_unittest.cc:279: void
SetManualProxy(ProxyConfigServiceImpl::ProxyConfig::Mode mode,
On 2010/08/23 20:18:13, eroman wrote:
> ditto.

Done.

http://codereview.chromium.org/3047052/diff/19004/67004#newcode290
chrome/browser/chromeos/proxy_config_service_impl_unittest.cc:290: void
InitConfigWithTestInput(const Input& input,
On 2010/08/23 20:18:13, eroman wrote:
> ditto.

Done.

http://codereview.chromium.org/3047052/diff/19004/67004#newcode307
chrome/browser/chromeos/proxy_config_service_impl_unittest.cc:307: case
MK_MODE(PROXY_PER_SCHEME):
On 2010/08/23 20:18:13, eroman wrote:
> There is a lot of boiler plate code in this file, i wander if it can be
trimmed
> down?

i moved the if check to inside SetManualProxy. per our discussion, this is ok.

http://codereview.chromium.org/3047052/diff/19004/67004#newcode437
chrome/browser/chromeos/proxy_config_service_impl_unittest.cc:437:
config_service()->UISetProxyConfigToProxyPerScheme("http",
On 2010/08/23 20:18:13, eroman wrote:
> please use parens around multi line ifs. also see style guide for recommended
> way to break long function call.

Done.

Powered by Google App Engine
This is Rietveld 408576698