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

Side by Side Diff: chromeos/dbus/shill_profile_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_profile_client.h" 5 #include "chromeos/dbus/shill_profile_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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 virtual void DeleteEntry(const dbus::ObjectPath& profile_path, 161 virtual void DeleteEntry(const dbus::ObjectPath& profile_path,
162 const std::string& entry_path, 162 const std::string& entry_path,
163 const base::Closure& callback, 163 const base::Closure& callback,
164 const ErrorCallback& error_callback) OVERRIDE { 164 const ErrorCallback& error_callback) OVERRIDE {
165 MessageLoop::current()->PostTask(FROM_HERE, callback); 165 MessageLoop::current()->PostTask(FROM_HERE, callback);
166 } 166 }
167 167
168 private: 168 private:
169 void PassEmptyDictionaryValue( 169 void PassEmptyDictionaryValue(
170 const DictionaryValueCallbackWithoutStatus& callback) const { 170 const DictionaryValueCallbackWithoutStatus& callback) const {
171 base::DictionaryValue dictionary; 171 scoped_ptr<base::DictionaryValue> empty(new base::DictionaryValue);
172 callback.Run(dictionary); 172 callback.Run(empty.Pass());
173 } 173 }
174 174
175 // Note: This should remain the last member so it'll be destroyed and 175 // Note: This should remain the last member so it'll be destroyed and
176 // invalidate its weak pointers before any other members are destroyed. 176 // invalidate its weak pointers before any other members are destroyed.
177 base::WeakPtrFactory<ShillProfileClientStubImpl> weak_ptr_factory_; 177 base::WeakPtrFactory<ShillProfileClientStubImpl> weak_ptr_factory_;
178 178
179 DISALLOW_COPY_AND_ASSIGN(ShillProfileClientStubImpl); 179 DISALLOW_COPY_AND_ASSIGN(ShillProfileClientStubImpl);
180 }; 180 };
181 181
182 } // namespace 182 } // namespace
183 183
184 ShillProfileClient::ShillProfileClient() {} 184 ShillProfileClient::ShillProfileClient() {}
185 185
186 ShillProfileClient::~ShillProfileClient() {} 186 ShillProfileClient::~ShillProfileClient() {}
187 187
188 // static 188 // static
189 ShillProfileClient* ShillProfileClient::Create( 189 ShillProfileClient* ShillProfileClient::Create(
190 DBusClientImplementationType type, 190 DBusClientImplementationType type,
191 dbus::Bus* bus) { 191 dbus::Bus* bus) {
192 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) 192 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION)
193 return new ShillProfileClientImpl(bus); 193 return new ShillProfileClientImpl(bus);
194 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); 194 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type);
195 return new ShillProfileClientStubImpl(); 195 return new ShillProfileClientStubImpl();
196 } 196 }
197 197
198 } // namespace chromeos 198 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698