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

Side by Side Diff: components/enhanced_bookmarks/bookmark_server_cluster_service.cc

Issue 1117703002: Adjust URLFetcher::Create API so that object is returned as scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unneeded Pass() calls Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/enhanced_bookmarks/bookmark_server_cluster_service.h" 5 #include "components/enhanced_bookmarks/bookmark_server_cluster_service.h"
6 6
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 GURL url(kClusterUrl); 120 GURL url(kClusterUrl);
121 url = net::AppendQueryParameter(url, "output", "proto"); 121 url = net::AppendQueryParameter(url, "output", "proto");
122 122
123 // Append language. 123 // Append language.
124 if (!application_language_code_.empty()) 124 if (!application_language_code_.empty())
125 url = net::AppendQueryParameter(url, "hl", application_language_code_); 125 url = net::AppendQueryParameter(url, "hl", application_language_code_);
126 126
127 url = net::AppendQueryParameter(url, "v", model_->GetVersionString()); 127 url = net::AppendQueryParameter(url, "v", model_->GetVersionString());
128 128
129 // Build the URLFetcher to perform the request. 129 // Build the URLFetcher to perform the request.
130 scoped_ptr<net::URLFetcher> url_fetcher( 130 scoped_ptr<net::URLFetcher> url_fetcher =
131 net::URLFetcher::Create(url, net::URLFetcher::POST, this)); 131 net::URLFetcher::Create(url, net::URLFetcher::POST, this);
132 132
133 // Binary encode a basic request proto. 133 // Binary encode a basic request proto.
134 image_collections::ClusterRequest request_proto; 134 image_collections::ClusterRequest request_proto;
135 request_proto.set_cluster_all(true); 135 request_proto.set_cluster_all(true);
136 136
137 std::string proto_output; 137 std::string proto_output;
138 bool result = request_proto.SerializePartialToString(&proto_output); 138 bool result = request_proto.SerializePartialToString(&proto_output);
139 DCHECK(result); 139 DCHECK(result);
140 140
141 url_fetcher->SetUploadData("application/octet-stream", proto_output); 141 url_fetcher->SetUploadData("application/octet-stream", proto_output);
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 return false; 319 return false;
320 stars_ids.push_back(stars_id); 320 stars_ids.push_back(stars_id);
321 } 321 }
322 output.insert(std::make_pair(key, stars_ids)); 322 output.insert(std::make_pair(key, stars_ids));
323 } 323 }
324 out_map->swap(output); 324 out_map->swap(output);
325 return true; 325 return true;
326 } 326 }
327 327
328 } // namespace enhanced_bookmarks 328 } // namespace enhanced_bookmarks
OLDNEW
« no previous file with comments | « components/domain_reliability/uploader.cc ('k') | components/enhanced_bookmarks/bookmark_server_search_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698