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

Side by Side Diff: chromeos/dbus/fake_shill_service_client.cc

Issue 2911033002: Remove raw base::DictionaryValue::Set (Closed)
Patch Set: Proper Windows Fix Created 3 years, 6 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/fake_shill_service_client.h" 5 #include "chromeos/dbus/fake_shill_service_client.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 for (auto& observer : GetObserverList(service_path)) 527 for (auto& observer : GetObserverList(service_path))
528 observer.OnPropertyChanged(property, *value); 528 observer.OnPropertyChanged(property, *value);
529 } 529 }
530 530
531 base::DictionaryValue* FakeShillServiceClient::GetModifiableServiceProperties( 531 base::DictionaryValue* FakeShillServiceClient::GetModifiableServiceProperties(
532 const std::string& service_path, bool create_if_missing) { 532 const std::string& service_path, bool create_if_missing) {
533 base::DictionaryValue* properties = NULL; 533 base::DictionaryValue* properties = NULL;
534 if (!stub_services_.GetDictionaryWithoutPathExpansion(service_path, 534 if (!stub_services_.GetDictionaryWithoutPathExpansion(service_path,
535 &properties) && 535 &properties) &&
536 create_if_missing) { 536 create_if_missing) {
537 properties = new base::DictionaryValue; 537 properties = stub_services_.SetDictionary(
538 stub_services_.Set(service_path, properties); 538 service_path, base::MakeUnique<base::DictionaryValue>());
539 } 539 }
540 return properties; 540 return properties;
541 } 541 }
542 542
543 FakeShillServiceClient::PropertyObserverList& 543 FakeShillServiceClient::PropertyObserverList&
544 FakeShillServiceClient::GetObserverList(const dbus::ObjectPath& device_path) { 544 FakeShillServiceClient::GetObserverList(const dbus::ObjectPath& device_path) {
545 auto iter = observer_list_.find(device_path); 545 auto iter = observer_list_.find(device_path);
546 if (iter != observer_list_.end()) 546 if (iter != observer_list_.end())
547 return *(iter->second); 547 return *(iter->second);
548 PropertyObserverList* observer_list = new PropertyObserverList(); 548 PropertyObserverList* observer_list = new PropertyObserverList();
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 base::Value(shill::kErrorBadPassphrase))); 623 base::Value(shill::kErrorBadPassphrase)));
624 } else { 624 } else {
625 // Set Online. 625 // Set Online.
626 VLOG(1) << "Setting state to Online " << service_path; 626 VLOG(1) << "Setting state to Online " << service_path;
627 SetServiceProperty(service_path, shill::kStateProperty, 627 SetServiceProperty(service_path, shill::kStateProperty,
628 base::Value(shill::kStateOnline)); 628 base::Value(shill::kStateOnline));
629 } 629 }
630 } 630 }
631 631
632 } // namespace chromeos 632 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromecast/browser/cast_net_log.cc ('k') | chromeos/network/network_configuration_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698