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

Side by Side Diff: chrome/browser/android/popular_sites.cc

Issue 1551033002: Convert Pass()→std::move() in //chrome (Android edition) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Enable RVO by making types match Created 4 years, 11 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/android/popular_sites.h" 5 #include "chrome/browser/android/popular_sites.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 std::string thumbnail_url; 167 std::string thumbnail_url;
168 item->GetString("thumbnail_url", &thumbnail_url); 168 item->GetString("thumbnail_url", &thumbnail_url);
169 std::string large_icon_url; 169 std::string large_icon_url;
170 item->GetString("large_icon_url", &large_icon_url); 170 item->GetString("large_icon_url", &large_icon_url);
171 171
172 sites->push_back(PopularSites::Site(title, GURL(url), GURL(favicon_url), 172 sites->push_back(PopularSites::Site(title, GURL(url), GURL(favicon_url),
173 GURL(large_icon_url), 173 GURL(large_icon_url),
174 GURL(thumbnail_url))); 174 GURL(thumbnail_url)));
175 } 175 }
176 176
177 return sites.Pass(); 177 return sites;
178 } 178 }
179 179
180 } // namespace 180 } // namespace
181 181
182 PopularSites::Site::Site(const base::string16& title, 182 PopularSites::Site::Site(const base::string16& title,
183 const GURL& url, 183 const GURL& url,
184 const GURL& favicon_url, 184 const GURL& favicon_url,
185 const GURL& large_icon_url, 185 const GURL& large_icon_url,
186 const GURL& thumbnail_url) 186 const GURL& thumbnail_url)
187 : title(title), 187 : title(title),
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 base::Bind(&PopularSites::OnJsonParsed, weak_ptr_factory_.GetWeakPtr())); 277 base::Bind(&PopularSites::OnJsonParsed, weak_ptr_factory_.GetWeakPtr()));
278 } 278 }
279 279
280 void PopularSites::OnJsonParsed(scoped_ptr<std::vector<Site>> sites) { 280 void PopularSites::OnJsonParsed(scoped_ptr<std::vector<Site>> sites) {
281 if (sites) 281 if (sites)
282 sites_.swap(*sites); 282 sites_.swap(*sites);
283 else 283 else
284 sites_.clear(); 284 sites_.clear();
285 callback_.Run(!!sites); 285 callback_.Run(!!sites);
286 } 286 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698