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

Unified Diff: src/data_plan.h

Issue 5321001: cashew: don't propagate inactive plans to clients (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/cashew.git@master
Patch Set: Address rtc code review comments Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/data_plan.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/data_plan.h
diff --git a/src/data_plan.h b/src/data_plan.h
index f58d6f69b0f16a8873de491c61d6d569805e4b86..4a1fe50a6bf376068ceabf4d0d0bd5ce66441895 100644
--- a/src/data_plan.h
+++ b/src/data_plan.h
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// TODO(vlaviano): update accessor style (GetFoo/SetFoo -> foo)
+
#ifndef SRC_DATA_PLAN_H_
#define SRC_DATA_PLAN_H_
@@ -78,6 +80,9 @@ class DataPlan {
// must be >= 0
virtual void SetLocalBytesUsed(Bytes local_bytes_used);
+ // get total used bytes
+ virtual Bytes GetTotalBytesUsed() const;
+
// is this an active plan?
// we define active to mean that the plan is current and not exhausted
virtual bool IsActive() const;
@@ -129,6 +134,11 @@ class DataPlan {
// baseline from the carrier API
Bytes local_bytes_used_;
+ // our best estimate of total bytes used for this plan
+ // carrier baseline (|data_bytes_used_|) +
+ // locally measured traffic (|local_bytes_used_|)
+ Bytes total_bytes_used_;
+
// convert plan type enum value to string formatted for libcros
const char* TypeToLibcrosString(Type type) const;
« no previous file with comments | « no previous file | src/data_plan.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698