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

Side by Side Diff: chromeos/dbus/fake_bluetooth_profile_service_provider.h

Issue 1124883004: Submission for C++ Readability (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
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 #ifndef CHROMEOS_DBUS_FAKE_BLUETOOTH_PROFILE_SERVICE_PROVIDER_H_ 5 #ifndef CHROMEOS_DBUS_FAKE_BLUETOOTH_PROFILE_SERVICE_PROVIDER_H_
6 #define CHROMEOS_DBUS_FAKE_BLUETOOTH_PROFILE_SERVICE_PROVIDER_H_ 6 #define CHROMEOS_DBUS_FAKE_BLUETOOTH_PROFILE_SERVICE_PROVIDER_H_
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "chromeos/chromeos_export.h" 11 #include "chromeos/chromeos_export.h"
12 #include "chromeos/dbus/bluetooth_profile_service_provider.h" 12 #include "chromeos/dbus/bluetooth_profile_service_provider.h"
13 #include "dbus/file_descriptor.h" 13 #include "dbus/file_descriptor.h"
14 #include "dbus/object_path.h" 14 #include "dbus/object_path.h"
15 15
16 namespace chromeos { 16 namespace chromeos {
17 17
18 // FakeBluetoothProfileServiceProvider simulates the behavior of a local 18 // FakeBluetoothProfileServiceProvider simulates the behavior of a local
19 // Bluetooth agent object and is used both in test cases in place of a 19 // Bluetooth agent object and is used both in test cases in place of a
20 // mock and on the Linux desktop. 20 // mock and on the Linux desktop.
omoikane 2015/05/22 23:55:27 Please also include some comments to document thre
Marie Janssen 2015/06/18 21:08:34 In general, classes in the device tree in Chromium
21 class CHROMEOS_EXPORT FakeBluetoothProfileServiceProvider 21 class CHROMEOS_EXPORT FakeBluetoothProfileServiceProvider
22 : public BluetoothProfileServiceProvider { 22 : public BluetoothProfileServiceProvider {
23 public: 23 public:
24 FakeBluetoothProfileServiceProvider(const dbus::ObjectPath& object_path, 24 FakeBluetoothProfileServiceProvider(const dbus::ObjectPath& object_path,
25 Delegate *delegate); 25 Delegate *delegate);
omoikane 2015/05/22 23:55:27 This pointer has the space before '*', while the p
Marie Janssen 2015/06/18 21:08:34 Done.
26 ~FakeBluetoothProfileServiceProvider() override; 26 ~FakeBluetoothProfileServiceProvider() override;
27 27
28 // Each of these calls the equivalent 28 // Each of these calls the equivalent
29 // BluetoothProfileServiceProvider::Delegate method on the object passed on 29 // BluetoothProfileServiceProvider::Delegate method on the object passed on
30 // construction. 30 // construction.
31 virtual void Release(); 31 virtual void Release();
omoikane 2015/05/22 23:55:27 "override" is preferred over "virtual" for inherit
Marie Janssen 2015/06/18 21:08:35 Done.
32 virtual void NewConnection( 32 virtual void NewConnection(
33 const dbus::ObjectPath& device_path, 33 const dbus::ObjectPath& device_path,
34 scoped_ptr<dbus::FileDescriptor> fd, 34 scoped_ptr<dbus::FileDescriptor> fd,
35 const Delegate::Options& options, 35 const Delegate::Options& options,
36 const Delegate::ConfirmationCallback& callback); 36 const Delegate::ConfirmationCallback& callback);
37 virtual void RequestDisconnection( 37 virtual void RequestDisconnection(
38 const dbus::ObjectPath& device_path, 38 const dbus::ObjectPath& device_path,
39 const Delegate::ConfirmationCallback& callback); 39 const Delegate::ConfirmationCallback& callback);
40 virtual void Cancel(); 40 virtual void Cancel();
41 41
42 const dbus::ObjectPath& object_path() { return object_path_; } 42 const dbus::ObjectPath& object_path() { return object_path_; }
omoikane 2015/05/22 23:55:27 This function does not modify class members, and s
Marie Janssen 2015/06/18 21:08:35 Done.
43 43
44 private: 44 private:
45 friend class FakeBluetoothProfileManagerClient; 45 friend class FakeBluetoothProfileManagerClient;
omoikane 2015/05/22 23:55:27 Friends are usually declared last in the class, si
Marie Janssen 2015/06/18 21:08:35 In Chromium code friends at the beginning is more
46 46
47 // D-Bus object path we are faking. 47 // D-Bus object path we are faking.
48 dbus::ObjectPath object_path_; 48 dbus::ObjectPath object_path_;
49 49
50 // All incoming method calls are passed on to the Delegate and a callback 50 // All incoming method calls are passed on to the Delegate and a callback
51 // passed to generate the reply. |delegate_| is generally the object that 51 // passed to generate the reply. |delegate_| is generally the object that
52 // owns this one, and must outlive it. 52 // owns this one, and must outlive it.
53 Delegate* delegate_; 53 Delegate* delegate_;
54 }; 54 };
omoikane 2015/05/22 23:55:27 Copy constructors should be disabled. http://googl
Marie Janssen 2015/06/18 21:08:34 Done.
55 55
56 } // namespace chromeos 56 } // namespace chromeos
57 57
58 #endif // CHROMEOS_DBUS_FAKE_BLUETOOTH_PROFILE_SERVICE_PROVIDER_H_ 58 #endif // CHROMEOS_DBUS_FAKE_BLUETOOTH_PROFILE_SERVICE_PROVIDER_H_
59
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698