| 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 COMPONENTS_SYNC_TEST_FAKE_SYNC_ENCRYPTION_HANDLER_H_ | 5 #ifndef COMPONENTS_SYNC_TEST_FAKE_SYNC_ENCRYPTION_HANDLER_H_ |
| 6 #define COMPONENTS_SYNC_TEST_FAKE_SYNC_ENCRYPTION_HANDLER_H_ | 6 #define COMPONENTS_SYNC_TEST_FAKE_SYNC_ENCRYPTION_HANDLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/observer_list.h" | 11 #include "base/observer_list.h" |
| 12 #include "components/sync/base/cryptographer.h" | 12 #include "components/sync/base/cryptographer.h" |
| 13 #include "components/sync/base/fake_encryptor.h" |
| 13 #include "components/sync/core/sync_encryption_handler.h" | 14 #include "components/sync/core/sync_encryption_handler.h" |
| 14 #include "components/sync/syncable/nigori_handler.h" | 15 #include "components/sync/syncable/nigori_handler.h" |
| 15 #include "components/sync/test/fake_encryptor.h" | |
| 16 | 16 |
| 17 namespace syncer { | 17 namespace syncer { |
| 18 | 18 |
| 19 // A fake sync encryption handler capable of keeping track of the encryption | 19 // A fake sync encryption handler capable of keeping track of the encryption |
| 20 // state without opening any transactions or interacting with the nigori node. | 20 // state without opening any transactions or interacting with the nigori node. |
| 21 // Note that this only performs basic interactions with the cryptographer | 21 // Note that this only performs basic interactions with the cryptographer |
| 22 // (setting pending keys, installing keys). | 22 // (setting pending keys, installing keys). |
| 23 // Note: NOT thread safe. If threads attempt to check encryption state | 23 // Note: NOT thread safe. If threads attempt to check encryption state |
| 24 // while another thread is modifying it, races can occur. | 24 // while another thread is modifying it, races can occur. |
| 25 class FakeSyncEncryptionHandler : public SyncEncryptionHandler, | 25 class FakeSyncEncryptionHandler : public SyncEncryptionHandler, |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 PassphraseType passphrase_type_; | 61 PassphraseType passphrase_type_; |
| 62 | 62 |
| 63 FakeEncryptor encryptor_; | 63 FakeEncryptor encryptor_; |
| 64 Cryptographer cryptographer_; | 64 Cryptographer cryptographer_; |
| 65 std::string keystore_key_; | 65 std::string keystore_key_; |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 } // namespace syncer | 68 } // namespace syncer |
| 69 | 69 |
| 70 #endif // COMPONENTS_SYNC_TEST_FAKE_SYNC_ENCRYPTION_HANDLER_H_ | 70 #endif // COMPONENTS_SYNC_TEST_FAKE_SYNC_ENCRYPTION_HANDLER_H_ |
| OLD | NEW |