From dafcf89b36898f4f4afc010824879290b9e51e3a Mon Sep 17 00:00:00 2001 From: dtapuska Date: Fri, 1 May 2015 06:58:25 -0700 Subject: Adjust URLFetcher::Create API so that object is returned as scoped_ptr. Most interfaces were storing the object in a scoped_ptr already. This adjusts the API so that it is a little clearer of the ownership transfer. A number of clients put the URLFetcher in a table and do memory management on it themselves; this is likely templatable code for a future CL. The scope of this CL was to change the API but no control flow changes. Making this change found one memory leak; (http://crbug.com/482459) has been addressed separately. BUG=371201 TESTS=net_unittests google_api_unittests TBR=jochen@chromium.org, thakis@chromium.org, oshima@chromium.org, armansito@chromium.org, reillyg@chromium.org, rogerta@chromium.org, stuartmorgan@chromium.org, wez@chromium.org, pavely@chromium.org, rouslan@chromium.org Review URL: https://codereview.chromium.org/1117703002 Cr-Commit-Position: refs/heads/master@{#327901} --- components/enhanced_bookmarks/bookmark_server_cluster_service.cc | 4 ++-- components/enhanced_bookmarks/bookmark_server_search_service.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'components/enhanced_bookmarks') diff --git a/components/enhanced_bookmarks/bookmark_server_cluster_service.cc b/components/enhanced_bookmarks/bookmark_server_cluster_service.cc index b0e0dcd..4ab125b 100644 --- a/components/enhanced_bookmarks/bookmark_server_cluster_service.cc +++ b/components/enhanced_bookmarks/bookmark_server_cluster_service.cc @@ -127,8 +127,8 @@ scoped_ptr BookmarkServerClusterService::CreateFetcher() { url = net::AppendQueryParameter(url, "v", model_->GetVersionString()); // Build the URLFetcher to perform the request. - scoped_ptr url_fetcher( - net::URLFetcher::Create(url, net::URLFetcher::POST, this)); + scoped_ptr url_fetcher = + net::URLFetcher::Create(url, net::URLFetcher::POST, this); // Binary encode a basic request proto. image_collections::ClusterRequest request_proto; diff --git a/components/enhanced_bookmarks/bookmark_server_search_service.cc b/components/enhanced_bookmarks/bookmark_server_search_service.cc index 063fa388..3236e73 100644 --- a/components/enhanced_bookmarks/bookmark_server_search_service.cc +++ b/components/enhanced_bookmarks/bookmark_server_search_service.cc @@ -76,8 +76,8 @@ scoped_ptr BookmarkServerSearchService::CreateFetcher() { url = net::AppendQueryParameter(url, "v", model_->GetVersionString()); // Build the URLFetcher to perform the request. - scoped_ptr url_fetcher( - net::URLFetcher::Create(url, net::URLFetcher::GET, this)); + scoped_ptr url_fetcher = + net::URLFetcher::Create(url, net::URLFetcher::GET, this); return url_fetcher; } -- cgit v1.1