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

Unified Diff: flimflam_proxy.h

Issue 4029002: AU: Don't use network on expensive connection types (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: 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 | « dbus_interface.h ('k') | flimflam_proxy.cc » ('j') | flimflam_proxy.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: flimflam_proxy.h
diff --git a/flimflam_proxy.h b/flimflam_proxy.h
new file mode 100644
index 0000000000000000000000000000000000000000..d5e5ff7e38db3557a92de3de955d997820aa5782
--- /dev/null
+++ b/flimflam_proxy.h
@@ -0,0 +1,53 @@
+// 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 CHROMEOS_PLATFORM_UPDATE_ENGINE_FLIMFLAM_PROXY_H__
+#define CHROMEOS_PLATFORM_UPDATE_ENGINE_FLIMFLAM_PROXY_H__
+
+// This class interfaces with FlimFlam to find out data about connectivity.
+
+#include <base/basictypes.h>
+
+#include "update_engine/dbus_interface.h"
+
+namespace chromeos_update_engine {
+
+extern const char* kFlimFlamDbusService;
+extern const char* kFlimFlamDbusManagerInterface;
+extern const char* kFlimFlamDbusManagerPath;
+extern const char* kFlimFlamDbusServiceInterface;
+
+extern const char* kFlimFlamNetTypeEthernet;
+extern const char* kFlimFlamNetTypeWifi;
+extern const char* kFlimFlamNetTypeWimax;
+extern const char* kFlimFlamNetTypeBluetooth;
+extern const char* kFlimFlamNetTypeCellular;
+
+enum NetworkConnectionType {
+ kNetEthernet = 0,
+ kNetWifi,
+ kNetWimax,
+ kNetBluetooth,
+ kNetCellular,
+ kNetUnknown
+};
+
+class FlimFlamProxy {
+ public:
+ static bool GetConnectionType(DbusGlibInterface* dbus_iface,
+ NetworkConnectionType* out_type);
+
+ static bool IsExpensiveConnectionType(NetworkConnectionType type) {
+ return type == kNetWimax || type == kNetBluetooth || type == kNetCellular;
+ }
+ static const char* StringForConnectionType(NetworkConnectionType type);
+
+ private:
+ // Should never be allocated
+ DISALLOW_IMPLICIT_CONSTRUCTORS(FlimFlamProxy);
+};
+
+} // namespace chromeos_update_engine
+
+#endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_FLIMFLAM_PROXY_H__
« no previous file with comments | « dbus_interface.h ('k') | flimflam_proxy.cc » ('j') | flimflam_proxy.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698