OLD | NEW |
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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_KEY_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_KEY_MANAGER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_KEY_MANAGER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_KEY_MANAGER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <deque> | 10 #include <deque> |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 const EasyUnlockDeviceKeyDataList& fetched_data); | 103 const EasyUnlockDeviceKeyDataList& fetched_data); |
104 | 104 |
105 // Queued operations are stored as raw pointers, as scoped_ptrs may not behave | 105 // Queued operations are stored as raw pointers, as scoped_ptrs may not behave |
106 // nicely with std::deque. | 106 // nicely with std::deque. |
107 using WriteOperationQueue = std::deque<EasyUnlockRefreshKeysOperation*>; | 107 using WriteOperationQueue = std::deque<EasyUnlockRefreshKeysOperation*>; |
108 using ReadOperationQueue = std::deque<EasyUnlockGetKeysOperation*>; | 108 using ReadOperationQueue = std::deque<EasyUnlockGetKeysOperation*>; |
109 WriteOperationQueue write_operation_queue_; | 109 WriteOperationQueue write_operation_queue_; |
110 ReadOperationQueue read_operation_queue_; | 110 ReadOperationQueue read_operation_queue_; |
111 | 111 |
112 // Scopes the raw operation pointers to the lifetime of this object. | 112 // Scopes the raw operation pointers to the lifetime of this object. |
113 STLElementDeleter<WriteOperationQueue> write_queue_deleter_; | 113 base::STLElementDeleter<WriteOperationQueue> write_queue_deleter_; |
114 STLElementDeleter<ReadOperationQueue> read_queue_deleter_; | 114 base::STLElementDeleter<ReadOperationQueue> read_queue_deleter_; |
115 | 115 |
116 // Stores the current operation in progress. At most one of these variables | 116 // Stores the current operation in progress. At most one of these variables |
117 // can be non-null at any time. | 117 // can be non-null at any time. |
118 std::unique_ptr<EasyUnlockRefreshKeysOperation> pending_write_operation_; | 118 std::unique_ptr<EasyUnlockRefreshKeysOperation> pending_write_operation_; |
119 std::unique_ptr<EasyUnlockGetKeysOperation> pending_read_operation_; | 119 std::unique_ptr<EasyUnlockGetKeysOperation> pending_read_operation_; |
120 | 120 |
121 base::WeakPtrFactory<EasyUnlockKeyManager> weak_ptr_factory_; | 121 base::WeakPtrFactory<EasyUnlockKeyManager> weak_ptr_factory_; |
122 | 122 |
123 DISALLOW_COPY_AND_ASSIGN(EasyUnlockKeyManager); | 123 DISALLOW_COPY_AND_ASSIGN(EasyUnlockKeyManager); |
124 }; | 124 }; |
125 | 125 |
126 } // namespace chromeos | 126 } // namespace chromeos |
127 | 127 |
128 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_KEY_MANAGER_H_ | 128 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EASY_UNLOCK_EASY_UNLOCK_KEY_MANAGER_H_ |
OLD | NEW |