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

Issue 5151005: AU: Proxy Resolver classes (Closed)

Created:
10 years, 1 month ago by adlr
Modified:
9 years ago
Reviewers:
petkov
CC:
chromium-os-reviews_chromium.org, petkov, adlr
Visibility:
Public.

Description

AU: Proxy Resolver classes A collection of classes (abstract ProxyResolver interface and two concrete implementations). The abstraction is one that should suit us moving forward: a string URL is provided and a collection of proxy servers is returned. One implementation always returns [no proxy]. Another returns [manual settings from chrome, if applicable, ..., no proxy]. A future concrete implementation will consult Chrome via DBus with the URL in question, however this is delayed until Chrome exposes such an API. As a result of this API missing from Chrome, this CL only resolves proxies for a URL with manually input proxy settings. Future CLs will integrate this into the rest of the update system. BUG=3167 TEST=unit tests, (with future CLs) working proxy support on device Committed: http://chrome-svn/viewvc/chromeos?view=rev&revision=9cd120d

Patch Set 1 #

Patch Set 2 : tests #

Total comments: 64

Patch Set 3 : fixes for review #

Patch Set 4 : fix whitespace #

Total comments: 10

Patch Set 5 : fixes for review #

Patch Set 6 : merge master #

Unified diffs Side-by-side diffs Delta from patch set Stats (+521 lines, -1 line) Patch
M SConstruct View 3 chunks +3 lines, -0 lines 0 comments Download
A chrome_proxy_resolver.h View 1 2 3 4 1 chunk +66 lines, -0 lines 0 comments Download
A chrome_proxy_resolver.cc View 1 2 3 4 1 chunk +185 lines, -0 lines 0 comments Download
A chrome_proxy_resolver_unittest.cc View 1 2 3 4 1 chunk +147 lines, -0 lines 0 comments Download
M dbus_interface.h View 1 2 4 chunks +24 lines, -1 line 0 comments Download
M mock_dbus_interface.h View 1 chunk +28 lines, -0 lines 0 comments Download
A proxy_resolver.h View 1 2 3 4 1 chunk +47 lines, -0 lines 0 comments Download
A proxy_resolver.cc View 1 2 1 chunk +21 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
adlr
10 years, 1 month ago (2010-11-18 21:39:33 UTC) #1
petkov
Mostly nits. http://codereview.chromium.org/5151005/diff/2001/chrome_proxy_resolver.cc File chrome_proxy_resolver.cc (right): http://codereview.chromium.org/5151005/diff/2001/chrome_proxy_resolver.cc#newcode1 chrome_proxy_resolver.cc:1: // Copyright (c) 2010 The Chromium Authors. ...
10 years, 1 month ago (2010-11-18 23:26:46 UTC) #2
petkov
Btw, if at some point we switch proxy resolution from Chrome to flimflam, would you ...
10 years, 1 month ago (2010-11-19 00:28:04 UTC) #3
adlr
PTAL. thanks http://codereview.chromium.org/5151005/diff/2001/chrome_proxy_resolver.cc File chrome_proxy_resolver.cc (right): http://codereview.chromium.org/5151005/diff/2001/chrome_proxy_resolver.cc#newcode1 chrome_proxy_resolver.cc:1: // Copyright (c) 2010 The Chromium Authors. ...
10 years, 1 month ago (2010-11-19 00:41:06 UTC) #4
adlr
I think at that point we would have yet another type of ProxyResolver, and would ...
10 years, 1 month ago (2010-11-19 00:51:17 UTC) #5
petkov
LGTM w/ some nits and responses below. http://codereview.chromium.org/5151005/diff/2001/dbus_interface.h File dbus_interface.h (right): http://codereview.chromium.org/5151005/diff/2001/dbus_interface.h#newcode47 dbus_interface.h:47: GType) { ...
10 years, 1 month ago (2010-11-19 01:09:19 UTC) #6
adlr
10 years, 1 month ago (2010-11-19 02:00:52 UTC) #7
http://codereview.chromium.org/5151005/diff/2001/dbus_interface.h
File dbus_interface.h (right):

http://codereview.chromium.org/5151005/diff/2001/dbus_interface.h#newcode47
dbus_interface.h:47: GType) {
On 2010/11/19 01:09:19, petkov wrote:
> On 2010/11/19 00:41:06, adlr wrote:
> > On 2010/11/18 23:26:46, petkov wrote:
> > > The last argument is always INVALID, right? So you could infer it and
remove
> > the
> > > last argument and avoid the 10-argument-limit issues. dbus_g_proxy_call
> can't
> > > infer it because it uses varargs, I think.
> > 
> > i got the mock to implement this, so the impl here has been removed.
> 
> OK, although the last argument is still unnecessary and can be removed.

It's true that it's not necessary since in practice it's always 'invalid', but I
would argue it's nice to keep the interface faithful to the real dbus calls, and
deal with gmocks' trouble with 11-arg functions only in the tests. Should gmock
ever change and support > 10 arg functions, we would probably want the dbus
interface to have 11 args in this function.

http://codereview.chromium.org/5151005/diff/2001/proxy_resolver.h
File proxy_resolver.h (right):

http://codereview.chromium.org/5151005/diff/2001/proxy_resolver.h#newcode25
proxy_resolver.h:25: virtual bool ProxyForUrl(const std::string& url,
On 2010/11/19 01:09:19, petkov wrote:
> On 2010/11/19 00:41:06, adlr wrote:
> > On 2010/11/18 23:26:46, petkov wrote:
> > > You should rename most of the new methods to include a verb. E.g.,
> > > GetProxyForUrl.
> > 
> > done, i think.
> > 
> > > 
> > > PS. I also prefer keeping all caps for abbreviations in CamelCase (i.e,
> > > GetProxyForURL) but feel free to ignore...
> > 
> > The google style guide uses lowercase for the non-first letters of an
acronym,
> > it seems. look for "url" in
> > http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml
> 
> Ugly. They also use kOK. And we have JSONParser class with a JsonToValue
method.
> If you search for CamelCase on the web, standard is all caps for acronyms. But
> anyway, it's all messed up already anyway.

If you look at the update_engine code today, we use Url a lot more than URL.
should we change them all?

for now i'll push as-is

http://codereview.chromium.org/5151005/diff/21001/chrome_proxy_resolver.cc
File chrome_proxy_resolver.cc (right):

http://codereview.chromium.org/5151005/diff/21001/chrome_proxy_resolver.cc#ne...
chrome_proxy_resolver.cc:26: std::vector<std::string>* out_proxies) {
On 2010/11/19 01:09:19, petkov wrote:
> indent is off

Done.

http://codereview.chromium.org/5151005/diff/21001/chrome_proxy_resolver.h
File chrome_proxy_resolver.h (right):

http://codereview.chromium.org/5151005/diff/21001/chrome_proxy_resolver.h#new...
chrome_proxy_resolver.h:40: static bool GetTypeForProxy(const std::string&
proxy,
On 2010/11/19 01:09:19, petkov wrote:
> suggestion: GetProxyType

Done.

http://codereview.chromium.org/5151005/diff/21001/chrome_proxy_resolver_unitt...
File chrome_proxy_resolver_unittest.cc (right):

http://codereview.chromium.org/5151005/diff/21001/chrome_proxy_resolver_unitt...
chrome_proxy_resolver_unittest.cc:72:
EXPECT_FALSE(resolver.GetProxiesForUrlWithSettings("http://foo.com", "}",
&out));
On 2010/11/19 01:09:19, petkov wrote:
> 80 chars

Done.

http://codereview.chromium.org/5151005/diff/21001/chrome_proxy_resolver_unitt...
chrome_proxy_resolver_unittest.cc:121:
EXPECT_TRUE(resolver.GetProxiesForUrl("http://user:pass@foo.com:22", &proxies));
On 2010/11/19 01:09:19, petkov wrote:
> 80 chars

Done.

http://codereview.chromium.org/5151005/diff/21001/proxy_resolver.h
File proxy_resolver.h (right):

http://codereview.chromium.org/5151005/diff/21001/proxy_resolver.h#newcode22
proxy_resolver.h:22: // Stores a proxy for a given |url| in |out_proxy|. Returns
true on success.
On 2010/11/19 01:09:19, petkov wrote:
> Stores a list of proxies for a given ...

Done.

Powered by Google App Engine
This is Rietveld 408576698