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

Side by Side Diff: device/bluetooth/dbus/fake_bluetooth_profile_manager_client.cc

Issue 1347193004: Refactor DBusThreadManager to split away BT clients. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
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 "device/bluetooth/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"
11 #include "chromeos/dbus/fake_bluetooth_profile_service_provider.h"
12 #include "dbus/bus.h" 11 #include "dbus/bus.h"
13 #include "dbus/message.h" 12 #include "dbus/message.h"
14 #include "dbus/object_proxy.h" 13 #include "dbus/object_proxy.h"
14 #include "device/bluetooth/dbus/fake_bluetooth_profile_service_provider.h"
15 #include "third_party/cros_system_api/dbus/service_constants.h" 15 #include "third_party/cros_system_api/dbus/service_constants.h"
16 16
17 namespace chromeos { 17 namespace bluez {
18 18
19 const char FakeBluetoothProfileManagerClient::kL2capUuid[] = 19 const char FakeBluetoothProfileManagerClient::kL2capUuid[] =
20 "4d995052-33cc-4fdf-b446-75f32942a076"; 20 "4d995052-33cc-4fdf-b446-75f32942a076";
21 const char FakeBluetoothProfileManagerClient::kRfcommUuid[] = 21 const char FakeBluetoothProfileManagerClient::kRfcommUuid[] =
22 "3f6d6dbf-a6ad-45fc-9653-47dc912ef70e"; 22 "3f6d6dbf-a6ad-45fc-9653-47dc912ef70e";
23 const char FakeBluetoothProfileManagerClient::kUnregisterableUuid[] = 23 const char FakeBluetoothProfileManagerClient::kUnregisterableUuid[] =
24 "00000000-0000-0000-0000-000000000000"; 24 "00000000-0000-0000-0000-000000000000";
25 25
26 FakeBluetoothProfileManagerClient::FakeBluetoothProfileManagerClient() { 26 FakeBluetoothProfileManagerClient::FakeBluetoothProfileManagerClient() {}
27 }
28 27
29 FakeBluetoothProfileManagerClient::~FakeBluetoothProfileManagerClient() { 28 FakeBluetoothProfileManagerClient::~FakeBluetoothProfileManagerClient() {}
30 }
31 29
32 void FakeBluetoothProfileManagerClient::Init(dbus::Bus* bus) { 30 void FakeBluetoothProfileManagerClient::Init(dbus::Bus* bus) {}
33 }
34 31
35 void FakeBluetoothProfileManagerClient::RegisterProfile( 32 void FakeBluetoothProfileManagerClient::RegisterProfile(
36 const dbus::ObjectPath& profile_path, 33 const dbus::ObjectPath& profile_path,
37 const std::string& uuid, 34 const std::string& uuid,
38 const Options& options, 35 const Options& options,
39 const base::Closure& callback, 36 const base::Closure& callback,
40 const ErrorCallback& error_callback) { 37 const ErrorCallback& error_callback) {
41 VLOG(1) << "RegisterProfile: " << profile_path.value() << ": " << uuid; 38 VLOG(1) << "RegisterProfile: " << profile_path.value() << ": " << uuid;
42 39
43 if (uuid == kUnregisterableUuid) { 40 if (uuid == kUnregisterableUuid) {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 101
105 FakeBluetoothProfileServiceProvider* 102 FakeBluetoothProfileServiceProvider*
106 FakeBluetoothProfileManagerClient::GetProfileServiceProvider( 103 FakeBluetoothProfileManagerClient::GetProfileServiceProvider(
107 const std::string& uuid) { 104 const std::string& uuid) {
108 ProfileMap::iterator iter = profile_map_.find(uuid); 105 ProfileMap::iterator iter = profile_map_.find(uuid);
109 if (iter == profile_map_.end()) 106 if (iter == profile_map_.end())
110 return nullptr; 107 return nullptr;
111 return service_provider_map_[iter->second]; 108 return service_provider_map_[iter->second];
112 } 109 }
113 110
114 } // namespace chromeos 111 } // namespace bluez
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698