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

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

Issue 1947173002: Update //device/bluetooth/dbus code to match cros_system_api constants. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "device/bluetooth/dbus/bluetooth_gatt_manager_client.h" 5 #include "device/bluetooth/dbus/bluetooth_gatt_manager_client.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_forward.h" 8 #include "base/callback_forward.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 17 matching lines...) Expand all
28 ~BluetoothGattManagerClientImpl() override {} 28 ~BluetoothGattManagerClientImpl() override {}
29 29
30 // BluetoothGattManagerClient override. 30 // BluetoothGattManagerClient override.
31 void RegisterApplication(const dbus::ObjectPath& adapter_object_path, 31 void RegisterApplication(const dbus::ObjectPath& adapter_object_path,
32 const dbus::ObjectPath& application_path, 32 const dbus::ObjectPath& application_path,
33 const Options& options, 33 const Options& options,
34 const base::Closure& callback, 34 const base::Closure& callback,
35 const ErrorCallback& error_callback) override { 35 const ErrorCallback& error_callback) override {
36 dbus::MethodCall method_call( 36 dbus::MethodCall method_call(
37 bluetooth_gatt_manager::kBluetoothGattManagerInterface, 37 bluetooth_gatt_manager::kBluetoothGattManagerInterface,
38 bluetooth_gatt_manager::kRegisterService); 38 bluetooth_gatt_manager::kRegisterApplication);
39 39
40 dbus::MessageWriter writer(&method_call); 40 dbus::MessageWriter writer(&method_call);
41 writer.AppendObjectPath(application_path); 41 writer.AppendObjectPath(application_path);
42 42
43 // The parameters of the Options dictionary are undefined but the method 43 // The parameters of the Options dictionary are undefined but the method
44 // signature still requires a value dictionary. Pass an empty dictionary 44 // signature still requires a value dictionary. Pass an empty dictionary
45 // and fill in the contents later if and when we add any options. 45 // and fill in the contents later if and when we add any options.
46 dbus::MessageWriter array_writer(NULL); 46 dbus::MessageWriter array_writer(NULL);
47 writer.OpenArray("{sv}", &array_writer); 47 writer.OpenArray("{sv}", &array_writer);
48 writer.CloseContainer(&array_writer); 48 writer.CloseContainer(&array_writer);
(...skipping 10 matching lines...) Expand all
59 weak_ptr_factory_.GetWeakPtr(), error_callback)); 59 weak_ptr_factory_.GetWeakPtr(), error_callback));
60 } 60 }
61 61
62 // BluetoothGattManagerClient override. 62 // BluetoothGattManagerClient override.
63 void UnregisterApplication(const dbus::ObjectPath& adapter_object_path, 63 void UnregisterApplication(const dbus::ObjectPath& adapter_object_path,
64 const dbus::ObjectPath& application_path, 64 const dbus::ObjectPath& application_path,
65 const base::Closure& callback, 65 const base::Closure& callback,
66 const ErrorCallback& error_callback) override { 66 const ErrorCallback& error_callback) override {
67 dbus::MethodCall method_call( 67 dbus::MethodCall method_call(
68 bluetooth_gatt_manager::kBluetoothGattManagerInterface, 68 bluetooth_gatt_manager::kBluetoothGattManagerInterface,
69 bluetooth_gatt_manager::kUnregisterService); 69 bluetooth_gatt_manager::kUnregisterApplication);
70 70
71 dbus::MessageWriter writer(&method_call); 71 dbus::MessageWriter writer(&method_call);
72 writer.AppendObjectPath(application_path); 72 writer.AppendObjectPath(application_path);
73 73
74 DCHECK(object_manager_); 74 DCHECK(object_manager_);
75 dbus::ObjectProxy* object_proxy = 75 dbus::ObjectProxy* object_proxy =
76 object_manager_->GetObjectProxy(adapter_object_path); 76 object_manager_->GetObjectProxy(adapter_object_path);
77 DCHECK(object_proxy); 77 DCHECK(object_proxy);
78 object_proxy->CallMethodWithErrorCallback( 78 object_proxy->CallMethodWithErrorCallback(
79 &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, 79 &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 BluetoothGattManagerClient::BluetoothGattManagerClient() {} 132 BluetoothGattManagerClient::BluetoothGattManagerClient() {}
133 133
134 BluetoothGattManagerClient::~BluetoothGattManagerClient() {} 134 BluetoothGattManagerClient::~BluetoothGattManagerClient() {}
135 135
136 // static 136 // static
137 BluetoothGattManagerClient* BluetoothGattManagerClient::Create() { 137 BluetoothGattManagerClient* BluetoothGattManagerClient::Create() {
138 return new BluetoothGattManagerClientImpl(); 138 return new BluetoothGattManagerClientImpl();
139 } 139 }
140 140
141 } // namespace bluez 141 } // namespace bluez
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698