| 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 "sync/internal_api/sync_encryption_handler_impl.h" | 5 #include "sync/internal_api/sync_encryption_handler_impl.h" |
| 6 | 6 |
| 7 #include <queue> | 7 #include <queue> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/base64.h" | 10 #include "base/base64.h" |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 WriteTransaction trans(FROM_HERE, user_share_); | 248 WriteTransaction trans(FROM_HERE, user_share_); |
| 249 WriteNode node(&trans); | 249 WriteNode node(&trans); |
| 250 | 250 |
| 251 if (node.InitTypeRoot(NIGORI) != BaseNode::INIT_OK) | 251 if (node.InitTypeRoot(NIGORI) != BaseNode::INIT_OK) |
| 252 return; | 252 return; |
| 253 if (!ApplyNigoriUpdateImpl(node.GetNigoriSpecifics(), | 253 if (!ApplyNigoriUpdateImpl(node.GetNigoriSpecifics(), |
| 254 trans.GetWrappedTrans())) { | 254 trans.GetWrappedTrans())) { |
| 255 WriteEncryptionStateToNigori(&trans); | 255 WriteEncryptionStateToNigori(&trans); |
| 256 } | 256 } |
| 257 | 257 |
| 258 UMA_HISTOGRAM_ENUMERATION("Sync.PassphraseType", |
| 259 GetPassphraseType(), |
| 260 PASSPHRASE_TYPE_SIZE); |
| 261 |
| 258 bool has_pending_keys = UnlockVault( | 262 bool has_pending_keys = UnlockVault( |
| 259 trans.GetWrappedTrans()).cryptographer.has_pending_keys(); | 263 trans.GetWrappedTrans()).cryptographer.has_pending_keys(); |
| 260 bool is_ready = UnlockVault( | 264 bool is_ready = UnlockVault( |
| 261 trans.GetWrappedTrans()).cryptographer.is_ready(); | 265 trans.GetWrappedTrans()).cryptographer.is_ready(); |
| 262 // Log the state of the cryptographer regardless of migration state. | 266 // Log the state of the cryptographer regardless of migration state. |
| 263 UMA_HISTOGRAM_BOOLEAN("Sync.CryptographerReady", is_ready); | 267 UMA_HISTOGRAM_BOOLEAN("Sync.CryptographerReady", is_ready); |
| 264 UMA_HISTOGRAM_BOOLEAN("Sync.CryptographerPendingKeys", has_pending_keys); | 268 UMA_HISTOGRAM_BOOLEAN("Sync.CryptographerPendingKeys", has_pending_keys); |
| 265 if (IsNigoriMigratedToKeystore(node.GetNigoriSpecifics())) { | 269 if (IsNigoriMigratedToKeystore(node.GetNigoriSpecifics())) { |
| 266 // This account has a nigori node that has been migrated to support | 270 // This account has a nigori node that has been migrated to support |
| 267 // keystore. | 271 // keystore. |
| (...skipping 1370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1638 | 1642 |
| 1639 base::Time SyncEncryptionHandlerImpl::GetExplicitPassphraseTime() const { | 1643 base::Time SyncEncryptionHandlerImpl::GetExplicitPassphraseTime() const { |
| 1640 if (passphrase_type_ == FROZEN_IMPLICIT_PASSPHRASE) | 1644 if (passphrase_type_ == FROZEN_IMPLICIT_PASSPHRASE) |
| 1641 return migration_time(); | 1645 return migration_time(); |
| 1642 else if (passphrase_type_ == CUSTOM_PASSPHRASE) | 1646 else if (passphrase_type_ == CUSTOM_PASSPHRASE) |
| 1643 return custom_passphrase_time(); | 1647 return custom_passphrase_time(); |
| 1644 return base::Time(); | 1648 return base::Time(); |
| 1645 } | 1649 } |
| 1646 | 1650 |
| 1647 } // namespace browser_sync | 1651 } // namespace browser_sync |
| OLD | NEW |