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

Side by Side Diff: src/cashew_server.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/Makefile.am ('k') | src/cashew_server.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef SRC_CASHEW_SERVER_H_ 5 #ifndef SRC_CASHEW_SERVER_H_
6 #define SRC_CASHEW_SERVER_H_ 6 #define SRC_CASHEW_SERVER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include <base/basictypes.h> // NOLINT 12 #include <base/basictypes.h> // NOLINT
13 #include <dbus-c++/dbus.h> // NOLINT 13 #include <dbus-c++/dbus.h> // NOLINT
14 14
15 #include "src/cashew_server_glue.h" 15 #include "src/cashew_server_glue.h"
16 #include "src/data_plan.h" 16 #include "src/data_plan.h"
17 #include "src/service.h" 17 #include "src/service.h"
18 #include "src/service_manager.h"
19 18
20 namespace cashew { 19 namespace cashew {
21 20
21 class ServiceManager;
22
22 // Implements Cashew D-Bus API 23 // Implements Cashew D-Bus API
23 class CashewServer : public org::chromium::Cashew_adaptor, 24 class CashewServer : public org::chromium::Cashew_adaptor,
24 public DBus::IntrospectableAdaptor, 25 public DBus::IntrospectableAdaptor,
25 public DBus::ObjectAdaptor { 26 public DBus::ObjectAdaptor {
26 public: 27 public:
27 CashewServer(DBus::Connection& connection, // NOLINT 28 CashewServer(DBus::Connection& connection, // NOLINT
28 const ServiceManager& service_manager); 29 ServiceManager * const service_manager);
29 virtual ~CashewServer(); 30 virtual ~CashewServer();
30 31
31 // Cashew D-Bus API methods 32 // Cashew D-Bus API methods
32 33
33 // Get data plan info for a cellular service 34 // Get data plan info for a cellular service
34 virtual DBusDataPlanList GetDataPlans(const std::string& service_path, 35 virtual DBusDataPlanList GetDataPlans(const std::string& service_path,
35 DBus::Error& error); // NOLINT 36 DBus::Error& error); // NOLINT
36 37
37 // Request that a DataPlansUpdate signal be sent for a cellular service 38 // Request that a DataPlansUpdate signal be sent for a cellular service
38 virtual void RequestDataPlansUpdate(const std::string& service_path, 39 virtual void RequestDataPlansUpdate(const std::string& service_path,
39 DBus::Error& error); // NOLINT 40 DBus::Error& error); // NOLINT
40 41
41 // Test method to verify that Cashew service is working 42 // Test method to verify that Cashew service is working
42 virtual bool IsAlive(DBus::Error& error); // NOLINT 43 virtual bool IsAlive(DBus::Error& error); // NOLINT
43 44
44 static const char* kServiceName; 45 static const char* kServiceName;
45 static const char* kServicePath; 46 static const char* kServicePath;
46 47
48 // Service Manager methods
49
50 // Service Manager wants us to emit an update for a Service
51 virtual void EmitDataPlansUpdate(const Service& service);
52
47 private: 53 private:
48 const ServiceManager& service_manager_; 54 ServiceManager * const service_manager_;
49 55
50 // Emit a DataPlansUpdate signal for a service 56 // Emit a DataPlansUpdate D-Bus signal for a service
51 void EmitDataPlansUpdateSignal(const Service& service); 57 void EmitDataPlansUpdateSignal(const Service& service);
52 58
53 DISALLOW_COPY_AND_ASSIGN(CashewServer); 59 DISALLOW_COPY_AND_ASSIGN(CashewServer);
54 }; 60 };
55 61
56 } // namespace cashew 62 } // namespace cashew
57 63
58 #endif // SRC_CASHEW_SERVER_H_ 64 #endif // SRC_CASHEW_SERVER_H_
OLDNEW
« no previous file with comments | « src/Makefile.am ('k') | src/cashew_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698