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

Unified Diff: src/service_manager.h

Issue 3576011: Cashew: track cellular service state. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/cashew.git
Patch Set: Make debug logging less verbose 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/service.cc ('k') | src/service_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/service_manager.h
diff --git a/src/service_manager.h b/src/service_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..4eae79e54e1282366d440cbb9f9732d96c6be416
--- /dev/null
+++ b/src/service_manager.h
@@ -0,0 +1,73 @@
+// 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_SERVICE_MANAGER_H_
+#define SRC_SERVICE_MANAGER_H_
+
+#include <map>
+#include <string>
+#include <vector>
+
+#include <base/basictypes.h> // NOLINT
+#include <dbus-c++/dbus.h> // NOLINT
+
+#include "src/flimflam_manager_client_glue.h"
+
+namespace cashew {
+
+class Service;
+
+// map of service path names to Service objects
+typedef std::map<std::string, Service*> ServiceMap;
+
+// vector of DBus::Path objects (strings) representing service path names
+typedef std::vector<DBus::Path> ServicePathList;
+
+// monitors Flimflam and maintains a collection of cellular service objects
+class ServiceManager : public org::chromium::flimflam::Manager_proxy,
+ public DBus::IntrospectableProxy,
+ public DBus::ObjectProxy {
+ public:
+ explicit ServiceManager(DBus::Connection& connection); // NOLINT
+ virtual ~ServiceManager();
+
+ // look up a service by its path name
+ // returns NULL if service is not found
+ virtual const Service* GetService(const std::string& service_path) const;
+
+ // Flimflam Manager D-Bus Proxy methods
+
+ // receive incoming PropertyChanged D-Bus signal from Flimflam
+ virtual void PropertyChanged(const std::string& property_name,
+ const DBus::Variant& new_value);
+
+ // receive incoming StateChanged D-Bus signal from Flimflam
+ virtual void StateChanged(const std::string& new_state);
+
+ private:
+ // D-Bus connection owned by our creator
+ // shared with Service objs that we create
+ DBus::Connection& connection_;
+
+ // collection of Service objs representing cellular services
+ ServiceMap services_;
+
+ // delete a collection of services
+ void DeleteServices(ServiceMap *service_map);
+
+ // get Services info from Flimflam
+ void GetFlimflamServices();
+
+ // we've received updated Services info from Flimflam
+ void OnServicesUpdate(const ServicePathList& paths);
+
+ // Flimflam has started advertising a new service
+ void OnNewService(const DBus::Path& path);
+
+ DISALLOW_COPY_AND_ASSIGN(ServiceManager);
+};
+
+} // namespace cashew
+
+#endif // SRC_SERVICE_MANAGER_H_
« no previous file with comments | « src/service.cc ('k') | src/service_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698