OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium 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 CHROMEOS_NETWORK_NETWORK_CONNECTION_HANDLER_H_ | 5 #ifndef CHROMEOS_NETWORK_NETWORK_CONNECTION_HANDLER_H_ |
6 #define CHROMEOS_NETWORK_NETWORK_CONNECTION_HANDLER_H_ | 6 #define CHROMEOS_NETWORK_NETWORK_CONNECTION_HANDLER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 const std::string& service_path, | 186 const std::string& service_path, |
187 const std::string& error_name, | 187 const std::string& error_name, |
188 scoped_ptr<base::DictionaryValue> error_data); | 188 scoped_ptr<base::DictionaryValue> error_data); |
189 | 189 |
190 // Handles success or failure from Shill.Service.Connect. | 190 // Handles success or failure from Shill.Service.Connect. |
191 void HandleShillConnectSuccess(const std::string& service_path); | 191 void HandleShillConnectSuccess(const std::string& service_path); |
192 void HandleShillConnectFailure(const std::string& service_path, | 192 void HandleShillConnectFailure(const std::string& service_path, |
193 const std::string& error_name, | 193 const std::string& error_name, |
194 const std::string& error_message); | 194 const std::string& error_message); |
195 | 195 |
| 196 // Note: |service_path| is passed by value here, because in some cases |
| 197 // the value may be located in the map and then it can be deleted, producing |
| 198 // a reference to invalid memory. |
196 void CheckPendingRequest(const std::string service_path); | 199 void CheckPendingRequest(const std::string service_path); |
| 200 |
197 void CheckAllPendingRequests(); | 201 void CheckAllPendingRequests(); |
198 | 202 |
199 // Notify caller and observers that the connect request succeeded. | 203 // Notify caller and observers that the connect request succeeded. |
200 void InvokeConnectSuccessCallback(const std::string& service_path, | 204 void InvokeConnectSuccessCallback(const std::string& service_path, |
201 const base::Closure& success_callback); | 205 const base::Closure& success_callback); |
202 | 206 |
203 // Look up the ConnectRequest for |service_path| and call | 207 // Look up the ConnectRequest for |service_path| and call |
204 // InvokeConnectErrorCallback. | 208 // InvokeConnectErrorCallback. |
205 void ErrorCallbackForPendingRequest(const std::string& service_path, | 209 void ErrorCallbackForPendingRequest(const std::string& service_path, |
206 const std::string& error_name); | 210 const std::string& error_name); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 bool logged_in_; | 243 bool logged_in_; |
240 bool certificates_loaded_; | 244 bool certificates_loaded_; |
241 base::TimeTicks logged_in_time_; | 245 base::TimeTicks logged_in_time_; |
242 | 246 |
243 DISALLOW_COPY_AND_ASSIGN(NetworkConnectionHandler); | 247 DISALLOW_COPY_AND_ASSIGN(NetworkConnectionHandler); |
244 }; | 248 }; |
245 | 249 |
246 } // namespace chromeos | 250 } // namespace chromeos |
247 | 251 |
248 #endif // CHROMEOS_NETWORK_NETWORK_CONNECTION_HANDLER_H_ | 252 #endif // CHROMEOS_NETWORK_NETWORK_CONNECTION_HANDLER_H_ |
OLD | NEW |