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

Unified Diff: src/cashew_server.h

Issue 3595001: D-Bus API: Add GetDataPlans, DataPlansUpdate, and RequestDataPlansUpdate (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/cashew.git
Patch Set: Refactor cashew.xml. Get rid of CreateDBusVariant. Tweak comments. Created 10 years, 3 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 | « introspection/cashew.xml ('k') | src/cashew_server.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/cashew_server.h
diff --git a/src/cashew_server.h b/src/cashew_server.h
index 1abc1605c6f1fbbc1082fd8a95f763c6d6dc4a36..7bfc5bd49c08a71d757798f764c568664ddf7ca7 100644
--- a/src/cashew_server.h
+++ b/src/cashew_server.h
@@ -5,13 +5,20 @@
#ifndef SRC_CASHEW_SERVER_H_
#define SRC_CASHEW_SERVER_H_
-#include <base/basictypes.h>
-#include <dbus-c++/dbus.h>
+#include <map>
+#include <string>
+#include <vector>
+
+#include <base/basictypes.h> // NOLINT
+#include <dbus-c++/dbus.h> // NOLINT
#include "src/cashew_server_glue.h"
namespace cashew {
+typedef std::map<std::string, DBus::Variant> DataPlan;
+typedef std::vector<DataPlan> DataPlanList;
+
// Implements Cashew D-Bus API
class CashewServer : public org::chromium::Cashew_adaptor,
public DBus::IntrospectableAdaptor,
@@ -21,14 +28,28 @@ class CashewServer : public org::chromium::Cashew_adaptor,
virtual ~CashewServer() {}
// Cashew D-Bus API methods
- // TODO(vlaviano): add real API methods
+ // Get data plan info for a cellular service
+ virtual DataPlanList GetDataPlans(const std::string& service,
+ DBus::Error& error); // NOLINT
+
+ // Request that a DataPlansUpdate signal be sent for a cellular service
+ virtual void RequestDataPlansUpdate(const std::string& service,
+ DBus::Error& error); // NOLINT
+
+ // Test method to verify that Cashew service is working
virtual bool IsAlive(DBus::Error& error); // NOLINT
static const char* kServiceName;
static const char* kServicePath;
private:
+ // Emit a DataPlansUpdate signal for a service
+ void EmitDataPlansUpdateSignal(const std::string& service);
+
+ // Fill in data plan with hardcoded data for testing
+ void GetHardcodedDataPlan(DataPlan* data_plan);
+
DISALLOW_COPY_AND_ASSIGN(CashewServer);
};
« no previous file with comments | « introspection/cashew.xml ('k') | src/cashew_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698