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

Side by Side Diff: chromeos_network.cc

Issue 2147006: Fix crashing bug where device_path is set to unknown. (Closed) Base URL: ssh://git@chromiumos-git//cros.git
Patch Set: Created 10 years, 7 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
« no previous file with comments | « chromeos_cros_api.h ('k') | no next file » | 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) 2009 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2009 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 #include "chromeos_network.h" // NOLINT 5 #include "chromeos_network.h" // NOLINT
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 #include <cstring> 9 #include <cstring>
10 10
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 default_bool = false; 346 default_bool = false;
347 properties.Retrieve(kAutoConnectProperty, &default_bool); 347 properties.Retrieve(kAutoConnectProperty, &default_bool);
348 info->auto_connect = default_bool; 348 info->auto_connect = default_bool;
349 349
350 // Device 350 // Device
351 glib::Value val; 351 glib::Value val;
352 if (properties.Retrieve(kDeviceProperty, &val)) { 352 if (properties.Retrieve(kDeviceProperty, &val)) {
353 const gchar* path = static_cast<const gchar*>(g_value_get_boxed (&val)); 353 const gchar* path = static_cast<const gchar*>(g_value_get_boxed (&val));
354 info->device_path = NewStringCopy(path); 354 info->device_path = NewStringCopy(path);
355 } else { 355 } else {
356 info->device_path = NewStringCopy(kUnknownString); 356 info->device_path = NULL;
357 } 357 }
358 } 358 }
359 359
360 // Returns a ServiceInfo object populated with data from a 360 // Returns a ServiceInfo object populated with data from a
361 // given DBus object path. 361 // given DBus object path.
362 // 362 //
363 // returns true on success. 363 // returns true on success.
364 bool ParseServiceInfo(const char* path, ServiceInfo *info) { 364 bool ParseServiceInfo(const char* path, ServiceInfo *info) {
365 dbus::Proxy service_proxy(dbus::GetSystemBusConnection(), 365 dbus::Proxy service_proxy(dbus::GetSystemBusConnection(),
366 kConnmanServiceName, 366 kConnmanServiceName,
(...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after
1268 } 1268 }
1269 1269
1270 extern "C" 1270 extern "C"
1271 bool ChromeOSSetCertPath(const char* service_path, const char* cert_path) { 1271 bool ChromeOSSetCertPath(const char* service_path, const char* cert_path) {
1272 return SetServiceStringProperty(service_path, kCertPathProperty, cert_path); 1272 return SetServiceStringProperty(service_path, kCertPathProperty, cert_path);
1273 } 1273 }
1274 1274
1275 1275
1276 1276
1277 } // namespace chromeos 1277 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos_cros_api.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698