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

Unified Diff: src/service.h

Issue 5180003: cashew: add local byte counters (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/cashew.git@master
Patch Set: Address jglasgow and zelidrag (offline) 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 | « src/procfs_byte_counter_unittest.cc ('k') | src/service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/service.h
diff --git a/src/service.h b/src/service.h
index dfe746911c491454f071876669d7aa3fbfc90901..442ea7119b4d59a90394af61e900791a9a24a6a7 100644
--- a/src/service.h
+++ b/src/service.h
@@ -83,6 +83,16 @@ class Service : public org::chromium::flimflam::Service_proxy,
// do we think that we're the default service at this time?
virtual bool IsDefaultService() const;
+ typedef enum {
+ kConnectivityStateUnknown = 0,
+ kConnectivityStateRestricted,
+ kConnectivityStateUnrestricted,
+ kConnectivityStateNone,
+ } ConnectivityState;
+
+ // get connectivity state for this service
+ virtual ConnectivityState GetConnectivityState() const;
+
// Flimflam Service D-Bus Proxy methods
// receive incoming PropertyChanged D-Bus signal from Flimflam service
@@ -94,6 +104,9 @@ class Service : public org::chromium::flimflam::Service_proxy,
// we've received updated Cellular.Carrier info from our child Device
virtual void OnCarrierUpdate(const std::string& carrier);
+ // we've received updated byte counter info from our child Device
+ virtual void OnByteCounterUpdate(uint64 rx_bytes, uint64 tx_bytes);
+
// DataPlanProviderDelegate methods
// a request to our carrier usage API proxy has completed
@@ -179,12 +192,23 @@ class Service : public org::chromium::flimflam::Service_proxy,
// and our subsequent timer calls
bool retrying_get_properties_;
+ // Service connectivity state
+ // finer-grained connectivity info applicable when |state_| == kStateReady
+ ConnectivityState connectivity_state_;
+
+ // convert connectivity state string to ConnectivityState enum value
+ static ConnectivityState ConnectivityStateFromString(
+ const std::string& connectivity_state);
+
// convert state string to State enum value
- State StateFromString(const std::string& state) const;
+ static State StateFromString(const std::string& state);
// we've received updated Device info from Flimflam
void OnDeviceUpdate(const DBus::Path& device_path);
+ // we've received updated Connectivity State info from Flimflam
+ void OnConnectivityStateUpdate(const std::string& connectivity_state);
+
// we've received updated State info from Flimflam
void OnStateUpdate(const std::string& state);
@@ -270,6 +294,9 @@ class Service : public org::chromium::flimflam::Service_proxy,
// periodic usage API requests and adjust our behavior if necessary
void ReconsiderSendingUsageRequests();
+ // consult policy to determine if we should send an unsolicited update
+ void MaybeEmitDataPlansUpdate();
+
DISALLOW_COPY_AND_ASSIGN(Service);
};
« no previous file with comments | « src/procfs_byte_counter_unittest.cc ('k') | src/service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698