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

Unified Diff: components/ntp_tiles/icon_cacher_impl.cc

Issue 2737873002: Avoid dependency on unspecified evaluation order of parameters. (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ntp_tiles/icon_cacher_impl.cc
diff --git a/components/ntp_tiles/icon_cacher_impl.cc b/components/ntp_tiles/icon_cacher_impl.cc
index 6c7076f85fa247e0e62d5fcdc0aae87f769412db..f9ac31869e7cf0fd3ff9a194262cb7f145a57ea6 100644
--- a/components/ntp_tiles/icon_cacher_impl.cc
+++ b/components/ntp_tiles/icon_cacher_impl.cc
@@ -49,8 +49,14 @@ void IconCacherImpl::StartFetch(
PopularSites::Site site,
const base::Closure& icon_available,
const base::Closure& preliminary_icon_available) {
+ // From [5.2.2] of the standard, "the order of evaluation of arguments is
+ // unspecified. All side effects of argument expression evaluations take
+ // effect before the function is entered" so copy values from |site| before
+ // it is moved.
sfiera 2017/03/08 09:38:54 I think "copy values from |site| before it is move
sdefresne 2017/03/08 18:35:35 Done.
+ GURL site_url = site.url;
+ favicon_base::IconType icon_type = IconType(site);
favicon::GetFaviconImageForPageURL(
- favicon_service_, site.url, IconType(site),
+ favicon_service_, site_url, icon_type,
base::Bind(&IconCacherImpl::OnGetFaviconImageForPageURLFinished,
base::Unretained(this), std::move(site), icon_available,
preliminary_icon_available),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698