Index: src/data_plan.h |
diff --git a/src/data_plan.h b/src/data_plan.h |
index 4a1fe50a6bf376068ceabf4d0d0bd5ce66441895..af242bb759935294cd2672086630661e6a844248 100644 |
--- a/src/data_plan.h |
+++ b/src/data_plan.h |
@@ -20,7 +20,10 @@ |
namespace cashew { |
class DataPlan; |
+class Device; |
class Policy; |
+class Service; |
+class ServiceManager; |
// byte count |
// TODO(vlaviano): this should be a uint64, but libcros/Chrome expects this |
@@ -105,6 +108,17 @@ class DataPlan { |
// returns NULL if list is empty or contains no active plans |
static DataPlan* GetActivePlan(const DataPlanList& data_plans); |
+ // event handler for |service's| local byte counter on |device| |
+ // updates active plans in |data_plans| based on the |rx_bytes| and |
+ // |tx_bytes| values gathered during the most recent sample interval |
+ // notifies |service_manager| if an active plan is completely consumed |
+ // returns true if any plans were updated and false otherwise |
+ // |data_plans|, |service|, |service_manager| and |device| must not be NULL |
+ static bool OnByteCounterUpdate(DataPlanList *data_plans, Service *service, |
+ ServiceManager *service_manager, |
+ Device *device, uint64 rx_bytes, |
+ uint64 tx_bytes); |
+ |
private: |
// human-readable plan name |
const std::string name_; |