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

Issue 6250171: cashew: reset local counter on plan transition (Closed)

Created:
9 years, 10 months ago by Vince Laviano
Modified:
9 years ago
CC:
chromium-os-reviews_chromium.org, Vince Laviano
Visibility:
Public.

Description

cashew: reset local counter on plan transition The local counter fails to estimate data usage correctly if it is active during a transition from one plan to another. This CL is the first of two that will resolve this issue. It addresses plan transitions due to data quota exhaustion. The subsequent CL will address plan transitions due to the expiration time having passed. Changes: - Add the ability to reset the local byte counter. - Update OnByteCounterUpdate event handler to iterate over all active plans and assign measured data traffic appropriately to each plan in turn. If a plan is consumed, any overage is applied to the next active plan and the local byte counter is reset accordingly. This continues until we're either out of data to assign or out of active plans. - Move the bulk of the ServiceImpl::OnByteCounterUpdate logic to the DataPlan class to isolate it for unit testing. BUG=chromium-os:9860 TEST=unit tests, manual testing on device Change-Id: Ibfe2ee15eb6b79cb4f6575f289629be8388e12f7 Committed: http://chrome-svn/viewvc/chromeos?view=rev&revision=738b13e

Patch Set 1 #

Total comments: 4

Patch Set 2 : ers review comments #

Patch Set 3 : ers review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+980 lines, -76 lines) Patch
M src/byte_counter.h View 2 chunks +3 lines, -1 line 0 comments Download
M src/data_plan.h View 1 5 chunks +26 lines, -11 lines 0 comments Download
M src/data_plan.cc View 1 4 chunks +110 lines, -7 lines 0 comments Download
M src/data_plan_unittest.cc View 1 14 chunks +785 lines, -24 lines 0 comments Download
M src/device.h View 1 2 1 chunk +8 lines, -2 lines 0 comments Download
M src/device_impl.h View 1 chunk +2 lines, -1 line 0 comments Download
M src/device_impl.cc View 1 chunk +9 lines, -0 lines 0 comments Download
M src/device_mock.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/procfs_byte_counter.h View 1 chunk +2 lines, -0 lines 0 comments Download
M src/procfs_byte_counter.cc View 1 chunk +10 lines, -0 lines 0 comments Download
M src/service_impl.cc View 1 2 chunks +7 lines, -28 lines 0 comments Download
M src/service_manager.h View 1 chunk +4 lines, -0 lines 0 comments Download
M src/service_manager_impl.h View 1 chunk +2 lines, -2 lines 0 comments Download
M src/service_manager_impl.cc View 1 chunk +9 lines, -0 lines 0 comments Download
M src/service_manager_mock.h View 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Vince Laviano
9 years, 10 months ago (2011-02-04 22:45:41 UTC) #1
Jason Glasgow
LGTM
9 years, 10 months ago (2011-02-08 14:56:46 UTC) #2
Eric Shienbrood
LGTM, with a couple naming suggestions that you're free to ignore if you like. Also, ...
9 years, 10 months ago (2011-02-10 18:47:00 UTC) #3
Vince Laviano
http://codereview.chromium.org/6250171/diff/1/src/data_plan.h File src/data_plan.h (right): http://codereview.chromium.org/6250171/diff/1/src/data_plan.h#newcode30 src/data_plan.h:30: typedef int64 Bytes; On 2011/02/10 18:47:00, Eric Shienbrood wrote: ...
9 years, 10 months ago (2011-02-10 22:29:19 UTC) #4
Eric Shienbrood
9 years, 10 months ago (2011-02-10 22:33:23 UTC) #5
LEBTM (looks even better to me)

Powered by Google App Engine
This is Rietveld 408576698