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

Unified Diff: components/webdata/common/web_data_request_manager.cc

Issue 2403773002: Remove stl_util's STLDeleteContainerPointers from autofill. (Closed)
Patch Set: rebase Created 4 years, 2 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 | « components/webdata/common/web_data_request_manager.h ('k') | components/webdata/common/web_data_results.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/webdata/common/web_data_request_manager.cc
diff --git a/components/webdata/common/web_data_request_manager.cc b/components/webdata/common/web_data_request_manager.cc
index 9f8186396978fda4e2601ecaf4657bc30bdf9dec..d8a271d4a8b26f9bb1c3135127e37d17ea3c3adb 100644
--- a/components/webdata/common/web_data_request_manager.cc
+++ b/components/webdata/common/web_data_request_manager.cc
@@ -30,9 +30,6 @@ WebDataRequest::~WebDataRequest() {
if (manager_) {
manager_->CancelRequest(handle_);
}
- if (result_.get()) {
- result_->Destroy();
- }
}
WebDataServiceBase::Handle WebDataRequest::GetHandle() const {
@@ -84,10 +81,8 @@ WebDataRequestManager::WebDataRequestManager()
WebDataRequestManager::~WebDataRequestManager() {
base::AutoLock l(pending_lock_);
- for (RequestMap::iterator i = pending_requests_.begin();
- i != pending_requests_.end(); ++i) {
+ for (auto i = pending_requests_.begin(); i != pending_requests_.end(); ++i)
i->second->Cancel();
- }
pending_requests_.clear();
}
@@ -103,7 +98,7 @@ int WebDataRequestManager::GetNextRequestHandle() {
void WebDataRequestManager::CancelRequest(WebDataServiceBase::Handle h) {
base::AutoLock l(pending_lock_);
- RequestMap::iterator i = pending_requests_.find(h);
+ auto i = pending_requests_.find(h);
DCHECK(i != pending_requests_.end());
i->second->Cancel();
pending_requests_.erase(i);
@@ -130,7 +125,7 @@ void WebDataRequestManager::RequestCompletedOnThread(
"422460 WebDataRequestManager::RequestCompletedOnThread::UpdateMap"));
{
base::AutoLock l(pending_lock_);
- RequestMap::iterator i = pending_requests_.find(request->GetHandle());
+ auto i = pending_requests_.find(request->GetHandle());
DCHECK(i != pending_requests_.end());
// Take ownership of the request object and remove it from the map.
@@ -149,8 +144,8 @@ void WebDataRequestManager::RequestCompletedOnThread(
WebDataServiceConsumer* consumer = request->GetConsumer();
request->OnComplete();
if (consumer) {
- std::unique_ptr<WDTypedResult> r = request->GetResult();
- consumer->OnWebDataServiceRequestDone(request->GetHandle(), r.get());
+ consumer->OnWebDataServiceRequestDone(request->GetHandle(),
+ request->GetResult());
}
}
« no previous file with comments | « components/webdata/common/web_data_request_manager.h ('k') | components/webdata/common/web_data_results.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698