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

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

Issue 181413006: Replace misc. network stub flags with more flexible ones (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Elim. shill_stub_helper and move functions to clients. Created 6 years, 9 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 | Annotate | Revision Log
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_device_client.h" 5 #include "chromeos/dbus/fake_shill_device_client.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 weak_ptr_factory_(this) { 45 weak_ptr_factory_(this) {
46 } 46 }
47 47
48 FakeShillDeviceClient::~FakeShillDeviceClient() { 48 FakeShillDeviceClient::~FakeShillDeviceClient() {
49 STLDeleteContainerPairSecondPointers( 49 STLDeleteContainerPairSecondPointers(
50 observer_list_.begin(), observer_list_.end()); 50 observer_list_.begin(), observer_list_.end());
51 } 51 }
52 52
53 // ShillDeviceClient overrides. 53 // ShillDeviceClient overrides.
54 54
55 void FakeShillDeviceClient::Init(dbus::Bus* bus) {} 55 void FakeShillDeviceClient::Init(dbus::Bus* bus) {
56 // Note: FakeShillManagerClient sets up default devices before this is called.
57 }
56 58
57 void FakeShillDeviceClient::AddPropertyChangedObserver( 59 void FakeShillDeviceClient::AddPropertyChangedObserver(
58 const dbus::ObjectPath& device_path, 60 const dbus::ObjectPath& device_path,
59 ShillPropertyChangedObserver* observer) { 61 ShillPropertyChangedObserver* observer) {
60 GetObserverList(device_path).AddObserver(observer); 62 GetObserverList(device_path).AddObserver(observer);
61 } 63 }
62 64
63 void FakeShillDeviceClient::RemovePropertyChangedObserver( 65 void FakeShillDeviceClient::RemovePropertyChangedObserver(
64 const dbus::ObjectPath& device_path, 66 const dbus::ObjectPath& device_path,
65 ShillPropertyChangedObserver* observer) { 67 ShillPropertyChangedObserver* observer) {
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 std::map<dbus::ObjectPath, PropertyObserverList*>::iterator iter = 356 std::map<dbus::ObjectPath, PropertyObserverList*>::iterator iter =
355 observer_list_.find(device_path); 357 observer_list_.find(device_path);
356 if (iter != observer_list_.end()) 358 if (iter != observer_list_.end())
357 return *(iter->second); 359 return *(iter->second);
358 PropertyObserverList* observer_list = new PropertyObserverList(); 360 PropertyObserverList* observer_list = new PropertyObserverList();
359 observer_list_[device_path] = observer_list; 361 observer_list_[device_path] = observer_list;
360 return *observer_list; 362 return *observer_list;
361 } 363 }
362 364
363 } // namespace chromeos 365 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698