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

Side by Side Diff: chromeos/dbus/shill_manager_client.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 "chromeos/dbus/shill_manager_client.h" 5 #include "chromeos/dbus/shill_manager_client.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/chromeos/chromeos_version.h" 8 #include "base/chromeos/chromeos_version.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 AddService("stub_wifi2", true); 355 AddService("stub_wifi2", true);
356 AddService("stub_cellular1", true); 356 AddService("stub_cellular1", true);
357 357
358 // Stub Technologies 358 // Stub Technologies
359 AddTechnology(flimflam::kTypeEthernet, true); 359 AddTechnology(flimflam::kTypeEthernet, true);
360 AddTechnology(flimflam::kTypeWifi, true); 360 AddTechnology(flimflam::kTypeWifi, true);
361 AddTechnology(flimflam::kTypeCellular, true); 361 AddTechnology(flimflam::kTypeCellular, true);
362 } 362 }
363 363
364 void PassStubProperties(const DictionaryValueCallback& callback) const { 364 void PassStubProperties(const DictionaryValueCallback& callback) const {
365 callback.Run(DBUS_METHOD_CALL_SUCCESS, stub_properties_); 365 scoped_ptr<base::DictionaryValue> properties_copy(
366 stub_properties_.DeepCopy());
367 callback.Run(DBUS_METHOD_CALL_SUCCESS, properties_copy.Pass());
366 } 368 }
367 369
368 void NotifyObserversPropertyChanged(const std::string& property) { 370 void NotifyObserversPropertyChanged(const std::string& property) {
369 base::Value* value = NULL; 371 base::Value* value = NULL;
370 if (!stub_properties_.GetWithoutPathExpansion(property, &value)) { 372 if (!stub_properties_.GetWithoutPathExpansion(property, &value)) {
371 LOG(ERROR) << "Notify for unknown property: " << property; 373 LOG(ERROR) << "Notify for unknown property: " << property;
372 return; 374 return;
373 } 375 }
374 FOR_EACH_OBSERVER(ShillPropertyChangedObserver, 376 FOR_EACH_OBSERVER(ShillPropertyChangedObserver,
375 observer_list_, 377 observer_list_,
(...skipping 30 matching lines...) Expand all
406 ShillManagerClient* ShillManagerClient::Create( 408 ShillManagerClient* ShillManagerClient::Create(
407 DBusClientImplementationType type, 409 DBusClientImplementationType type,
408 dbus::Bus* bus) { 410 dbus::Bus* bus) {
409 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) 411 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION)
410 return new ShillManagerClientImpl(bus); 412 return new ShillManagerClientImpl(bus);
411 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); 413 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type);
412 return new ShillManagerClientStubImpl(); 414 return new ShillManagerClientStubImpl();
413 } 415 }
414 416
415 } // namespace chromeos 417 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698