| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "components/sync/core_impl/sync_encryption_handler_impl.h" | 5 #include "components/sync/core_impl/sync_encryption_handler_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <queue> | 11 #include <queue> |
| 12 | 12 |
| 13 #include "base/base64.h" | 13 #include "base/base64.h" |
| 14 #include "base/bind.h" | 14 #include "base/bind.h" |
| 15 #include "base/json/json_string_value_serializer.h" | 15 #include "base/json/json_string_value_serializer.h" |
| 16 #include "base/location.h" | 16 #include "base/location.h" |
| 17 #include "base/metrics/histogram_macros.h" | 17 #include "base/metrics/histogram_macros.h" |
| 18 #include "base/single_thread_task_runner.h" | 18 #include "base/single_thread_task_runner.h" |
| 19 #include "base/threading/thread_task_runner_handle.h" | 19 #include "base/threading/thread_task_runner_handle.h" |
| 20 #include "base/tracked_objects.h" | 20 #include "base/tracked_objects.h" |
| 21 #include "components/sync/base/encryptor.h" | 21 #include "components/sync/base/encryptor.h" |
| 22 #include "components/sync/base/experiments.h" | 22 #include "components/sync/base/experiments.h" |
| 23 #include "components/sync/base/passphrase_type.h" | 23 #include "components/sync/base/passphrase_type.h" |
| 24 #include "components/sync/base/time.h" | 24 #include "components/sync/base/time.h" |
| 25 #include "components/sync/core/read_node.h" | |
| 26 #include "components/sync/core/read_transaction.h" | |
| 27 #include "components/sync/core/user_share.h" | |
| 28 #include "components/sync/core/write_node.h" | |
| 29 #include "components/sync/core/write_transaction.h" | |
| 30 #include "components/sync/engine/sync_string_conversions.h" | 25 #include "components/sync/engine/sync_string_conversions.h" |
| 31 #include "components/sync/protocol/encryption.pb.h" | 26 #include "components/sync/protocol/encryption.pb.h" |
| 32 #include "components/sync/protocol/nigori_specifics.pb.h" | 27 #include "components/sync/protocol/nigori_specifics.pb.h" |
| 33 #include "components/sync/protocol/sync.pb.h" | 28 #include "components/sync/protocol/sync.pb.h" |
| 34 #include "components/sync/syncable/directory.h" | 29 #include "components/sync/syncable/directory.h" |
| 35 #include "components/sync/syncable/entry.h" | 30 #include "components/sync/syncable/entry.h" |
| 36 #include "components/sync/syncable/mutable_entry.h" | 31 #include "components/sync/syncable/mutable_entry.h" |
| 37 #include "components/sync/syncable/nigori_util.h" | 32 #include "components/sync/syncable/nigori_util.h" |
| 33 #include "components/sync/syncable/read_node.h" |
| 34 #include "components/sync/syncable/read_transaction.h" |
| 38 #include "components/sync/syncable/syncable_base_transaction.h" | 35 #include "components/sync/syncable/syncable_base_transaction.h" |
| 39 #include "components/sync/syncable/syncable_model_neutral_write_transaction.h" | 36 #include "components/sync/syncable/syncable_model_neutral_write_transaction.h" |
| 40 #include "components/sync/syncable/syncable_write_transaction.h" | 37 #include "components/sync/syncable/syncable_write_transaction.h" |
| 38 #include "components/sync/syncable/user_share.h" |
| 39 #include "components/sync/syncable/write_node.h" |
| 40 #include "components/sync/syncable/write_transaction.h" |
| 41 | 41 |
| 42 namespace syncer { | 42 namespace syncer { |
| 43 | 43 |
| 44 namespace { | 44 namespace { |
| 45 | 45 |
| 46 // The maximum number of times we will automatically overwrite the nigori node | 46 // The maximum number of times we will automatically overwrite the nigori node |
| 47 // because the encryption keys don't match (per chrome instantiation). | 47 // because the encryption keys don't match (per chrome instantiation). |
| 48 // We protect ourselves against nigori rollbacks, but it's possible two | 48 // We protect ourselves against nigori rollbacks, but it's possible two |
| 49 // different clients might have contrasting view of what the nigori node state | 49 // different clients might have contrasting view of what the nigori node state |
| 50 // should be, in which case they might ping pong (see crbug.com/119207). | 50 // should be, in which case they might ping pong (see crbug.com/119207). |
| (...skipping 1609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1660 base::Time SyncEncryptionHandlerImpl::GetExplicitPassphraseTime( | 1660 base::Time SyncEncryptionHandlerImpl::GetExplicitPassphraseTime( |
| 1661 PassphraseType passphrase_type) const { | 1661 PassphraseType passphrase_type) const { |
| 1662 if (passphrase_type == PassphraseType::FROZEN_IMPLICIT_PASSPHRASE) | 1662 if (passphrase_type == PassphraseType::FROZEN_IMPLICIT_PASSPHRASE) |
| 1663 return migration_time(); | 1663 return migration_time(); |
| 1664 else if (passphrase_type == PassphraseType::CUSTOM_PASSPHRASE) | 1664 else if (passphrase_type == PassphraseType::CUSTOM_PASSPHRASE) |
| 1665 return custom_passphrase_time(); | 1665 return custom_passphrase_time(); |
| 1666 return base::Time(); | 1666 return base::Time(); |
| 1667 } | 1667 } |
| 1668 | 1668 |
| 1669 } // namespace syncer | 1669 } // namespace syncer |
| OLD | NEW |