OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/stl_util-inl.h" | 9 #include "base/stl_util-inl.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 AutoLock lock(abort_association_pending_lock_); | 198 AutoLock lock(abort_association_pending_lock_); |
199 abort_association_pending_ = true; | 199 abort_association_pending_ = true; |
200 } | 200 } |
201 | 201 |
202 bool PasswordModelAssociator::IsAbortPending() { | 202 bool PasswordModelAssociator::IsAbortPending() { |
203 AutoLock lock(abort_association_pending_lock_); | 203 AutoLock lock(abort_association_pending_lock_); |
204 return abort_association_pending_; | 204 return abort_association_pending_; |
205 } | 205 } |
206 | 206 |
207 int64 PasswordModelAssociator::GetSyncIdFromChromeId( | 207 int64 PasswordModelAssociator::GetSyncIdFromChromeId( |
208 const std::string password) { | 208 const std::string& password) { |
209 PasswordToSyncIdMap::const_iterator iter = id_map_.find(password); | 209 PasswordToSyncIdMap::const_iterator iter = id_map_.find(password); |
210 return iter == id_map_.end() ? sync_api::kInvalidId : iter->second; | 210 return iter == id_map_.end() ? sync_api::kInvalidId : iter->second; |
211 } | 211 } |
212 | 212 |
213 void PasswordModelAssociator::Associate( | 213 void PasswordModelAssociator::Associate( |
214 const std::string* password, int64 sync_id) { | 214 const std::string* password, int64 sync_id) { |
215 DCHECK(expected_loop_ == MessageLoop::current()); | 215 DCHECK(expected_loop_ == MessageLoop::current()); |
216 DCHECK_NE(sync_api::kInvalidId, sync_id); | 216 DCHECK_NE(sync_api::kInvalidId, sync_id); |
217 DCHECK(id_map_.find(*password) == id_map_.end()); | 217 DCHECK(id_map_.find(*password) == id_map_.end()); |
218 DCHECK(id_map_inverse_.find(sync_id) == id_map_inverse_.end()); | 218 DCHECK(id_map_inverse_.find(sync_id) == id_map_inverse_.end()); |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 const std::string& password_element, | 378 const std::string& password_element, |
379 const std::string& signon_realm) { | 379 const std::string& signon_realm) { |
380 return EscapePath(origin_url) + "|" + | 380 return EscapePath(origin_url) + "|" + |
381 EscapePath(username_element) + "|" + | 381 EscapePath(username_element) + "|" + |
382 EscapePath(username_value) + "|" + | 382 EscapePath(username_value) + "|" + |
383 EscapePath(password_element) + "|" + | 383 EscapePath(password_element) + "|" + |
384 EscapePath(signon_realm); | 384 EscapePath(signon_realm); |
385 } | 385 } |
386 | 386 |
387 } // namespace browser_sync | 387 } // namespace browser_sync |
OLD | NEW |