summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autofill
diff options
context:
space:
mode:
authorisherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-09 00:30:18 +0000
committerisherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-09 00:30:18 +0000
commitff9cebb3f64df1c0c779a8a60daee57da7f9b667 (patch)
treec4e3238ac1e82e99a1b6b759050e0c7b008ebef6 /chrome/browser/autofill
parentcccabf3439f4a327fab90a91b5b64f6cf13695f1 (diff)
downloadchromium_src-ff9cebb3f64df1c0c779a8a60daee57da7f9b667.zip
chromium_src-ff9cebb3f64df1c0c779a8a60daee57da7f9b667.tar.gz
chromium_src-ff9cebb3f64df1c0c779a8a60daee57da7f9b667.tar.bz2
Release unique_ids_lock_ in Autofill PDM in case observers need to acquire it.
BUG=58426 TEST=none Review URL: http://codereview.chromium.org/3549028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62049 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill')
-rw-r--r--chrome/browser/autofill/personal_data_manager.cc20
1 files changed, 18 insertions, 2 deletions
diff --git a/chrome/browser/autofill/personal_data_manager.cc b/chrome/browser/autofill/personal_data_manager.cc
index 87600f3..09a2f98 100644
--- a/chrome/browser/autofill/personal_data_manager.cc
+++ b/chrome/browser/autofill/personal_data_manager.cc
@@ -320,7 +320,15 @@ void PersonalDataManager::SetProfiles(std::vector<AutoFillProfile>* profiles) {
// Read our writes to ensure consistency with the database.
Refresh();
- FOR_EACH_OBSERVER(Observer, observers_, OnPersonalDataChanged());
+ {
+ // We're now done with the unique IDs, and observers might call into a
+ // method that needs the lock, so release it. For example, observers on Mac
+ // might call profiles() which calls LoadAuxiliaryProfiles(), which needs
+ // the lock.
+ AutoUnlock unlock(unique_ids_lock_);
+
+ FOR_EACH_OBSERVER(Observer, observers_, OnPersonalDataChanged());
+ }
}
void PersonalDataManager::SetCreditCards(
@@ -395,7 +403,15 @@ void PersonalDataManager::SetCreditCards(
credit_cards_.push_back(new CreditCard(*iter));
}
- FOR_EACH_OBSERVER(Observer, observers_, OnPersonalDataChanged());
+ {
+ // We're now done with the unique IDs, and observers might call into a
+ // method that needs the lock, so release it. For example, observers on Mac
+ // might call profiles() which calls LoadAuxiliaryProfiles(), which needs
+ // the lock.
+ AutoUnlock unlock(unique_ids_lock_);
+
+ FOR_EACH_OBSERVER(Observer, observers_, OnPersonalDataChanged());
+ }
}
// TODO(jhawkins): Refactor SetProfiles so this isn't so hacky.