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

Side by Side Diff: chromeos/dbus/shill_network_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_network_client.h" 5 #include "chromeos/dbus/shill_network_client.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop.h" 8 #include "base/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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 callback)); 108 callback));
109 } 109 }
110 110
111 virtual base::DictionaryValue* CallGetPropertiesAndBlock( 111 virtual base::DictionaryValue* CallGetPropertiesAndBlock(
112 const dbus::ObjectPath& network_path) OVERRIDE { 112 const dbus::ObjectPath& network_path) OVERRIDE {
113 return new base::DictionaryValue; 113 return new base::DictionaryValue;
114 } 114 }
115 115
116 private: 116 private:
117 void PassEmptyDictionaryValue(const DictionaryValueCallback& callback) const { 117 void PassEmptyDictionaryValue(const DictionaryValueCallback& callback) const {
118 base::DictionaryValue dictionary; 118 scoped_ptr<base::DictionaryValue> empty(new base::DictionaryValue);
119 callback.Run(DBUS_METHOD_CALL_SUCCESS, dictionary); 119 callback.Run(DBUS_METHOD_CALL_SUCCESS, empty.Pass());
120 } 120 }
121 121
122 // Note: This should remain the last member so it'll be destroyed and 122 // Note: This should remain the last member so it'll be destroyed and
123 // invalidate its weak pointers before any other members are destroyed. 123 // invalidate its weak pointers before any other members are destroyed.
124 base::WeakPtrFactory<ShillNetworkClientStubImpl> weak_ptr_factory_; 124 base::WeakPtrFactory<ShillNetworkClientStubImpl> weak_ptr_factory_;
125 125
126 DISALLOW_COPY_AND_ASSIGN(ShillNetworkClientStubImpl); 126 DISALLOW_COPY_AND_ASSIGN(ShillNetworkClientStubImpl);
127 }; 127 };
128 128
129 } // namespace 129 } // namespace
130 130
131 ShillNetworkClient::ShillNetworkClient() {} 131 ShillNetworkClient::ShillNetworkClient() {}
132 132
133 ShillNetworkClient::~ShillNetworkClient() {} 133 ShillNetworkClient::~ShillNetworkClient() {}
134 134
135 // static 135 // static
136 ShillNetworkClient* ShillNetworkClient::Create( 136 ShillNetworkClient* ShillNetworkClient::Create(
137 DBusClientImplementationType type, 137 DBusClientImplementationType type,
138 dbus::Bus* bus) { 138 dbus::Bus* bus) {
139 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) 139 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION)
140 return new ShillNetworkClientImpl(bus); 140 return new ShillNetworkClientImpl(bus);
141 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); 141 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type);
142 return new ShillNetworkClientStubImpl(); 142 return new ShillNetworkClientStubImpl();
143 } 143 }
144 144
145 } // namespace chromeos 145 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698