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

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

Issue 118131: Change PasswordStoreDefault to access the WebDataService from the UI thread o... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 7 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
Index: chrome/browser/password_manager/password_store_win.cc
===================================================================
--- chrome/browser/password_manager/password_store_win.cc (revision 17405)
+++ chrome/browser/password_manager/password_store_win.cc (working copy)
@@ -21,13 +21,14 @@
WebDataService::Handle h, const WDTypedResult *result) {
// Look up this handle in our request map to get the original
// GetLoginsRequest.
- GetLoginsRequest* request = GetLoginsRequestForWebDataServiceRequest(h);
- DCHECK(request);
- // Remove our pending request, but make sure that we won't be destroyed until
- // we're done with this function.
- scoped_refptr<PasswordStoreWin> life_preserver(this);
- RemovePendingWebDataServiceRequest(h);
+ PendingRequestMap::iterator it(pending_requests_.find(h));
+ // If the request was cancelled, we are done.
+ if (it == pending_requests_.end())
+ return;
+ scoped_ptr<GetLoginsRequest> request(it->second);
+ pending_requests_.erase(it);
+
DCHECK(result);
if (!result)
return;
@@ -41,7 +42,8 @@
if (result_value.size()) {
// If we found some results then return them now.
- NotifyConsumer(request, result_value);
+ request->consumer->OnPasswordStoreRequestDone(request->handle,
+ result_value);
return;
} else {
// Otherwise try finding IE7 logins.
@@ -52,7 +54,8 @@
if (web_data_service_->IsRunning()) {
WebDataService::Handle web_data_handle =
web_data_service_->GetIE7Login(info, this);
- AddPendingWebDataServiceRequest(web_data_handle, request);
+ pending_requests_.insert(PendingRequestMap::value_type(
+ web_data_handle, request.release()));
}
}
break;
@@ -66,7 +69,8 @@
if (ie7_form)
forms.push_back(ie7_form);
- NotifyConsumer(request, forms);
+ request->consumer->OnPasswordStoreRequestDone(request->handle,
+ forms);
break;
}
}
Property changes on: chrome\browser\password_manager\password_store_win.cc
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698