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

Side by Side Diff: chrome/browser/ui/webui/engagement/site_engagement_ui.cc

Issue 1853263002: Replace free isnan with std::isnan (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/ui/webui/engagement/site_engagement_ui.h" 5 #include "chrome/browser/ui/webui/engagement/site_engagement_ui.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 engagement_info.push_back(std::move(origin_info)); 48 engagement_info.push_back(std::move(origin_info));
49 } 49 }
50 50
51 callback.Run(std::move(engagement_info)); 51 callback.Run(std::move(engagement_info));
52 } 52 }
53 53
54 void SetSiteEngagementScoreForOrigin(const mojo::String& origin, 54 void SetSiteEngagementScoreForOrigin(const mojo::String& origin,
55 double score) override { 55 double score) override {
56 GURL origin_gurl(origin.get()); 56 GURL origin_gurl(origin.get());
57 if (!origin_gurl.is_valid() || score < 0 || 57 if (!origin_gurl.is_valid() || score < 0 ||
58 score > SiteEngagementScore::kMaxPoints || isnan(score)) { 58 score > SiteEngagementScore::kMaxPoints || std::isnan(score)) {
59 return; 59 return;
60 } 60 }
61 61
62 SiteEngagementService* service = SiteEngagementService::Get(profile_); 62 SiteEngagementService* service = SiteEngagementService::Get(profile_);
63 service->ResetScoreForURL(origin_gurl, score); 63 service->ResetScoreForURL(origin_gurl, score);
64 } 64 }
65 65
66 private: 66 private:
67 // The Profile* handed to us in our constructor. 67 // The Profile* handed to us in our constructor.
68 Profile* profile_; 68 Profile* profile_;
(...skipping 23 matching lines...) Expand all
92 content::WebUIDataSource::Add(profile, source.release()); 92 content::WebUIDataSource::Add(profile, source.release());
93 } 93 }
94 94
95 SiteEngagementUI::~SiteEngagementUI() {} 95 SiteEngagementUI::~SiteEngagementUI() {}
96 96
97 void SiteEngagementUI::BindUIHandler( 97 void SiteEngagementUI::BindUIHandler(
98 mojo::InterfaceRequest<SiteEngagementUIHandler> request) { 98 mojo::InterfaceRequest<SiteEngagementUIHandler> request) {
99 ui_handler_.reset(new SiteEngagementUIHandlerImpl( 99 ui_handler_.reset(new SiteEngagementUIHandlerImpl(
100 Profile::FromWebUI(web_ui()), std::move(request))); 100 Profile::FromWebUI(web_ui()), std::move(request)));
101 } 101 }
OLDNEW
« 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