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

Issue 4029002: AU: Don't use network on expensive connection types (Closed)

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

Description

AU: Don't use network on expensive connection types Specifically: - FlimFlam proxy class to query the current network status and find out if it's expensive. - Dbus Interface, so dbus can be mocked. - Libcurl change to redirect the URL if we are on an expensive connection. This may seem hacky, but the reason I avoided retooling the whole class is that we may decide that some network usage is okay on pricy connections. Perhaps it's okay to throttle. So, for now this is a more minimal change. BUG=chromium-os:2397 TEST=Unit tests, tested that flimflam proxy works on the device. Committed: http://chrome-svn/viewvc/chromeos?view=rev&revision=d57d147

Patch Set 1 #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+605 lines, -3 lines) Patch
M SConstruct View 2 chunks +2 lines, -0 lines 0 comments Download
A dbus_interface.h View 1 chunk +74 lines, -0 lines 0 comments Download
A flimflam_proxy.h View 1 chunk +53 lines, -0 lines 0 comments Download
A flimflam_proxy.cc View 1 chunk +178 lines, -0 lines 2 comments Download
A flimflam_proxy_unittest.cc View 1 chunk +170 lines, -0 lines 2 comments Download
M http_fetcher_unittest.cc View 2 chunks +41 lines, -0 lines 0 comments Download
M libcurl_http_fetcher.h View 4 chunks +16 lines, -0 lines 0 comments Download
M libcurl_http_fetcher.cc View 3 chunks +34 lines, -3 lines 2 comments Download
A mock_dbus_interface.h View 1 chunk +37 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
adlr
Here's the latest version of http://codereview.chromium.org/3313001/show
10 years, 2 months ago (2010-10-21 03:21:40 UTC) #1
petkov
LGTM w/ a couple of questions. http://codereview.chromium.org/4029002/diff/1/4 File flimflam_proxy.cc (right): http://codereview.chromium.org/4029002/diff/1/4#newcode134 flimflam_proxy.cc:134: if (value && ...
10 years, 2 months ago (2010-10-21 05:15:19 UTC) #2
adlr
10 years, 2 months ago (2010-10-21 19:41:14 UTC) #3
made fixes. will submit when tree opens.

http://codereview.chromium.org/4029002/diff/1/4
File flimflam_proxy.cc (right):

http://codereview.chromium.org/4029002/diff/1/4#newcode134
flimflam_proxy.cc:134: if (value && (type_str = g_value_get_string(value))) {
On 2010/10/21 05:15:19, petkov wrote:
> I'm surprised you don't get a gcc warning here. Maybe add an explicit
((type_str
> = ...) != NULL)?
> 

Done.

http://codereview.chromium.org/4029002/diff/1/6
File flimflam_proxy_unittest.cc (right):

http://codereview.chromium.org/4029002/diff/1/6#newcode154
flimflam_proxy_unittest.cc:154: //static const char*
StringForConnectionType(NetworkConnectionType type);
On 2010/10/21 05:15:19, petkov wrote:
> remove?
> 

Done.

http://codereview.chromium.org/4029002/diff/1/8
File libcurl_http_fetcher.cc (right):

http://codereview.chromium.org/4029002/diff/1/8#newcode79
libcurl_http_fetcher.cc:79: if (ConnectionIsExpensive()) {
On 2010/10/21 05:15:19, petkov wrote:
> If the device switches from WiFi to 3G in the middle of a download, does the
> connection always fail (as reported by libcurl) so we go through resume again?
> 

This code path is called for every connection or reconnection attempt. So if we
switch connection types midway through a download, it'll handle it properly.

Powered by Google App Engine
This is Rietveld 408576698