Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2296)

Unified Diff: chrome/browser/password_manager/native_backend_gnome_x.cc

Issue 7712024: Linux: support append to password list in the GNOME keyring backend to fix initial password sync. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/password_manager/native_backend_gnome_x_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/password_manager/native_backend_gnome_x.cc
===================================================================
--- chrome/browser/password_manager/native_backend_gnome_x.cc (revision 97665)
+++ chrome/browser/password_manager/native_backend_gnome_x.cc (working copy)
@@ -382,7 +382,14 @@
GnomeKeyringResult GKRMethod::WaitResult(PasswordFormList* forms) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
event_.Wait();
- forms->swap(forms_);
+ if (forms->empty()) {
+ // Normal case. Avoid extra allocation by swapping.
+ forms->swap(forms_);
Evan Martin 2011/08/23 14:36:07 Is this performance critical? I wonder if it's wo
Mike Mammarella 2011/08/23 19:40:20 No, it's not performance critical. It would probab
+ } else {
+ // Rare case. Append forms_ to *forms.
+ forms->insert(forms->end(), forms_.begin(), forms_.end());
+ forms_.clear();
+ }
return result_;
}
« no previous file with comments | « no previous file | chrome/browser/password_manager/native_backend_gnome_x_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698