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

Side by Side Diff: chrome/browser/chromeos/cros/sms_watcher.cc

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 unified diff | Download patch
OLDNEW
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 #include "chrome/browser/chromeos/cros/sms_watcher.h" 5 #include "chrome/browser/chromeos/cros/sms_watcher.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <deque> 8 #include <deque>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 dbus::ObjectPath(modem_device_path), 368 dbus::ObjectPath(modem_device_path),
369 base::Bind(&SMSWatcher::DevicePropertiesCallback, 369 base::Bind(&SMSWatcher::DevicePropertiesCallback,
370 weak_ptr_factory_.GetWeakPtr())); 370 weak_ptr_factory_.GetWeakPtr()));
371 } 371 }
372 372
373 SMSWatcher::~SMSWatcher() { 373 SMSWatcher::~SMSWatcher() {
374 } 374 }
375 375
376 void SMSWatcher::DevicePropertiesCallback( 376 void SMSWatcher::DevicePropertiesCallback(
377 DBusMethodCallStatus call_status, 377 DBusMethodCallStatus call_status,
378 const base::DictionaryValue& properties) { 378 scoped_ptr<base::DictionaryValue> properties) {
379 if (call_status != DBUS_METHOD_CALL_SUCCESS) 379 if (call_status != DBUS_METHOD_CALL_SUCCESS)
380 return; 380 return;
381 381
382 std::string dbus_connection; 382 std::string dbus_connection;
383 if (!properties.GetStringWithoutPathExpansion( 383 if (!properties->GetStringWithoutPathExpansion(
384 flimflam::kDBusConnectionProperty, &dbus_connection)) { 384 flimflam::kDBusConnectionProperty, &dbus_connection)) {
385 LOG(WARNING) << "Modem device properties do not include DBus connection."; 385 LOG(WARNING) << "Modem device properties do not include DBus connection.";
386 return; 386 return;
387 } 387 }
388 388
389 std::string object_path_string; 389 std::string object_path_string;
390 if (!properties.GetStringWithoutPathExpansion( 390 if (!properties->GetStringWithoutPathExpansion(
391 flimflam::kDBusObjectProperty, &object_path_string)) { 391 flimflam::kDBusObjectProperty, &object_path_string)) {
392 LOG(WARNING) << "Modem device properties do not include DBus object."; 392 LOG(WARNING) << "Modem device properties do not include DBus object.";
393 return; 393 return;
394 } 394 }
395 395
396 if (object_path_string.compare( 396 if (object_path_string.compare(
397 0, sizeof(modemmanager::kModemManager1ServicePath) - 1, 397 0, sizeof(modemmanager::kModemManager1ServicePath) - 1,
398 modemmanager::kModemManager1ServicePath) == 0) { 398 modemmanager::kModemManager1ServicePath) == 0) {
399 watcher_.reset( 399 watcher_.reset(
400 new ModemManager1Watcher(device_path_, callback_, dbus_connection, 400 new ModemManager1Watcher(device_path_, callback_, dbus_connection,
401 dbus::ObjectPath(object_path_string))); 401 dbus::ObjectPath(object_path_string)));
402 } else { 402 } else {
403 watcher_.reset( 403 watcher_.reset(
404 new GsmWatcher(device_path_, callback_, dbus_connection, 404 new GsmWatcher(device_path_, callback_, dbus_connection,
405 dbus::ObjectPath(object_path_string))); 405 dbus::ObjectPath(object_path_string)));
406 } 406 }
407 } 407 }
408 408
409 } // namespace chromeos 409 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698