Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_CRYPTOHOME_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_CRYPTOHOME_CLIENT_H_ |
| 6 #define CHROMEOS_DBUS_CRYPTOHOME_CLIENT_H_ | 6 #define CHROMEOS_DBUS_CRYPTOHOME_CLIENT_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 55 typedef base::Callback<void(int async_id, | 55 typedef base::Callback<void(int async_id, |
| 56 bool return_status, | 56 bool return_status, |
| 57 const std::string& data)> | 57 const std::string& data)> |
| 58 AsyncCallStatusWithDataHandler; | 58 AsyncCallStatusWithDataHandler; |
| 59 // A callback to handle responses of AsyncXXX methods. | 59 // A callback to handle responses of AsyncXXX methods. |
| 60 typedef base::Callback<void(int async_id)> AsyncMethodCallback; | 60 typedef base::Callback<void(int async_id)> AsyncMethodCallback; |
| 61 // A callback for GetSystemSalt(). | 61 // A callback for GetSystemSalt(). |
| 62 typedef base::Callback<void(DBusMethodCallStatus call_status, | 62 typedef base::Callback<void(DBusMethodCallStatus call_status, |
| 63 const std::vector<uint8_t>& system_salt)> | 63 const std::vector<uint8_t>& system_salt)> |
| 64 GetSystemSaltCallback; | 64 GetSystemSaltCallback; |
| 65 // A callback to handle LowDiskSpace signals. | |
| 66 typedef base::Callback<void(uint64_t disk_free_bytes)> LowDiskSpaceHandler; | |
| 65 // A callback for WaitForServiceToBeAvailable(). | 67 // A callback for WaitForServiceToBeAvailable(). |
| 66 typedef base::Callback<void(bool service_is_ready)> | 68 typedef base::Callback<void(bool service_is_ready)> |
| 67 WaitForServiceToBeAvailableCallback; | 69 WaitForServiceToBeAvailableCallback; |
| 68 // A callback to handle responses of Pkcs11GetTpmTokenInfo method. The result | 70 // A callback to handle responses of Pkcs11GetTpmTokenInfo method. The result |
| 69 // of the D-Bus call is in |call_status|. On success, |label| holds the | 71 // of the D-Bus call is in |call_status|. On success, |label| holds the |
| 70 // PKCS #11 token label. This is not useful in practice to identify a token | 72 // PKCS #11 token label. This is not useful in practice to identify a token |
| 71 // but may be meaningful to a user. The |user_pin| can be used with the | 73 // but may be meaningful to a user. The |user_pin| can be used with the |
| 72 // C_Login PKCS #11 function but is not necessary because tokens are logged in | 74 // C_Login PKCS #11 function but is not necessary because tokens are logged in |
| 73 // for the duration of a signed-in session. The |slot| corresponds to a | 75 // for the duration of a signed-in session. The |slot| corresponds to a |
| 74 // CK_SLOT_ID for the PKCS #11 API and reliably identifies the token for the | 76 // CK_SLOT_ID for the PKCS #11 API and reliably identifies the token for the |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 103 // |handler| is called when results for AsyncXXX methods are returned. | 105 // |handler| is called when results for AsyncXXX methods are returned. |
| 104 // Cryptohome service will process the calls in a first-in-first-out manner | 106 // Cryptohome service will process the calls in a first-in-first-out manner |
| 105 // when they are made in parallel. | 107 // when they are made in parallel. |
| 106 virtual void SetAsyncCallStatusHandlers( | 108 virtual void SetAsyncCallStatusHandlers( |
| 107 const AsyncCallStatusHandler& handler, | 109 const AsyncCallStatusHandler& handler, |
| 108 const AsyncCallStatusWithDataHandler& data_handler) = 0; | 110 const AsyncCallStatusWithDataHandler& data_handler) = 0; |
| 109 | 111 |
| 110 // Resets AsyncCallStatus signal handlers. | 112 // Resets AsyncCallStatus signal handlers. |
| 111 virtual void ResetAsyncCallStatusHandlers() = 0; | 113 virtual void ResetAsyncCallStatusHandlers() = 0; |
| 112 | 114 |
| 115 // Sets LowDiskSpace signal handler. |handler| is called when the cryptohome | |
| 116 // partition is running out of disk space. | |
| 117 virtual void SetLowDiskSpaceHandler(const LowDiskSpaceHandler& handler) = 0; | |
| 118 | |
| 119 // Resets LowDiskSpace signal handlers. | |
| 120 virtual void ResetLowDiskSpaceHandler() = 0; | |
|
satorux1
2016/06/27 07:46:40
I think resetting is possible by something like Se
dspaid1
2016/06/28 00:39:06
Done.
| |
| 121 | |
| 113 // Runs the callback as soon as the service becomes available. | 122 // Runs the callback as soon as the service becomes available. |
| 114 virtual void WaitForServiceToBeAvailable( | 123 virtual void WaitForServiceToBeAvailable( |
| 115 const WaitForServiceToBeAvailableCallback& callback) = 0; | 124 const WaitForServiceToBeAvailableCallback& callback) = 0; |
| 116 | 125 |
| 117 // Calls IsMounted method and returns true when the call succeeds. | 126 // Calls IsMounted method and returns true when the call succeeds. |
| 118 virtual void IsMounted(const BoolDBusMethodCallback& callback) = 0; | 127 virtual void IsMounted(const BoolDBusMethodCallback& callback) = 0; |
| 119 | 128 |
| 120 // Calls Unmount method and returns true when the call succeeds. | 129 // Calls Unmount method and returns true when the call succeeds. |
| 121 // This method blocks until the call returns. | 130 // This method blocks until the call returns. |
| 122 virtual bool Unmount(bool* success) = 0; | 131 virtual bool Unmount(bool* success) = 0; |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 548 // Create() should be used instead. | 557 // Create() should be used instead. |
| 549 CryptohomeClient(); | 558 CryptohomeClient(); |
| 550 | 559 |
| 551 private: | 560 private: |
| 552 DISALLOW_COPY_AND_ASSIGN(CryptohomeClient); | 561 DISALLOW_COPY_AND_ASSIGN(CryptohomeClient); |
| 553 }; | 562 }; |
| 554 | 563 |
| 555 } // namespace chromeos | 564 } // namespace chromeos |
| 556 | 565 |
| 557 #endif // CHROMEOS_DBUS_CRYPTOHOME_CLIENT_H_ | 566 #endif // CHROMEOS_DBUS_CRYPTOHOME_CLIENT_H_ |
| OLD | NEW |