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

Unified Diff: chrome/browser/intents/web_intents_registry.cc

Issue 7541062: Web Intents: Fix a leak. (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 | « chrome/browser/intents/web_intents_registry.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/intents/web_intents_registry.cc
diff --git a/chrome/browser/intents/web_intents_registry.cc b/chrome/browser/intents/web_intents_registry.cc
index 444bcca8a5cc306932b6f2911997f650f609ca19..fb515799b8d307023330c54e4d9504efb453d13d 100644
--- a/chrome/browser/intents/web_intents_registry.cc
+++ b/chrome/browser/intents/web_intents_registry.cc
@@ -24,7 +24,7 @@ WebIntentsRegistry::WebIntentsRegistry() : next_query_id_(0) {}
WebIntentsRegistry::~WebIntentsRegistry() {
// Cancel all pending queries, since we can't handle them any more.
- for (QueryMap::iterator it(queries.begin()); it != queries.end(); ++it) {
+ for (QueryMap::iterator it(queries_.begin()); it != queries_.end(); ++it) {
wds_->CancelRequest(it->first);
delete it->second;
}
@@ -40,18 +40,19 @@ void WebIntentsRegistry::OnWebDataServiceRequestDone(
DCHECK(result);
DCHECK(result->GetType() == WEB_INTENTS_RESULT);
- QueryMap::iterator it = queries.find(h);
- DCHECK(it != queries.end());
+ QueryMap::iterator it = queries_.find(h);
+ DCHECK(it != queries_.end());
IntentsQuery* query(it->second);
DCHECK(query);
- queries.erase(it);
+ queries_.erase(it);
// TODO(groby): Filtering goes here.
std::vector<WebIntentData> intents = static_cast<
const WDResult<std::vector<WebIntentData> >*>(result)->GetValue();
query->consumer_->OnIntentsQueryDone(query->query_id_, intents);
+ delete query;
}
WebIntentsRegistry::QueryID WebIntentsRegistry::GetIntentProviders(
@@ -64,7 +65,7 @@ WebIntentsRegistry::QueryID WebIntentsRegistry::GetIntentProviders(
query->query_id_ = next_query_id_++;
query->consumer_ = consumer;
query->pending_query_ = wds_->GetWebIntents(action, this);
- queries[query->pending_query_] = query;
+ queries_[query->pending_query_] = query;
return query->query_id_;
}
« no previous file with comments | « chrome/browser/intents/web_intents_registry.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698