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

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

Issue 1124883004: Submission for C++ Readability (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revert overrides Created 5 years, 5 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
« no previous file with comments | « no previous file | chromeos/dbus/fake_bluetooth_profile_service_provider.h » ('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 "base/location.h" 7 #include "base/location.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/thread_task_runner_handle.h" 10 #include "base/thread_task_runner_handle.h"
(...skipping 30 matching lines...) Expand all
41 VLOG(1) << "RegisterProfile: " << profile_path.value() << ": " << uuid; 41 VLOG(1) << "RegisterProfile: " << profile_path.value() << ": " << uuid;
42 42
43 if (uuid == kUnregisterableUuid) { 43 if (uuid == kUnregisterableUuid) {
44 base::ThreadTaskRunnerHandle::Get()->PostTask( 44 base::ThreadTaskRunnerHandle::Get()->PostTask(
45 FROM_HERE, base::Bind(error_callback, 45 FROM_HERE, base::Bind(error_callback,
46 bluetooth_profile_manager::kErrorInvalidArguments, 46 bluetooth_profile_manager::kErrorInvalidArguments,
47 "Can't register this UUID")); 47 "Can't register this UUID"));
48 return; 48 return;
49 } 49 }
50 50
51 // check options for channel & psm 51 // TODO(jamuraa): check options for channel & psm
52 52
53 ServiceProviderMap::iterator iter = service_provider_map_.find(profile_path); 53 ServiceProviderMap::iterator iter = service_provider_map_.find(profile_path);
54 if (iter == service_provider_map_.end()) { 54 if (iter == service_provider_map_.end()) {
55 error_callback.Run(bluetooth_profile_manager::kErrorInvalidArguments, 55 error_callback.Run(bluetooth_profile_manager::kErrorInvalidArguments,
56 "No profile created"); 56 "No profile created");
57 } else { 57 } else {
58 ProfileMap::iterator piter = profile_map_.find(uuid); 58 ProfileMap::iterator piter = profile_map_.find(uuid);
59 if (piter != profile_map_.end()) { 59 if (piter != profile_map_.end()) {
60 error_callback.Run(bluetooth_profile_manager::kErrorAlreadyExists, 60 error_callback.Run(bluetooth_profile_manager::kErrorAlreadyExists,
61 "Profile already registered"); 61 "Profile already registered");
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 service_provider_map_.find(service_provider->object_path_); 100 service_provider_map_.find(service_provider->object_path_);
101 if (iter != service_provider_map_.end() && iter->second == service_provider) 101 if (iter != service_provider_map_.end() && iter->second == service_provider)
102 service_provider_map_.erase(iter); 102 service_provider_map_.erase(iter);
103 } 103 }
104 104
105 FakeBluetoothProfileServiceProvider* 105 FakeBluetoothProfileServiceProvider*
106 FakeBluetoothProfileManagerClient::GetProfileServiceProvider( 106 FakeBluetoothProfileManagerClient::GetProfileServiceProvider(
107 const std::string& uuid) { 107 const std::string& uuid) {
108 ProfileMap::iterator iter = profile_map_.find(uuid); 108 ProfileMap::iterator iter = profile_map_.find(uuid);
109 if (iter == profile_map_.end()) 109 if (iter == profile_map_.end())
110 return NULL; 110 return nullptr;
111 return service_provider_map_[iter->second]; 111 return service_provider_map_[iter->second];
112 } 112 }
113 113
114 } // namespace chromeos 114 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chromeos/dbus/fake_bluetooth_profile_service_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698