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

Unified Diff: chrome/browser/chrome_to_mobile_service.cc

Issue 10914136: Fix URLFetcher leaks in ChromeToMobileService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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/chrome_to_mobile_service.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_to_mobile_service.cc
diff --git a/chrome/browser/chrome_to_mobile_service.cc b/chrome/browser/chrome_to_mobile_service.cc
index 96f096355ec3f62486fc11728e7d1d3e9027431b..d023e40151ada5a068704924964daed92ae7c648 100644
--- a/chrome/browser/chrome_to_mobile_service.cc
+++ b/chrome/browser/chrome_to_mobile_service.cc
@@ -252,21 +252,21 @@ void ChromeToMobileService::SendToMobile(const base::DictionaryValue* mobile,
data.snapshot_id = base::GenerateGUID();
data.type = !snapshot.empty() ? DELAYED_SNAPSHOT : URL;
- net::URLFetcher* submit_url = CreateRequest();
- request_observer_map_[submit_url] = observer;
- SendRequest(submit_url, data);
+ submit_url_.reset(CreateRequest());
msw 2012/09/07 02:01:30 This won't work, as there may be multiple simultan
+ request_observer_map_[submit_url_.get()] = observer;
+ SendRequest(submit_url_.get(), data);
if (data.type == DELAYED_SNAPSHOT) {
LogMetric(SENDING_SNAPSHOT);
data.type = SNAPSHOT;
- net::URLFetcher* submit_snapshot = CreateRequest();
- request_observer_map_[submit_snapshot] = observer;
+ submit_snapshot_.reset(CreateRequest());
+ request_observer_map_[submit_snapshot_.get()] = observer;
if (!content::BrowserThread::PostBlockingPoolSequencedTask(
data.snapshot.AsUTF8Unsafe(), FROM_HERE,
base::Bind(&ChromeToMobileService::SendRequest,
weak_ptr_factory_.GetWeakPtr(),
- submit_snapshot, data))) {
+ submit_snapshot_.get(), data))) {
NOTREACHED();
}
}
@@ -511,10 +511,10 @@ void ChromeToMobileService::RequestDeviceSearch() {
LogMetric(DEVICES_REQUESTED);
- net::URLFetcher* search_request = net::URLFetcher::Create(
- GetSearchURL(cloud_print_url_), net::URLFetcher::GET, this);
- InitRequest(search_request);
- search_request->Start();
+ search_request_.reset(net::URLFetcher::Create(
msw 2012/09/07 02:01:30 Similarly, this won't work for multiple simultaneo
+ GetSearchURL(cloud_print_url_), net::URLFetcher::GET, this));
+ InitRequest(search_request_.get());
+ search_request_->Start();
}
void ChromeToMobileService::HandleSearchResponse(
« no previous file with comments | « chrome/browser/chrome_to_mobile_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698