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 #include "chrome/browser/sync/glue/password_model_associator.h" | 5 #include "chrome/browser/sync/glue/password_model_associator.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 if (!password_store_->FillAutofillableLogins(&passwords) || | 64 if (!password_store_->FillAutofillableLogins(&passwords) || |
65 !password_store_->FillBlacklistLogins(&passwords)) { | 65 !password_store_->FillBlacklistLogins(&passwords)) { |
66 STLDeleteElements(&passwords); | 66 STLDeleteElements(&passwords); |
67 | 67 |
68 // Password store often fails to load passwords. Track failures with UMA. | 68 // Password store often fails to load passwords. Track failures with UMA. |
69 // (http://crbug.com/249000) | 69 // (http://crbug.com/249000) |
70 UMA_HISTOGRAM_ENUMERATION("Sync.LocalDataFailedToLoad", | 70 UMA_HISTOGRAM_ENUMERATION("Sync.LocalDataFailedToLoad", |
71 ModelTypeToHistogramInt(syncer::PASSWORDS), | 71 ModelTypeToHistogramInt(syncer::PASSWORDS), |
72 syncer::MODEL_TYPE_COUNT); | 72 syncer::MODEL_TYPE_COUNT); |
73 return syncer::SyncError(FROM_HERE, | 73 return syncer::SyncError(FROM_HERE, |
| 74 syncer::SyncError::DATATYPE_ERROR, |
74 "Could not get the password entries.", | 75 "Could not get the password entries.", |
75 model_type()); | 76 model_type()); |
76 } | 77 } |
77 | 78 |
78 std::set<std::string> current_passwords; | 79 std::set<std::string> current_passwords; |
79 PasswordVector new_passwords; | 80 PasswordVector new_passwords; |
80 PasswordVector updated_passwords; | 81 PasswordVector updated_passwords; |
81 { | 82 { |
82 syncer::WriteTransaction trans(FROM_HERE, sync_service_->GetUserShare()); | 83 syncer::WriteTransaction trans(FROM_HERE, sync_service_->GetUserShare()); |
83 syncer::ReadNode password_root(&trans); | 84 syncer::ReadNode password_root(&trans); |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 const std::string& password_element, | 444 const std::string& password_element, |
444 const std::string& signon_realm) { | 445 const std::string& signon_realm) { |
445 return net::EscapePath(origin_url) + "|" + | 446 return net::EscapePath(origin_url) + "|" + |
446 net::EscapePath(username_element) + "|" + | 447 net::EscapePath(username_element) + "|" + |
447 net::EscapePath(username_value) + "|" + | 448 net::EscapePath(username_value) + "|" + |
448 net::EscapePath(password_element) + "|" + | 449 net::EscapePath(password_element) + "|" + |
449 net::EscapePath(signon_realm); | 450 net::EscapePath(signon_realm); |
450 } | 451 } |
451 | 452 |
452 } // namespace browser_sync | 453 } // namespace browser_sync |
OLD | NEW |