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

Unified Diff: chrome/browser/chromeos/cros/network_library.h

Issue 11367048: This is the first pass at making GetIPConfigs asynchronous. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 1 month 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
Index: chrome/browser/chromeos/cros/network_library.h
diff --git a/chrome/browser/chromeos/cros/network_library.h b/chrome/browser/chromeos/cros/network_library.h
index 5834154f73720d26cc3f80d448f8539b860a444b..9629abfac1d8723c22a3b3f9ffb3612d4e9527c3 100644
--- a/chrome/browser/chromeos/cros/network_library.h
+++ b/chrome/browser/chromeos/cros/network_library.h
@@ -602,8 +602,11 @@ class Network {
// Set the profile path and update the flimfalm property.
void SetProfilePath(const std::string& profile_path);
- // Initialize the IP address field
+ // Trigger an asynchronous initialization the IP address field.
void InitIPAddress();
+ // Initialize the IP address field.
+ void InitIPAddressCallback(const NetworkIPConfigVector& ip_configs,
+ const std::string& hardware_address);
// Priority value, corresponds to index in list from shill (0 = first)
int priority_order_;
@@ -637,6 +640,9 @@ class Network {
// Not all properties in this map are exposed via get methods.
PropertyMap property_map_;
+ // Weak pointer factory for wrapping pointers to this network in callbacks.
+ base::WeakPtrFactory<Network> weak_pointer_factory_;
+
DISALLOW_COPY_AND_ASSIGN(Network);
};
@@ -1208,9 +1214,6 @@ class WimaxNetwork : public WirelessNetwork {
std::string eap_identity_;
std::string eap_passphrase_;
- // Weak pointer factory for wrapping pointers to this network in callbacks.
- base::WeakPtrFactory<WimaxNetwork> weak_pointer_factory_;
-
DISALLOW_COPY_AND_ASSIGN(WimaxNetwork);
};
@@ -1691,11 +1694,18 @@ class NetworkLibrary {
// Enables/disables offline mode.
virtual void EnableOfflineMode(bool enable) = 0;
- // Fetches IP configs and hardware address for a given device_path.
- // The hardware address is usually a MAC address like "0011AA22BB33".
+ // Fetches IP configs and hardware address for a given device_path and returns
+ // them via the given callback.
+ virtual void GetIPConfigs(const std::string& device_path,
+ HardwareAddressFormat format,
+ const NetworkGetIPConfigsCallback& callback) = 0;
+
+ // DEPRECATED: DO NOT USE. Instead, use the asynchronous GetIPConfigs above.
+ // Fetches IP configs and hardware address for a given device_path. The
+ // hardware address is usually a MAC address like "0011AA22BB33".
// |hardware_address| will be an empty string, if no hardware address is
// found.
- virtual NetworkIPConfigVector GetIPConfigs(
+ virtual NetworkIPConfigVector GetIPConfigsAndBlock(
const std::string& device_path,
std::string* hardware_address,
HardwareAddressFormat) = 0;

Powered by Google App Engine
This is Rietveld 408576698