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

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

Issue 276573004: Bluetooth: Implement new socket API for Chrome OS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix DCHECK nits Created 6 years, 7 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
« no previous file with comments | « chromeos/dbus/bluetooth_profile_manager_client.cc ('k') | device/bluetooth/bluetooth.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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_bluetooth_profile_manager_client.h" 5 #include "chromeos/dbus/fake_bluetooth_profile_manager_client.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 } 58 }
59 } 59 }
60 60
61 void FakeBluetoothProfileManagerClient::UnregisterProfile( 61 void FakeBluetoothProfileManagerClient::UnregisterProfile(
62 const dbus::ObjectPath& profile_path, 62 const dbus::ObjectPath& profile_path,
63 const base::Closure& callback, 63 const base::Closure& callback,
64 const ErrorCallback& error_callback) { 64 const ErrorCallback& error_callback) {
65 VLOG(1) << "UnregisterProfile: " << profile_path.value(); 65 VLOG(1) << "UnregisterProfile: " << profile_path.value();
66 66
67 ServiceProviderMap::iterator iter = service_provider_map_.find(profile_path); 67 ServiceProviderMap::iterator iter = service_provider_map_.find(profile_path);
68 if (iter != service_provider_map_.end()) { 68 if (iter == service_provider_map_.end()) {
69 error_callback.Run(bluetooth_profile_manager::kErrorInvalidArguments, 69 error_callback.Run(bluetooth_profile_manager::kErrorInvalidArguments,
70 "Profile still registered"); 70 "Profile not registered");
71 } else { 71 } else {
72 for (ProfileMap::iterator piter = profile_map_.begin(); 72 for (ProfileMap::iterator piter = profile_map_.begin();
73 piter != profile_map_.end(); ++piter) { 73 piter != profile_map_.end(); ++piter) {
74 if (piter->second == profile_path) { 74 if (piter->second == profile_path) {
75 profile_map_.erase(piter); 75 profile_map_.erase(piter);
76 break; 76 break;
77 } 77 }
78 } 78 }
79 79
80 callback.Run(); 80 callback.Run();
(...skipping 16 matching lines...) Expand all
97 FakeBluetoothProfileServiceProvider* 97 FakeBluetoothProfileServiceProvider*
98 FakeBluetoothProfileManagerClient::GetProfileServiceProvider( 98 FakeBluetoothProfileManagerClient::GetProfileServiceProvider(
99 const std::string& uuid) { 99 const std::string& uuid) {
100 ProfileMap::iterator iter = profile_map_.find(uuid); 100 ProfileMap::iterator iter = profile_map_.find(uuid);
101 if (iter == profile_map_.end()) 101 if (iter == profile_map_.end())
102 return NULL; 102 return NULL;
103 return service_provider_map_[iter->second]; 103 return service_provider_map_[iter->second];
104 } 104 }
105 105
106 } // namespace chromeos 106 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/bluetooth_profile_manager_client.cc ('k') | device/bluetooth/bluetooth.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698