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

Unified Diff: src/policy.h

Issue 3528016: Cashew: implement backend usage API (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/cashew.git
Patch Set: Fix code review nits and remove hardcoded usage URLs Created 10 years, 2 months 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/main.cc ('k') | src/policy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/policy.h
diff --git a/src/policy.h b/src/policy.h
new file mode 100644
index 0000000000000000000000000000000000000000..76031094f0ef0ffd64323db760ffeb7afe825690
--- /dev/null
+++ b/src/policy.h
@@ -0,0 +1,42 @@
+// Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SRC_POLICY_H_
+#define SRC_POLICY_H_
+
+#include <glib.h>
+
+#include <string>
+
+#include "src/data_plan.h"
+
+namespace cashew {
+
+// interface for carrier policy
+class Policy {
+ public:
+ virtual ~Policy() {}
+
+ // what carrier is associated with this policy?
+ virtual const std::string& GetCarrier() const = 0;
+
+ // how often should a service request updates via the carrier usage API?
+ // return value is in seconds
+ virtual guint GetUpdateTimerIdleSecs(const DataPlanList& plans) const = 0;
+
+ // should we emit a data plans update for the change from |old_plans|
+ // to |new_plans|?
+ // NOTE: user might also want to influence this from the Chrome side
+ virtual bool ShouldEmitDataPlansUpdate(const DataPlanList& old_plans,
+ const DataPlanList& new_plans) const = 0;
+
+ // factory
+ // return appropriate concrete impl for |carrier|
+ // caller owns returned Policy and is responsible for deleting it
+ static Policy* GetPolicy(const std::string& carrier);
+};
+
+} // namespace cashew
+
+#endif // SRC_POLICY_H_
« no previous file with comments | « src/main.cc ('k') | src/policy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698