OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROMEOS_DBUS_BIOD_RECORD_CLIENT_H_ | |
6 #define CHROMEOS_DBUS_BIOD_RECORD_CLIENT_H_ | |
7 | |
8 #include <stdint.h> | |
9 | |
10 #include "base/callback.h" | |
11 #include "base/macros.h" | |
12 #include "chromeos/chromeos_export.h" | |
13 #include "chromeos/dbus/dbus_client.h" | |
14 #include "chromeos/dbus/dbus_client_implementation_type.h" | |
15 #include "chromeos/dbus/dbus_method_call_status.h" | |
16 | |
17 namespace chromeos { | |
18 | |
19 // BiodRecordClient is used to communicate with a biod record via dbus | |
20 // interface. | |
21 class CHROMEOS_EXPORT BiodRecordClient : public DBusClient { | |
22 public: | |
23 ~BiodRecordClient() override; | |
24 | |
25 using StringCallback = base::Callback<void(const std::string&)>; | |
26 | |
27 // Changes the label of the record at |record_path| to |label|. | |
28 virtual void SetLabel(const dbus::ObjectPath& record_path, | |
29 const std::string& label) = 0; | |
30 | |
31 // Removes the record at |record_path|. This record will no longer be able to | |
32 // used for authentication. | |
33 virtual void Remove(const dbus::ObjectPath& record_path) = 0; | |
34 | |
35 // Fetches the label of the enrollment at |record_path| and runs the | |
36 // callback |callback| with the label as an argument. | |
37 virtual void GetLabel(const dbus::ObjectPath& record_path, | |
38 const StringCallback& callback) = 0; | |
39 | |
40 // Same as above but returns the label instead of running a callback | |
41 // function. This is a BLOCKING CALL. | |
rkc
2017/03/20 23:47:09
Why is this a blocking call?
Also nit: no need for
sammiequon
2017/03/21 00:30:39
This is a version of the previous function in case
| |
42 virtual std::string GetLabelBlocking(const dbus::ObjectPath& record_path) = 0; | |
43 | |
44 // Creates the instance. | |
45 static BiodRecordClient* Create(DBusClientImplementationType type); | |
46 | |
47 protected: | |
48 friend class BiodBiometricsManagerClientTest; | |
49 | |
50 // Create() should be used instead. | |
51 BiodRecordClient(); | |
52 | |
53 private: | |
54 DISALLOW_COPY_AND_ASSIGN(BiodRecordClient); | |
55 }; | |
56 | |
57 } // namespace chromeos | |
58 | |
59 #endif // CHROMEOS_DBUS_BIOD_RECORD_CLIENT_H_ | |
OLD | NEW |